OFFSET
1,1
LINKS
Altug Alkan, Table of n, a(n) for n = 1..10000
Altug Alkan, Scatterplot of a(n) for n <= 500000
MAPLE
a:= proc(n) option remember; procname(n-procname(n-1))+procname(n-procname(n-2))+procname(n-procname(n-3)) end proc:
a(1):= 2: a(2):= 2: a(3):= 2: a(4):= 4: a(5):= 5: a(6):= 5:
map(a, [$1..100]); # after Robert Israel at A296440
MATHEMATICA
a[n_] := a[n] = If[n<7, {2, 2, 2, 4, 5, 5}[[n]], a[n - a[n-1]] + a[n - a[n-2]] + a[n - a[n-3]]]; Array[a, 100] (* after Giovanni Resta at A296440 *)
PROG
(PARI) q=vector(10^5); q[1]=2; q[2]=2; q[3]=2; q[4]=4; q[5]=5; q[6]=5; for(n=7, #q, q[n] = q[n-q[n-1]]+q[n-q[n-2]]+q[n-q[n-3]]); q
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Altug Alkan, Dec 18 2017
STATUS
approved