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-1 of 1 results.

A239427 Numbers such that additive and multiplicative persistences coincide.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 28, 29, 30, 31, 32, 33, 37, 38, 40, 41, 42, 46, 48, 50, 51, 56, 58, 60, 61, 64, 65, 67, 70, 71, 73, 76, 80, 81, 82, 83, 84, 85, 90, 92, 99, 100, 101, 102, 103, 104, 105, 106
Offset: 1

Views

Author

Arkadiusz Wesolowski, Mar 19 2014

Keywords

Comments

Numbers n for which A031286(n) = A031346(n).

Examples

			28 -> 10 -> 1 has additive persistence 2. 28 -> 16 -> 6 has multiplicative persistence 2. 28 is therefore in the sequence.
		

Crossrefs

Supersequence of A239480. Cf. A031286, A031346, A064702.

Programs

  • PARI
    for(n=0, 106, v=n; a=0; while(n>9, a++; n=sumdigits(n)); n=v; m=0; while(n>9, m++; d=digits(n); n=prod(k=1, #d, d[k])); n=v; if(a==m, print1(n, ", ")));
    
  • Python
    from math import prod
    def A031286(n):
        ap = 0
        while n > 9: n, ap = sum(map(int, str(n))), ap+1
        return ap
    def A031346(n):
        mp = 0
        while n > 9: n, mp = prod(map(int, str(n))), mp+1
        return mp
    def ok(n): return A031286(n) == A031346(n)
    print([k for k in range(107) if ok(k)]) # Michael S. Branicky, Sep 17 2022
Showing 1-1 of 1 results.