A377437 Number of multiplication steps for n to reach 1 when iterating 5x+1 removing factors 2 and 3, or -1 if it never reaches 1.
0, 0, 0, 0, 4, 0, 1, 0, 0, 4, 2, 0, 3, 1, 4, 0, 2, 0, 1, 4, 1, 2, 6, 0, 2, 3, 0, 1, 5, 4, 4, 0, 2, 2, 3, 0, 5, 1, 3, 4, 3, 1, 1, 2, 4, 6, 7, 0, 4, 2, 2, 3, 7, 0, 7, 1, 1, 5, 6, 4, 3, 4, 1, 0, 4, 2, 2, 2, 6, 3, 7, 0, 4, 5, 2, 1, 5, 3, 3, 4, 0, 3, 4, 1, 8, 1, 5, 2, 6, 4, 2, 6, 4, 7, 16, 0, 1, 4, 2, 2, 5, 2, 2, 3
Offset: 1
Keywords
Examples
For n=1, 2, 3, 4, 6,.. (members of A003568) the removal of factors 2 and 3 yields 1, so there is no multiplication step and the entry is 0. For n=5 the trajectory is 5->26 (13) -> 66 (11) -> 56 (7) -> 36 (1) which needs 4 multiplications.
Links
- James C. McMahon, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A065330.
Programs
-
Maple
A377437 := proc(n) option remember ; local n6 ; if A065330(n) = 1 then 0 ; else n6 := A065330(n) ; return 1+procname(1+5*n6) ; end if; end proc: seq(A377437(n),n=1..120) ; # R. J. Mathar, Feb 25 2025
-
Mathematica
f3[a_] =a/3^IntegerExponent[a,3];f23[a_]:=f3[a]/2^IntegerExponent[f3[a], 2];s={};Do[m=0;Until[n==1,n=f23[n];If[n>1,n=5n+1];m++];AppendTo[s,m-1],{n,104}];s (* James C. McMahon, Feb 25 2025 *)
-
Python
def A377437(n): num = 0 while n > 1: while n % 2 == 0: n //= 2 while n % 3 == 0: n //= 3 if n > 1: n = 5 * n + 1 num += 1 return num for i in range(1, 50): print(A377437(i), end=', ')
Comments