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.

User: Frank A. Stevenson

Frank A. Stevenson's wiki page.

Frank A. Stevenson has authored 1 sequences.

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.

Original entry on oeis.org

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

Author

Frank A. Stevenson, Oct 27 2024

Keywords

Comments

Reaches 1 for all n < 10^9.
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).

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.
		

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=', ')