OFFSET
1,4
COMMENTS
For this recurrence (a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) with five initial conditions, only three options such that 1 <= a(i) <= 5 with 1 <= i <= 5 result in a sequence that does not quickly terminate, of which A278055 is the only well-behaved sequence. The other two sets of initial conditions are (1,1,1,4,3) (which yields this sequence) and (1,1,3,4,4), which yields A292351. This sequence is finite but has a relatively long life: a(509871) = 519293 is its final term since a(509872) refers to a nonpositive index and thus fails to exist; see graph in Links section.
LINKS
Altug Alkan, Line graph of A296413
PROG
(PARI) q=vector(10^5); q[1]=1; q[2]=1; q[3]=1; q[4]=4; q[5]=3; for(n=6, #q, q[n] = q[n-q[n-1]]+q[n-q[n-2]]+q[n-q[n-3]]); q
CROSSREFS
KEYWORD
nonn,fini
AUTHOR
Altug Alkan, Dec 11 2017
STATUS
approved