login
a(n)=1 for n <= s+k; thereafter a(n) = Sum(a(n-i-s-a(n-i-1)),i=0..k-1) where s=0, k=5.
7

%I #22 Nov 10 2017 05:13:43

%S 1,1,1,1,1,5,5,5,5,5,9,9,9,9,13,9,13,13,17,13,17,13,17,17,21,17,21,21,

%T 21,21,25,25,25,25,25,29,29,29,29,33,29,33,33,37,33,37,33,41,37,41,37,

%U 45,37,45,41,49,41,49,41,53,45,53,45,57,45,57,49,61,49,61,49,61,53,65,53,65,57,65,57,69,61,69,61

%N a(n)=1 for n <= s+k; thereafter a(n) = Sum(a(n-i-s-a(n-i-1)),i=0..k-1) where s=0, k=5.

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

%H Joseph Callaghan, John J. Chew III, and Stephen M. Tanny, <a href="http://dx.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).

%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:=5;

%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 s = 0; k = 5; a[n_] := a[n] = If[n <= s + k, 1, Sum[a[n - i - s - a[n - i - 1]], {i, 0, k - 1}]]; Array[a, 100] (* _Jean-François Alcover_, Nov 10 2017 *)

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

%O 1,6

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