login
a(n) = 10 - n for 1 <= n <= 9. Thereafter a(n) = a(n-a(n-3)) + a(n-a(n-6)).
1

%I #27 Sep 08 2022 08:46:21

%S 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,

%T 14,16,33,17,16,30,20,28,9,20,16,42,26,25,39,20,28,9,29,25,51,29,28,

%U 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

%N a(n) = 10 - n for 1 <= n <= 9. Thereafter a(n) = a(n-a(n-3)) + a(n-a(n-6)).

%H Altug Alkan, <a href="/A304621/b304621.txt">Table of n, a(n) for n = 1..10000</a>

%p f:= proc(n) option remember; procname(n-procname(n-3))+procname(n-procname(n-6)) end proc:

%p for i from 1 to 9 do f(i):= 10-i od:

%p map(f, [$1..100]); # _Robert Israel_, May 16 2018

%t Nest[Append[#, #[[1 + Length@ # - #[[-3]] ]] + #[[1 + Length@ # - #[[-6]] ]] ] &, Range[9, 1, -1], 77] (* _Michael De Vlieger_, May 20 2018 *)

%o (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

%o (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

%Y Cf. A005185, A240827, A244477.

%K nonn,look

%O 1,1

%A _Altug Alkan_, May 15 2018