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

A185452 Image of n under the map n -> n/2 if n even, (5*n+1)/2 if n odd.

Original entry on oeis.org

0, 3, 1, 8, 2, 13, 3, 18, 4, 23, 5, 28, 6, 33, 7, 38, 8, 43, 9, 48, 10, 53, 11, 58, 12, 63, 13, 68, 14, 73, 15, 78, 16, 83, 17, 88, 18, 93, 19, 98, 20, 103, 21, 108, 22, 113, 23, 118, 24, 123, 25, 128, 26, 133, 27, 138, 28, 143, 29, 148, 30, 153, 31, 158, 32, 163, 33, 168, 34, 173, 35, 178, 36, 183, 37, 188, 38, 193, 39, 198
Offset: 0

Views

Author

N. J. A. Sloane, Feb 04 2011

Keywords

References

  • J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see pages 11, 88.

Crossrefs

Programs

  • Magma
    [ IsEven(n) select n/2 else (5*n+1)/2: n in [0..79] ]; // Bruno Berselli, Feb 09 2011
    
  • Maple
    f:=n->if n mod 2 = 0 then n/2 else (5*n+1)/2; fi;
  • Mathematica
    LinearRecurrence[{0,2,0,-1},{0,3,1,8},80] (* Harvey P. Dale, May 16 2014 *)
    If[EvenQ[#],#/2,(5#+1)/2]&/@Range[0,80] (* Harvey P. Dale, Jan 02 2015 *)
  • PARI
    a(n)=if(n%2,5*n+1,n)/2 \\ Charles R Greathouse IV, Sep 02 2015

Formula

a(n) = (6*n+1-(4*n+1)*(-1)^n)/4; g.f.: x*(3+x+2*x^2)/(1-x^2)^2; a(n) = 2*a(n-2)-a(n-4) for n>3. [Bruno Berselli, Feb 09 2011]

A185454 Trajectory of 5 under repeated application of the map in A185452.

Original entry on oeis.org

5, 13, 33, 83, 208, 104, 52, 26, 13, 33, 83, 208, 104, 52, 26, 13, 33, 83, 208, 104, 52, 26, 13, 33, 83, 208, 104, 52, 26, 13, 33, 83, 208, 104, 52, 26, 13, 33, 83, 208, 104, 52, 26, 13, 33, 83, 208, 104, 52, 26, 13, 33, 83, 208, 104, 52, 26, 13, 33, 83, 208, 104, 52, 26, 13, 33, 83, 208, 104, 52, 26, 13, 33, 83, 208, 104, 52
Offset: 1

Views

Author

N. J. A. Sloane, Feb 04 2011

Keywords

Comments

Periodic with period length 7.

References

  • J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see page 88.

Crossrefs

Programs

  • Maple
    f:=n->if n mod 2 = 0 then n/2 else (5*n+1)/2; fi;
    T:=proc(n,M) global f; local t1,i; t1:=[n];
    for i from 1 to M-1 do t1:=[op(t1),f(t1[nops(t1)])]; od: t1; end;
    T(5,120);
  • PARI
    Vec(x*(5 + 13*x + 33*x^2 + 83*x^3 + 208*x^4 + 104*x^5 + 52*x^6 + 21*x^7) / ((1 - x)*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)) + O(x^60)) \\ Colin Barker, Feb 01 2018

Formula

From Colin Barker, Feb 01 2018: (Start)
G.f.: x*(5 + 13*x + 33*x^2 + 83*x^3 + 208*x^4 + 104*x^5 + 52*x^6 + 21*x^7) / ((1 - x)*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)).
a(n) = a(n-7) for n>8. (End)

Extensions

Comment corrected by Paolo P. Lava, Mar 10 2011

A185453 Trajectory of 1 under repeated application of the map in A185452.

Original entry on oeis.org

1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4, 2, 1, 3, 8, 4
Offset: 1

Views

Author

N. J. A. Sloane, Feb 04 2011

Keywords

Comments

Periodic with period length 5.

References

  • J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see page 88.

Crossrefs

Programs

  • Maple
    f:=n->if n mod 2 = 0 then n/2 else (5*n+1)/2; fi;
    T:=proc(n,M) global f; local t1,i; t1:=[n];
    for i from 1 to M-1 do t1:=[op(t1),f(t1[nops(t1)])]; od: t1; end;
    T(1,120);
  • Mathematica
    NestList[If[EvenQ[#],#/2,(5#+1)/2]&,1,110] (* Harvey P. Dale, Jun 24 2011 *)

Formula

G.f.: -x*(1+3*x+8*x^2+4*x^3+2*x^4) / ( (x-1)*(x^4+x^3+x^2+x+1) ). - R. J. Mathar, Mar 11 2011
Showing 1-3 of 3 results.