login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A296440
a(1) = 2, a(2) = a(3) = 3, a(4) = 4, a(5) = a(6) = 6; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) for n > 6.
6
2, 3, 3, 4, 6, 6, 7, 8, 8, 9, 9, 10, 11, 13, 13, 12, 14, 16, 16, 14, 19, 17, 18, 19, 21, 21, 20, 22, 23, 24, 23, 24, 25, 26, 26, 27, 27, 28, 29, 30, 30, 31, 32, 34, 33, 34, 35, 37, 36, 37, 39, 36, 39, 42, 39, 41, 41, 44, 45, 41, 40, 50, 46, 48, 43, 48, 51, 49, 49, 54, 48, 53, 51, 58, 50, 58, 52, 57, 56, 59, 57, 60, 58
OFFSET
1,1
COMMENTS
Conjecture: Sequence is infinite.
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):= 3: a(3):= 3: a(4):= 4: a(5):= 6: a(6):= 6:
map(a, [$1..100]); # Robert Israel, Dec 12 2017
MATHEMATICA
a[n_] := a[n] = If[n<7, {2, 3, 3, 4, 6, 6}[[n]], a[n - a[n-1]] + a[n - a[n-2]] + a[n - a[n-3]]]; Array[a, 83] (* Giovanni Resta, Dec 13 2017 *)
PROG
(PARI) q=vector(10^5); q[1]=2; q[2]=3; q[3]=3; q[4]=4; q[5]=6; q[6]=6; for(n=7, #q, q[n] = q[n-q[n-1]]+q[n-q[n-2]]+q[n-q[n-3]]); q
(Scheme, with memoization-macro definec) (definec (A296440 n) (cond ((= 1 n) 2) ((<= n 3) 3) ((= 4 n) 4) ((<= n 6) 6) (else (+ (A296440 (- n (A296440 (- n 1)))) (A296440 (- n (A296440 (- n 2)))) (A296440 (- n (A296440 (- n 3)))))))) ;; Antti Karttunen, Dec 13 2017
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Altug Alkan, Dec 12 2017
STATUS
approved