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.

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

This page as a plain text file.
%I A296337 #21 Dec 19 2017 09:22:58
%S A296337 1,2,1,4,4,4,2,8,3,4,10,10,2,14,3,4,16,16,2,20,3,4,22,22,2,26,3,4,28,
%T A296337 28,2,32,3,4,34,34,2,38,3,4,40,40,2,44,3,4,46,46,2,50,3,4,52,52,2,56,
%U A296337 3,4,58,58,2,62,3,4,64,64,2,68,3,4,70,70,2,74,3,4,76,76,2,80,3,4,82,82
%N A296337 a(1) = a(3) = 1, a(2) = 2, a(4) = a(5) = 4; a(n) = a(n-a(n-1)) + a(n-a(n-2)) for n > 5.
%H A296337 Colin Barker, <a href="/A296337/b296337.txt">Table of n, a(n) for n = 1..1000</a>
%H A296337 <a href="/index/Rec#order_12">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,2,0,0,0,0,0,-1).
%F A296337 a(6*k + 1) = 2, a(6*k - 4) = 6*k - 4, a(6*k + 3) = 3, a(6*k - 2) = 4, a(6*k - 1) = a(6*k) = 6*k - 2 for k >= 1. - _Iain Fox_, Dec 10 2017
%F A296337 From _Colin Barker_, Dec 11 2017: (Start)
%F A296337 G.f.: x*(1 + 2*x + x^2 + 4*x^3 + 4*x^4 + 4*x^5 + 4*x^7 + x^8 - 4*x^9 + 2*x^10 + 2*x^11 - x^12 - 2*x^14) / ((1 - x)^2*(1 + x)^2*(1 - x + x^2)^2*(1 + x + x^2)^2).
%F A296337 a(n) = 2*a(n-6) - a(n-12) for n>13.
%F A296337 (End)
%t A296337 Fold[Append[#1, #1[[#2 - #1[[#2 - 1]] ]] + #1[[#2 - #1[[#2 - 2]] ]] ] &, {1, 2, 1, 4, 4}, Range[6, 84]] (* _Michael De Vlieger_, Dec 11 2017 *)
%o A296337 (PARI) q=vector(10^5); q[1]=1;q[2]=2;q[3]=1;q[4]=4;q[5]=4;for(n=6, #q, q[n] = q[n-q[n-1]]+q[n-q[n-2]]); q
%o A296337 (PARI) Vec(x*(1 + 2*x + x^2 + 4*x^3 + 4*x^4 + 4*x^5 + 4*x^7 + x^8 - 4*x^9 + 2*x^10 + 2*x^11 - x^12 - 2*x^14) / ((1 - x)^2*(1 + x)^2*(1 - x + x^2)^2*(1 + x + x^2)^2) + O(x^40)) \\ _Colin Barker_, Dec 11 2017
%Y A296337 Cf. A244477.
%K A296337 nonn,easy
%O A296337 1,2
%A A296337 _Altug Alkan_, Dec 10 2017