login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 1

%I #21 Dec 19 2017 09:22:58

%S 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 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 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 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 Colin Barker, <a href="/A296337/b296337.txt">Table of n, a(n) for n = 1..1000</a>

%H <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 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 From _Colin Barker_, Dec 11 2017: (Start)

%F 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 a(n) = 2*a(n-6) - a(n-12) for n>13.

%F (End)

%t 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 (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 (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 Cf. A244477.

%K nonn,easy

%O 1,2

%A _Altug Alkan_, Dec 10 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 04:23 EDT 2024. Contains 371264 sequences. (Running on oeis4.)