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.

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

Original entry on oeis.org

1, 3, 6, 6, 2, 6, 4, 6, 10, 12, 6, 12, 10, 9, 16, 18, 6, 16, 18, 9, 22, 24, 6, 22, 24, 9, 28, 30, 6, 28, 30, 9, 34, 36, 6, 34, 36, 9, 40, 42, 6, 40, 42, 9, 46, 48, 6, 46, 48, 9, 52, 54, 6, 52, 54, 9, 58, 60, 6, 58, 60, 9, 64, 66, 6, 64, 66, 9, 70, 72, 6, 70, 72, 9, 76, 78, 6, 76, 78, 9, 82, 84, 6, 82, 84, 9, 88
Offset: 1

Views

Author

Altug Alkan, Aug 05 2019

Keywords

Comments

A well-defined solution sequence for recurrence a(n) = a(n-a(n-4)) + a(n-a(n-5)).

Crossrefs

Programs

  • Magma
    I:=[1,3,6,6,2,6,4];[n le 7 select I[n] else Self(n-Self(n-4))+Self(n-Self(n-5)): n in [1..90]]; // Marius A. Burtea, Aug 07 2019
  • Mathematica
    a[n_] := a[n] = If[n < 8, {1, 3, 6, 6, 2, 6, 4}[[n]], a[n - a[n-4]] + a[n - a[n-5]]]; Array[a, 87] (* Giovanni Resta, Aug 07 2019 *)
  • PARI
    q=vector(100); q[1]=1; q[2]=3; q[3]=q[4]=q[6]=6; q[5]=2; q[7]=4; for(n=8, #q, q[n] = q[n-q[n-4]]+q[n-q[n-5]]); q
    
  • PARI
    Vec(x*(1 + 3*x + 6*x^2 + 5*x^3 - x^4 - 3*x^6 + x^7 - 2*x^8 + 3*x^9 + x^10 + 2*x^11 - x^13 - 3*x^16 - 2*x^17 + 2*x^18 + 2*x^20 - 2*x^21) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)^2) + O(x^80)) \\ Colin Barker, Aug 15 2019
    

Formula

For k > 2:
a(6*k-4) = 9,
a(6*k-3) = 6*k-2,
a(6*k-2) = 6*k,
a(6*k-1) = 6,
a(6*k) = 6*k-2,
a(6*k+1) = 6*k.
From Colin Barker, Aug 05 2019: (Start)
G.f.: x*(1 + 3*x + 6*x^2 + 5*x^3 - x^4 - 3*x^6 + x^7 - 2*x^8 + 3*x^9 + x^10 + 2*x^11 - x^13 - 3*x^16 - 2*x^17 + 2*x^18 + 2*x^20 - 2*x^21) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)^2).
a(n) = a(n-3) + a(n-6) - a(n-9) for n > 22.
(End)