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”).

A304621
a(n) = 10 - n for 1 <= n <= 9. Thereafter a(n) = a(n-a(n-3)) + a(n-a(n-6)).
1
9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 5, 7, 15, 8, 10, 12, 8, 7, 9, 14, 13, 24, 11, 13, 21, 17, 16, 9, 14, 16, 33, 17, 16, 30, 20, 28, 9, 20, 16, 42, 26, 25, 39, 20, 28, 9, 29, 25, 51, 29, 28, 48, 26, 31, 9, 32, 31, 60, 32, 28, 57, 32, 37, 9, 32, 34, 69, 56, 37, 66, 26, 40, 9, 32, 40, 78, 56, 40, 75, 38, 52, 9, 44, 37, 87, 50
OFFSET
1,1
MAPLE
f:= proc(n) option remember; procname(n-procname(n-3))+procname(n-procname(n-6)) end proc:
for i from 1 to 9 do f(i):= 10-i od:
map(f, [$1..100]); # Robert Israel, May 16 2018
MATHEMATICA
Nest[Append[#, #[[1 + Length@ # - #[[-3]] ]] + #[[1 + Length@ # - #[[-6]] ]] ] &, Range[9, 1, -1], 77] (* Michael De Vlieger, May 20 2018 *)
PROG
(PARI) q=vector(10^5); for(n=1, 9, q[n]=9-n+1); for(n=10, #q, q[n]=q[n-q[n-3]]+ q[n-q[n-6]]); q
(Magma) [n le 9 select 10-n else Self(n-Self(n-3))+Self(n-Self(n-6)): n in [1..80]]; // Vincenzo Librandi, May 20 2018
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Altug Alkan, May 15 2018
STATUS
approved