%I #4 Mar 19 2017 19:26:20
%S 624,4,312,8,624,4,312,12,624,4,312,16,624,4,312,20,624,4,312,24,624,
%T 4,312,28,624,4,312,32,624,4,312,36,624,4,312,40,624,4,312,44,624,4,
%U 312,48,624,4,312,52,624,4,312,56,624,4,312,60
%N Relative of Hofstadter Q-sequence: a(-311) = 312, a(-310) = 4, a(-309) = 312, a(-308) = 4; 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<=-312.
%C Sequences like this are more naturally considered with the first nonzero term in position 1. But this sequence would then begin with 312 terms consisting entirely of alternating 4 and 312.
%C This sequence has exactly 6632 terms, since a(6632)=0 and computing a(6633) would refer to itself.
%H Nathan Fox, <a href="/A283898/b283898.txt">Table of n, a(n) for n = 1..6632</a>
%p A283898:=proc(n) option remember: if n <= -312 then 0: elif n = -311 then 312: elif n = -310 then 4: elif n = -309 then 312: elif n = -308 then 4: else A283898(n-A283898(n-1)) + A283898(n-A283898(n-2)): fi: end:
%Y Cf. A005185, A283899, A283900, A283901, A283902.
%K nonn,fini,full
%O 1,1
%A _Nathan Fox_, Mar 19 2017
|