login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A008894 3x - 1 sequence starting at 36. 1
36, 18, 9, 26, 13, 38, 19, 56, 28, 14, 7, 20, 10, 5, 14, 7, 20, 10, 5, 14, 7, 20, 10, 5, 14, 7, 20, 10, 5, 14, 7, 20, 10, 5, 14, 7, 20, 10, 5, 14, 7, 20, 10, 5, 14, 7, 20, 10, 5, 14, 7, 20, 10, 5, 14, 7, 20, 10, 5, 14, 7, 20 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
Previous name was "x -> x/2 if x even, x -> 3x - 1 if x odd."
REFERENCES
R. K. Guy, Unsolved Problems in Number Theory, E16.
LINKS
FORMULA
a(0) = 36, a(n) = a(n - 1)/2 if a(n - 1) is even, otherwise 3a(n - 1) - 1.
From Colin Barker, Apr 26 2020: (Start)
G.f.: (36 + 18*x + 9*x^2 + 26*x^3 + 13*x^4 + 2*x^5 + x^6 + 47*x^7 + 2*x^8 + x^9 - 31*x^10 + x^11 - 46*x^12 - 23*x^13) / ((1 - x)*(1 + x + x^2 + x^3 + x^4)).
a(n) = a(n - 5) for n > 13.
(End)
MATHEMATICA
-NestList[If[EvenQ[#], #/2, 3# + 1] &, -36, 100] (* Alonso del Arte, Apr 26 2020 *)
PROG
(Scala) def collatz(n: Int): Int = n % 2 match {
case 0 => n / 2
case _ => 3 * n + 1
}
def collatzSeq(n: Int): LazyList[Int] = LazyList.iterate(n)(collatz)
collatzSeq(-36).take(100).toList.map(_ * -1) // Alonso del Arte, Apr 26 2020
(PARI) Vec((36 + 18*x + 9*x^2 + 26*x^3 + 13*x^4 + 2*x^5 + x^6 + 47*x^7 + 2*x^8 + x^9 - 31*x^10 + x^11 - 46*x^12 - 23*x^13) / ((1 - x)*(1 + x + x^2 + x^3 + x^4)) + O(x^70)) \\ Colin Barker, Apr 26 2020
CROSSREFS
Sequence in context: A056770 A061038 A058231 * A033973 A033356 A158955
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More specific name from Alonso del Arte, Apr 26 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 12:22 EDT 2024. Contains 371937 sequences. (Running on oeis4.)