login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
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.
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