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.

A302130 a(n) = a(a(n-3)) + a(n-a(n-2)) with a(1) = a(2) = a(3) = a(4) = 1, a(5) = 2, a(6) = 5.

Original entry on oeis.org

1, 1, 1, 1, 2, 5, 3, 2, 7, 3, 2, 10, 3, 2, 13, 3, 2, 16, 3, 2, 19, 3, 2, 22, 3, 2, 25, 3, 2, 28, 3, 2, 31, 3, 2, 34, 3, 2, 37, 3, 2, 40, 3, 2, 43, 3, 2, 46, 3, 2, 49, 3, 2, 52, 3, 2, 55, 3, 2, 58, 3, 2, 61, 3, 2, 64, 3, 2, 67, 3, 2, 70, 3, 2, 73, 3, 2, 76, 3, 2, 79, 3, 2, 82, 3, 2, 85, 3, 2, 88
Offset: 1

Views

Author

Altug Alkan, Jun 20 2018

Keywords

Comments

A quasi-periodic solution to the recurrence a(n) = a(a(n-3)) + a(n-a(n-2)).

Examples

			a(3*k-2) = 3, a(3*k-1) = 2, a(3*k) = 3*k - 2 for k > 2.
		

Crossrefs

Cf. A244477.

Programs

  • GAP
    a:=[1,1,1,1,2,5];; for n in [7..100] do a[n]:=a[a[n-3]]+a[n-a[n-2]]; od; a; # Muniru A Asiru, Jun 26 2018
  • Mathematica
    LinearRecurrence[{0,0,2,0,0,-1},{1,1,1,1,2,5,3,2,7,3,2,10},100] (* Harvey P. Dale, Apr 20 2022 *)
  • PARI
    a=vector(99); a[1]=a[2]=a[3]=a[4]=1;a[5]=2;a[6]=5;for(n=7, #a, a[n] = a[a[n-3]]+a[n-a[n-2]]); a
    
  • PARI
    Vec(x*(1 + x + x^2 - x^3 + 3*x^5 + 2*x^6 - x^7 - 2*x^8 - 2*x^9 + x^11) / ((1 - x)^2*(1 + x + x^2)^2) + O(x^80)) \\ Colin Barker, Jun 20 2018
    

Formula

From Colin Barker, Jun 20 2018: (Start)
G.f.: x*(1 + x + x^2 - x^3 + 3*x^5 + 2*x^6 - x^7 - 2*x^8 - 2*x^9 + x^11) / ((1 - x)^2*(1 + x + x^2)^2).
a(n) = 2*a(n-3) - a(n-6) for n>10.
(End)