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.

A271063 a(1) = 2, a(2) = 3; thereafter a(n) = a(n-1) + a(|n-a(T)|), where a(T) is the largest term in the sequence before a(n) such that 0 < |n-a(T)| < n.

Original entry on oeis.org

2, 3, 5, 7, 10, 17, 22, 25, 50, 72, 89, 161, 322, 411, 483, 533, 558, 580, 597, 607, 614, 619, 622, 624, 629, 1253, 1875, 2494, 3108, 3715, 4312, 4892, 5450, 5983, 6466, 6877, 13343, 19326, 24776, 29668, 33980, 37695, 40803, 43297, 86594, 127397, 165092, 199072, 228740, 253516
Offset: 1

Views

Author

Cody M. Haderlie, Apr 05 2016

Keywords

Comments

When a(1) = 1, the formula generates the natural numbers.

Examples

			a(11) = 89
a(T) = a(7) = 22
|12-22| = 10
a(10) = 72
89 + 72 = 161
a(12) = 161
		

Programs

  • Mathematica
    a = {2, 3}; Do[AppendTo[a, a[[n - 1]] + Part[a, #] &@ SelectFirst[ Reverse@ Abs[a - n], 0 < # < n &]], {n, 3, 50}]; a (* Michael De Vlieger, Apr 08 2016 *)
  • PARI
    lista(nn) = {va = vector(nn); print1(va[1] = 2, ", "); print1(va[2] = 3, ", "); for (n=3, nn, T = 0; forstep(k = n-1, 1, -1, vabs = abs(n - va[k]); if ((vabs < n) && (vabs > 0), T = k; break);); va[n] = va[n-1] + va[abs(n-va[T])]; print1(va[n], ", "););} \\ Michel Marcus, Apr 08 2016