cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A296413 a(1) = a(2) = a(3) = 1, a(4) = 4, a(5) = 3; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) for n > 5.

This page as a plain text file.
%I A296413 #37 Mar 15 2025 02:36:58
%S A296413 1,1,1,4,3,5,6,5,9,8,7,8,11,12,11,10,14,15,16,12,17,16,18,16,24,14,19,
%T A296413 25,23,16,21,26,28,21,27,25,26,26,34,29,25,30,38,33,25,33,40,34,30,30,
%U A296413 48,36,35,36,44,37,40,44,43,36,53,39,43,48,44,49,49,48,41,56,45,50,57,53,55,51,46,63,63,49,56,58,64,51
%N A296413 a(1) = a(2) = a(3) = 1, a(4) = 4, a(5) = 3; a(n) = a(n-a(n-1)) + a(n-a(n-2)) + a(n-a(n-3)) for n > 5.
%C A296413 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.
%H A296413 Altug Alkan, <a href="/A296413/a296413.png">Line graph of A296413</a>
%o A296413 (PARI) my(q=vector(100)); 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
%o A296413 (Scheme)
%o A296413 ;; With memoization-macro definec.
%o A296413 (definec (A296413 n) (cond ((< n 1) (error "Dead!")) ((<= n 3) 1) ((= 4 n) 4) ((= 5 n) 3) (else (+ (A296413 (- n (A296413 (- n 1)))) (A296413 (- n (A296413 (- n 2)))) (A296413 (- n (A296413 (- n 3)))))))) ;; _Antti Karttunen_, Dec 13 2017
%Y A296413 Cf. A278055, A292351, A296440.
%K A296413 nonn,fini
%O A296413 1,4
%A A296413 _Altug Alkan_, Dec 11 2017