The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 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
 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, 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, 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 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 LINKS Colin Barker, Table of n, a(n) for n = 1..1000 Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,2,0,0,0,0,0,-1). FORMULA 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 From Colin Barker, Dec 11 2017: (Start) 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). a(n) = 2*a(n-6) - a(n-12) for n>13. (End) MATHEMATICA 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 *) PROG (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 (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 CROSSREFS Cf. A244477. Sequence in context: A110316 A111975 A117250 * A308432 A136692 A219194 Adjacent sequences:  A296334 A296335 A296336 * A296338 A296339 A296340 KEYWORD nonn,easy AUTHOR Altug Alkan, Dec 10 2017 STATUS approved

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

Last modified August 11 23:45 EDT 2020. Contains 336434 sequences. (Running on oeis4.)