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.

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

Original entry on oeis.org

1, 2, 2, 7, 5, 1, 7, 2, 9, 3, 11, 3, 6, 4, 14, 5, 9, 16, 6, 15, 6, 10, 8, 21, 21, 21, 2, 28, 3, 30, 3, 6, 4, 33, 5, 9, 35, 6, 34, 6, 10, 8, 40, 40, 40, 2, 47, 3, 49, 3, 6, 4, 52, 5, 9, 54, 6, 53, 6, 10, 8, 59, 59, 59, 2, 66, 3, 68, 3, 6, 4, 71, 5, 9, 73, 6, 72, 6, 10, 8, 78, 78, 78, 2, 85, 3, 87, 3, 6, 4
Offset: 1

Views

Author

Altug Alkan and Rémy Sigrist, Aug 07 2019

Keywords

Comments

A well-defined solution sequence for recurrence a(n) = a(n-a(n-1)) + a(n-a(n-3)).

Crossrefs

Programs

  • Magma
    I:=[1,2,2,7,5,1,7,2];[n le 8 select I[n] else Self(n-Self(n-1))+Self(n-Self(n-3)): n in [1..90]]; // Marius A. Burtea, Aug 08 2019
  • PARI
    q=vector(100); q[1]=q[6]=1; q[2]=q[3]=q[8]=2; q[4]=q[7]=7; q[5]=5; for(n=9, #q, q[n]=q[n-q[n-1]]+q[n-q[n-3]]); q
    
  • PARI
    Vec(x*(1 + x)*(1 + x + x^2 + 6*x^3 - x^4 + 2*x^5 + 5*x^6 - 3*x^7 + 12*x^8 - 9*x^9 + 20*x^10 - 17*x^11 + 23*x^12 - 19*x^13 + 33*x^14 - 28*x^15 + 37*x^16 - 21*x^17 + 27*x^18 - 14*x^19 + 16*x^20 - 10*x^21 + 4*x^22 + 7*x^23 + 12*x^24 - 5*x^25 + 3*x^26 + 7*x^27 - 10*x^28 + 18*x^29 - 21*x^30 + 15*x^31 - 19*x^32 + 24*x^33 - 29*x^34 + 20*x^35 - 17*x^36 + 11*x^37 - 6*x^38 + 2*x^39 - 10*x^40 + 9*x^41 - 6*x^42 + 5*x^43) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^10 + x^11 + x^12 + x^13 + x^14 + x^15 + x^16 + x^17 + x^18)^2) + O(x^90)) \\ Colin Barker, Aug 11 2019
    

Formula

For k >= 1:
a(19*k-11) = 2,
a(19*k-10) = 19*k-10,
a(19*k-9) = 3,
a(19*k-8) = 19*k-8,
a(19*k-7) = 3,
a(19*k-6) = 6,
a(19*k-5) = 4,
a(19*k-4) = 19*k-5,
a(19*k-3) = 5,
a(19*k-2) = 9,
a(19*k-1) = 19*k-3,
a(19*k) = 6,
a(19*k+1) = 19*k-4,
a(19*k+2) = 6,
a(19*k+3) = 10,
a(19*k+4) = 8,
a(19*k+5) = a(19*k+6) = a(19*k+7) = 19*k+2.
From Colin Barker, Aug 08 2019: (Start)
G.f.: x*(1 + x)*(1 + x + x^2 + 6*x^3 - x^4 + 2*x^5 + 5*x^6 - 3*x^7 + 12*x^8 - 9*x^9 + 20*x^10 - 17*x^11 + 23*x^12 - 19*x^13 + 33*x^14 - 28*x^15 + 37*x^16 - 21*x^17 + 27*x^18 - 14*x^19 + 16*x^20 - 10*x^21 + 4*x^22 + 7*x^23 + 12*x^24 - 5*x^25 + 3*x^26 + 7*x^27 - 10*x^28 + 18*x^29 - 21*x^30 + 15*x^31 - 19*x^32 + 24*x^33 - 29*x^34 + 20*x^35 - 17*x^36 + 11*x^37 - 6*x^38 + 2*x^39 - 10*x^40 + 9*x^41 - 6*x^42 + 5*x^43) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^10 + x^11 + x^12 + x^13 + x^14 + x^15 + x^16 + x^17 + x^18)^2).
a(n) = 2*a(n-19) - a(n-38) for n > 45.
(End)