login
a(n)=1 for n <= s+k; thereafter a(n) = Sum_{i=0..k-1} a(n-i-s-a(n-i-1)) where s=0, k=4.
6

%I #23 Dec 06 2023 14:08:00

%S 1,1,1,1,4,4,4,4,7,7,7,10,7,10,13,10,13,13,13,16,16,16,16,16,19,19,19,

%T 22,19,22,25,22,25,25,25,28,28,28,28,31,31,31,34,31,34,37,34,37,37,34,

%U 40,40,37,43,40,40,46,43,43,46,46,46,49,49,46,52,52,49,55,52,52,58,55,55,58,55,58,61,58,61,61,61

%N a(n)=1 for n <= s+k; thereafter a(n) = Sum_{i=0..k-1} a(n-i-s-a(n-i-1)) where s=0, k=4.

%H N. J. A. Sloane, <a href="/A240835/b240835.txt">Table of n, a(n) for n = 1..20000</a>

%H Joseph Callaghan, John J. Chew III, and Stephen M. Tanny, <a href="https://doi.org/10.1137/S0895480103421397">On the behavior of a family of meta-Fibonacci sequences</a>, SIAM Journal on Discrete Mathematics 18.4 (2005): 794-824. See Eq. (1.7) and Table 6.1

%H <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a>

%p #T_s,k(n) from Callaghan et al. Eq. (1.7).

%p s:=0; k:=4;

%p a:=proc(n) option remember; global s,k;

%p if n <= s+k then 1

%p else

%p add(a(n-i-s-a(n-i-1)),i=0..k-1);

%p fi; end;

%p t1:=[seq(a(n),n=1..100)];

%t A240835[n_]:=A240835[n]=If[n<=4,1,Sum[A240835[n-i-A240835[n-i-1]],{i,0,3}]];

%t Array[A240835,100] (* _Paolo Xausa_, Dec 06 2023 *)

%Y Callaghan et al. (2005)'s sequences T_{0,k}(n) for k=1 through 7 are A000012, A046699, A046702, A240835, A241154, A241155, A240830.

%K nonn,hear

%O 1,5

%A _N. J. A. Sloane_, Apr 16 2014