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.

Showing 1-2 of 2 results.

A031348 2-multiplicative persistence: number of iterations of "multiply 2nd powers of digits" needed to reach 0 or 1.

Original entry on oeis.org

0, 7, 6, 6, 3, 5, 5, 4, 5, 1, 1, 7, 6, 6, 3, 5, 5, 4, 5, 1, 7, 6, 5, 4, 2, 4, 5, 3, 4, 1, 6, 5, 5, 4, 3, 4, 4, 3, 4, 1, 6, 4, 4, 3, 2, 3, 3, 2, 4, 1, 3, 2, 3, 2, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 2, 4, 5, 2, 4, 1, 5, 5, 4, 3, 3, 5, 2, 5, 4, 1, 4, 3, 3, 2, 2, 2, 5, 2, 3, 1, 5, 4, 4, 4, 2, 4, 4, 3, 3
Offset: 1

Views

Author

Keywords

Comments

From Mohammed Yaseen, Nov 08 2022: (Start)
Is 7 the maximal 2-multiplicative persistence?
Are A199986 the only numbers whose 2-multiplicative persistence is 7?
These hold true for n up to 10^9. (End)

Examples

			a(14) = 6 because
14 -> 1^2 * 4^2 = 16;
16 -> 1^2 * 6^2 = 36;
36 -> 3^2 * 6^2 = 324;
324 -> 3^2 * 2^2 * 4^2 = 576;
576 -> 5^2 * 7^2 * 6^2 = 44100;
44100 -> 0 => the trajectory is 14 -> 16 -> 36 -> 324 -> 576 -> 44100 -> 0 with 6 iterations. - _Michel Lagneau_, May 22 2013
		

References

  • M. Gardner, Fractal Music, Hypercards and More Mathematical Recreations from Scientific American, Persistence of Numbers, pp. 120-1; 186-7, W. H. Freeman, NY, 1992.

Crossrefs

Cf. A031346.

Programs

  • Mathematica
    m2pd[n_]:=Length[NestWhileList[Times@@(IntegerDigits[#]^2)&,n,#>1&]]-1; Array[m2pd,100] (* Harvey P. Dale, Apr 19 2020 *)
  • PARI
    f(n) = my(d=digits(n)); prod(k=1, #d, d[k]^2);
    a(n) = if (n==1, 0, my(nb=1); while(((new = f(n)) > 1), n = new; nb++); nb); \\ Michel Marcus, Jun 13 2018
    
  • Python
    from math import prod
    from itertools import count, islice
    def f(n): return prod(map(lambda x: x*x, map(int, str(n))))
    def a(n):
        c = 0
        while n not in {0, 1}: n, c = f(n), c+1
        return c
    print([a(n) for n in range(1, 100)]) # Michael S. Branicky, Oct 13 2022

A201015 Composite numbers whose product of digits is 2.

Original entry on oeis.org

12, 21, 112, 121, 1112, 1121, 1211, 11112, 11121, 11211, 12111, 21111, 111112, 121111, 211111, 1111112, 1111121, 1112111, 1121111, 1211111, 2111111, 11111112, 11111121, 11111211, 11112111, 11121111, 11211111, 12111111, 21111111, 111111112, 111111121, 111111211
Offset: 1

Views

Author

Jaroslav Krizek, Nov 25 2011

Keywords

Comments

Complement of A107612 with respect to A199986. Subsequence of A199981 (composite numbers whose multiplicative digital root is 2).

Examples

			Number 121 is in sequence because 1*2*1 = 2, and 121 = 11*11 is composite.
		

Crossrefs

Cf. A107612 (primes whose product of digits is 2), A199986 (numbers whose product of digits is 2).

Programs

  • Mathematica
    Select[Sort[Flatten[Table[FromDigits/@Permutations[PadRight[{2},n,1]],{n,2,9}]]],CompositeQ] (* Harvey P. Dale, Oct 06 2024 *)
  • Python
    from sympy import isprime
    def agen(maxdigits):
        for digs in range(1, maxdigits+1):
            for i in range(digs):
                t = int("1"*(digs-1-i) + "2" + "1"*i)
                if not isprime(t): yield t
    print(list(agen(9))) # Michael S. Branicky, Dec 21 2021
Showing 1-2 of 2 results.