cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A377437 #35 Feb 25 2025 11:35:20
%S A377437 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,
%T A377437 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,
%U A377437 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
%N 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.
%C A377437 Reaches 1 for all n < 10^9.
%C A377437 A step first removes factors 2 and 3 by the map x->A065330(x), and if this is not 1 sends x->5x+1 (which then counts).
%H A377437 James C. McMahon, <a href="/A377437/b377437.txt">Table of n, a(n) for n = 1..10000</a>
%e A377437 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.
%e A377437 For n=5 the trajectory is 5->26 (13) -> 66 (11) -> 56 (7) -> 36 (1) which needs 4 multiplications.
%p A377437 A377437 := proc(n)
%p A377437     option remember ;
%p A377437     local n6 ;
%p A377437     if A065330(n) = 1 then
%p A377437         0 ;
%p A377437     else
%p A377437         n6 := A065330(n) ;
%p A377437         return 1+procname(1+5*n6) ;
%p A377437     end if;
%p A377437 end proc:
%p A377437 seq(A377437(n),n=1..120) ; # _R. J. Mathar_, Feb 25 2025
%t A377437 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 *)
%o A377437 (Python)
%o A377437 def A377437(n):
%o A377437     num = 0
%o A377437     while n > 1:
%o A377437         while n % 2 == 0:
%o A377437             n //= 2
%o A377437         while n % 3 == 0:
%o A377437             n //= 3
%o A377437         if n > 1:
%o A377437             n = 5 * n + 1
%o A377437             num += 1
%o A377437     return num
%o A377437 for i in range(1, 50):
%o A377437     print(A377437(i), end=', ')
%Y A377437 Cf. A065330.
%K A377437 nonn
%O A377437 1,5
%A A377437 _Frank A. Stevenson_, Oct 27 2024