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.

Showing 1-1 of 1 results.

A322558 a(0)=1, a(1)=1; for n>1, a(n)=a(n-1)+a(n-2) if a(n-1) is less than or equal to n-1, otherwise a(n)=a(n-1)-(n-1).

Original entry on oeis.org

1, 1, 2, 3, 5, 1, 6, 7, 13, 5, 18, 8, 26, 14, 1, 15, 16, 31, 14, 45, 26, 6, 32, 10, 42, 18, 60, 34, 7, 41, 12, 53, 22, 75, 42, 8, 50, 14, 64, 26, 90, 50, 9, 59, 16, 75, 30, 105, 58, 10, 68, 18, 86, 34, 120, 66, 11, 77, 20, 97, 38, 135, 74, 12, 86, 22, 108, 42, 150, 82, 13, 95, 24, 119, 46, 165, 90, 14, 104, 26
Offset: 0

Views

Author

Jackson Haselhorst, Aug 28 2019

Keywords

Comments

The graph of the sequence appears random until n>16, after which the graph creates seven distinct lines.

Crossrefs

Programs

  • Mathematica
    a[0] = a[1] = 1; a[n_] := a[n] = If[a[n - 1] <= n - 1, a[n - 1] + a[n - 2], a[n - 1] - n + 1]; Array[a, 100, 0] (* Amiram Eldar, Aug 29 2019 *)
  • PARI
    Vec((1 + x + 2*x^2 + 3*x^3 + 5*x^4 + x^5 + 6*x^6 + 5*x^7 + 11*x^8 + x^9 + 12*x^10 - 2*x^11 + 24*x^12 + 2*x^13 - 12*x^14 - 10*x^15 + 8*x^16 - 2*x^17 + 3*x^18 - 6*x^19 + 4*x^20 + 11*x^21 + 15*x^22 - 17*x^23 - 2*x^24 - 2*x^25 - 4*x^26 - 4*x^27 - 4*x^28 - 8*x^29 + 8*x^30) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)^2) + O(x^40)) \\ Colin Barker, Aug 29 2019

Formula

For n>16, the sequence follows a pattern of seven, and each term lies on one of the following lines:
If n is of the form 7k+3, then a(n) = (11/7)n+(30/7);
if n is of the form 7k+4, then a(n) = (4/7)n+(26/7);
if n is of the form 7k+5, then a(n) = (15/7)n+(30/7);
if n is of the form 7k+6, then a(n) = (8/7)n+(22/7);
if n is of the form 7k, then a(n) = (1/7)n+3;
if n is of the form 7k+1, then a(n) = (9/7)n+(26/7);
if n is of the form 7k+2, then a(n) = (2/7)n+(24/7).
From Colin Barker, Aug 29 2019: (Start)
G.f.: (1 + x + 2*x^2 + 3*x^3 + 5*x^4 + x^5 + 6*x^6 + 5*x^7 + 11*x^8 + x^9 + 12*x^10 - 2*x^11 + 24*x^12 + 2*x^13 - 12*x^14 - 10*x^15 + 8*x^16 - 2*x^17 + 3*x^18 - 6*x^19 + 4*x^20 + 11*x^21 + 15*x^22 - 17*x^23 - 2*x^24 - 2*x^25 - 4*x^26 - 4*x^27 - 4*x^28 - 8*x^29 + 8*x^30) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)^2).
a(n) = 2*a(n-7) - a(n-14) for n>30.
(End)
Showing 1-1 of 1 results.