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-2 of 2 results.

A328011 The 5x + 1 sequence beginning at 1.

Original entry on oeis.org

1, 6, 3, 16, 8, 4, 2, 1, 6, 3, 16, 8, 4, 2, 1, 6, 3, 16, 8, 4, 2, 1, 6, 3, 16, 8, 4, 2, 1, 6, 3, 16, 8, 4, 2, 1, 6, 3, 16, 8, 4, 2, 1, 6, 3, 16, 8, 4, 2, 1, 6, 3, 16, 8, 4, 2, 1, 6, 3, 16, 8, 4, 2, 1, 6, 3, 16, 8, 4, 2, 1, 6, 3, 16, 8, 4, 2, 1, 6, 3, 16, 8, 4, 2, 1
Offset: 0

Views

Author

Antoine Beaulieu, Oct 01 2019

Keywords

Comments

See A328010 for further information.

Crossrefs

Programs

  • PARI
    Vec((1 + 6*x + 3*x^2 + 16*x^3 + 8*x^4 + 4*x^5 + 2*x^6) / ((1 - x)*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)) + O(x^80)) \\ Colin Barker, Oct 08 2019

Formula

a(n+1) = 5*a(n) + 1 if a(n) is odd, a(n+1) = a(n)/2 otherwise.
From Colin Barker, Oct 08 2019: (Start)
G.f.: (1 + 6*x + 3*x^2 + 16*x^3 + 8*x^4 + 4*x^5 + 2*x^6) / ((1 - x)*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)).
a(n) = a(n-7) for n>6.
(End)

A028389 The 5x + 1 sequence beginning at 7.

Original entry on oeis.org

7, 36, 18, 9, 46, 23, 116, 58, 29, 146, 73, 366, 183, 916, 458, 229, 1146, 573, 2866, 1433, 7166, 3583, 17916, 8958, 4479, 22396, 11198, 5599, 27996, 13998, 6999, 34996, 17498, 8749, 43746, 21873, 109366, 54683, 273416, 136708, 68354, 34177, 170886, 85443, 427216
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    f := proc(n) option remember; if n = 0 then 7 elif f(n-1) mod 2 = 0 then f(n-1)/2 else 5*f(n-1)+1; fi; end; seq(f(n), n=0..50);
  • Mathematica
    a[0] = 7; a[n_] := a[n] = If[OddQ[a[n-1]], 5 a[n-1] + 1, a[n-1]/2];
    a /@ Range[0, 50] (* Jean-François Alcover, Nov 03 2020 *)
    NestList[If[OddQ[#],5#+1,#/2]&,7,50] (* Harvey P. Dale, Nov 03 2022 *)

Formula

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

Extensions

Named edited by Andrew Howroyd, Aug 21 2020
Showing 1-2 of 2 results.