login
Relative of Hofstadter Q-sequence: a(-90) = 91, a(-89) = 2; thereafter a(n) = a(n-a(n-1)) + a(n-a(n-2)).
5

%I #4 Mar 19 2017 19:26:14

%S 93,2,184,2,184,2,184,2,184,2,184,2,184,2,184,2,184,2,184,2,184,2,184,

%T 2,184,2,184,2,184,2,184,2,184,2,184,2,184,2,184,2,184,2,184,2,184,2,

%U 184,2,184,2,184,2,184,2,184,2,184,2,184,2

%N Relative of Hofstadter Q-sequence: a(-90) = 91, a(-89) = 2; thereafter a(n) = a(n-a(n-1)) + a(n-a(n-2)).

%C In calculating terms of this sequence, use the convention that a(n)=0 for n<=-91.

%C Sequences like this are more naturally considered with the first nonzero term in position 1. But this sequence would then begin with 91 terms consisting entirely of alternating 2 and 91.

%C This sequence has exactly 375 terms, since a(375)=0 and computing a(376) would refer to itself.

%H Nathan Fox, <a href="/A283897/b283897.txt">Table of n, a(n) for n = 1..375</a>

%p A283897:=proc(n) option remember: if n <= -91 then 0: elif n = -90 then 91: elif n = -89 then 2: else A283897(n-A283897(n-1)) + A283897(n-A283897(n-2)): fi: end:

%Y Cf. A005185, A278066, A278067, A278068, A283893, A283894, A283895, A283896.

%K nonn,fini,full

%O 1,1

%A _Nathan Fox_, Mar 19 2017