A359226 a(n) is the least k >= 0 such that A006370^k(A070167(n)) = n (where A006370^k denotes the k-th iterate of A006370).
0, 0, 0, 5, 2, 0, 0, 4, 0, 1, 2, 0, 7, 2, 0, 3, 4, 0, 0, 9, 0, 1, 2, 0, 0, 6, 0, 1, 2, 0, 5, 2, 0, 3, 4, 0, 0, 2, 0, 8, 2, 0, 0, 4, 0, 1, 7, 0, 5, 2, 0, 5, 6, 0, 0, 2, 0, 1, 2, 0, 92, 4, 0, 1, 2, 0, 7, 2, 0, 3, 9, 0, 0, 7, 0, 1, 2, 0, 0, 8, 0, 1, 2, 0, 5, 2, 0
Offset: 1
Keywords
Examples
The Collatz sequence starting from 1 is: 1. So a(1) = 0. The Collatz sequence starting from 2 is: 2, 1. So a(2) = 0. The Collatz sequence starting from 3 is: 3, 10, 5, 16, 8, 4, 2, 1. So a(3) = 0, a(10) = 1, a(5) = 2, a(16) = 3, a(8) = 4, a(4) = 5.
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, PARI program
- Index entries for sequences related to 3x+1 (or Collatz) problem
Programs
-
Mathematica
nn = 87; c[] = -1; c[0] = 0; Do[(MapIndexed[If[c[#1] == -1, Set[c[#1], First[#2] - 1]] &, #]; -1 + Length[#]) &@ NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, c[#] == -1 && # > 1 &], {n, 0, nn}]; Array[c, nn] (* _Michael De Vlieger, Dec 23 2022 *)
-
PARI
See Links section.
Formula
a(n) = 0 iff n belongs to A177729.
If a(n) > 0 and n is odd, then a(n*3+1) - a(n) = 1. If a(n) > 0 and n is even, then a(n*3+1) - a(n*6+2) = 1. - Thomas Scheuerle, Dec 22 2022
Comments