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.

A075884 Image of n at the second step of the 3x+1 algorithm.

Original entry on oeis.org

2, 4, 5, 1, 8, 10, 11, 2, 14, 16, 17, 3, 20, 22, 23, 4, 26, 28, 29, 5, 32, 34, 35, 6, 38, 40, 41, 7, 44, 46, 47, 8, 50, 52, 53, 9, 56, 58, 59, 10, 62, 64, 65, 11, 68, 70, 71, 12, 74, 76, 77, 13, 80, 82, 83, 14, 86, 88, 89, 15, 92, 94, 95, 16, 98, 100, 101, 17, 104, 106, 107
Offset: 1

Views

Author

Bruce Corrigan (scentman(AT)myfamily.com), Oct 16 2002

Keywords

Comments

Also known as the Collatz Problem, Syracuse Algorithm or Hailstone Problem. Let syr(m,n) be the image of n at the m-th step. for m=2, k>=0 we get: syr(2,4k)=k, syr(2,4k+1)=6k+2, syr(2,4k+2)=6k+4, syr(2,4k+3)=6k+5.

Examples

			1->4->2, 2->1->4, 3->10->5, 4->2->1, ...
		

References

  • David Wells, Penguin Dictionary of Curious and Interesting Numbers

Crossrefs

Cf. A006370 (the sequence at step 1), A076536 (at step 3).
Column k=2 of A347270.

Programs

  • Magma
    m:=80; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(x*(x^6+2*x^5+4*x^4+x^3+5*x^2+4*x+2)/(1-x^4)^2));
  • Mathematica
    Table[Nest[If[EvenQ[#],#/2,3#+1]&,n,2],{n,80}] (* Harvey P. Dale, Nov 15 2012 *)
  • PARI
    x='x+O('x^80); Vec(x*(x^6+2*x^5+4*x^4+x^3+5*x^2+4*x+2)/(1-x^4)^2) \\ G. C. Greubel, Oct 16 2018
    

Formula

G.f.: x*(x^6 +2*x^5 +4*x^4 +x^3 +5*x^2 +4*x +2)/(1-x^4)^2.
a(n) = (6*n +(55*n+4)*m -6*(5*n-2)*m^2 +(5*n-4)*m^3)/24, m=(n mod 4). - Zak Seidov, Sep 14 2006
From Federico Provvedi, Oct 17 2021: (Start)
Dirichlet g.f.: ((3*4^s - 10)*zeta(s-1) + (4^s + 2^s - 2)*zeta(s))/2^(2s+1).
a(n) = (n*(19-5*i^(2*n)) - (5*n+4)*(i^n + (-i)^n) + 8)/16, where i*i = -1. (End)
a(n) = 2*a(n-4) - a(n-8). - Wesley Ivan Hurt, Apr 16 2023