A304590 a(1) = a(2) = a(3) = a(5) = 1, a(4) = 2, a(6) = 3; a(n) = a(n-a(n-3)) + a(n-a(n-6)) for n > 6.
1, 1, 1, 2, 1, 3, 4, 8, 11, 11, 12, 12, 12, 4, 3, 3, 13, 6, 7, 7, 9, 10, 14, 9, 9, 19, 12, 13, 14, 15, 16, 18, 15, 15, 22, 18, 19, 10, 18, 18, 23, 18, 18, 24, 24, 26, 23, 24, 30, 31, 24, 29, 25, 30, 28, 25, 27, 29, 30, 30, 33, 37, 33, 38, 35, 33, 29, 31, 36, 41, 36, 36, 42, 28, 36, 37, 53, 36, 37, 41, 48, 48, 33
Offset: 1
Keywords
Links
- Altug Alkan, Table of n, a(n) for n = 1..10000
Programs
-
GAP
a:=[1,1,1,2,1,3];; for n in [7..100] do a[n]:=a[n-a[n-3]]+a[n-a[n-6]]; od; a; # Muniru A Asiru, May 19 2018
-
Maple
f:= proc(n) option remember; procname(n-procname(n-3))+procname(n-procname(n-6)) end proc: for i from 1 to 6 do f(i):= [1,1,1,2,1,3][i] od: map(f, [$1..100]); # Robert Israel, May 16 2018
-
Mathematica
Nest[Append[#2, #2[[#1 - #2[[-3]] ]] + #2[[#1 - #2[[-6]] ]] ] & @@ {Length@ # + 1, #} &, {1, 1, 1, 2, 1, 3}, 77] (* Michael De Vlieger, Jul 20 2018 *)
-
PARI
q=vector(100); q[1]=q[2]=q[3]=q[5]=1;q[4]=2;q[6]=3; for(n=7, #q, q[n]=q[n-q[n-3]]+q[n-q[n-6]]); q