A330591 Number of Collatz steps to reach 1 starting from 6^n + 1.
16, 21, 26, 101, 83, 83, 145, 145, 220, 158, 145, 207, 114, 114, 450, 114, 357, 357, 282, 419, 419, 494, 494, 494, 494, 494, 494, 494, 543, 494, 543, 799, 799, 543, 543, 799, 543, 543, 799, 799, 791, 791, 791, 791, 861, 861, 861, 861, 998, 998, 998, 861, 861, 861
Offset: 1
Examples
a(2)=21 because the Collatz trajectory of 6^2 + 1 = 37 is 37 -> 112 -> 56 -> 28 -> 14 -> 7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1, which is 21 steps.
Programs
-
Mathematica
n=200; For [j=1, j
-
PARI
nbsteps(n) = if(n<0, 0, my(s=n, c=0); while(s>1, s=if(s%2, 3*s+1, s/2); c++); c); \\ A006577 a(n) = nbsteps(6^n+1); \\ Michel Marcus, Dec 21 2019
-
Python
from decimal import * n=1000 for j in range(2,n): i=6**j+1 count=0 while(i!=1): if(i%2==0): i=i//2 else: i=3*i+1 count=count+1 print(count)
Formula
a(n) = A006577(6^n+1).
Comments