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.

A305057 -5x + 1 sequence starting at 5.

Original entry on oeis.org

5, -24, -12, -6, -3, 16, 8, 4, 2, 1, -4, -2, -1, 6, 3, -14, -7, 36, 18, 9, -44, -22, -11, 56, 28, 14, 7, -34, -17, 86, 43, -214, -107, 536, 268, 134, 67, -334, -167, 836, 418, 209, -1044, -522, -261, 1306, 653, -3264, -1632, -816, -408, -204, -102, -51, 256, 128, 64, 32, 16, 8, 4, 2, 1, -4
Offset: 0

Views

Author

Alonso del Arte, May 26 2018

Keywords

Examples

			5 is odd, so it's followed by (-5) * 5 + 1 = -25 + 1 = -24.
-14 is even, so it's followed by -14/2 = -7.
		

Crossrefs

Cf. A259207.

Programs

  • Magma
    [n eq 1 select 5 else IsOdd(Self(n-1)) select -5*Self(n-1)+1 else Self(n-1) div 2: n in [1..80]]; // Vincenzo Librandi, Jun 11 2018
  • Mathematica
    NestList[If[EvenQ[#], #/2, -5# + 1] &, 5, 100]

Formula

a(0) = 5, a(n) = (-5)*a(n - 1) + 1 if a(n - 1) is odd, a(n) = a(n - 1)/2 otherwise.