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.

A063737 Numbers n such that sum of digits of n is equal to the sum of the prime factors of n, counted with multiplicity.

Original entry on oeis.org

2, 3, 4, 5, 7, 27, 378, 576, 588, 648, 729, 2688, 17496, 19683, 49896, 69888, 3796875, 3857868, 4898880, 5878656, 7077888, 8957952, 2499898464, 34998578496, 49997969280, 2928898896840, 7625597484987, 184958866998359685
Offset: 1

Views

Author

Felice Russo, Aug 13 2001

Keywords

Comments

a(29) > 10^30. - Giovanni Resta, Apr 23 2017
a(29) > 10^50 if it exists. - Bert Dobbelaere, Jun 16 2024

Examples

			27=3*3*3, 2+7=9, 3+3+3=9. 49896 = 2*2*2*3*3*3*3*7*11, 4+9+8+9+6 = 36, 2+2+2+3+3+3+3+7+11 = 36.
		

Crossrefs

Programs

  • ARIBAS
    var stk: stack; end; for n := 1 to 2000000 do s := itoa(n); for j := 0 to length(s) - 1 do stack_push(stk,atoi(s[j..j])); end; if sum(stack2array(stk)) = sum(factorlist(n)) then write(n," "); end; end;
    
  • Mathematica
    g@n_ := Cases[Union@(Times @@ # & /@Select[Flatten[Table[IntegerPartitions[k, All, Prime@Range@PrimePi@(9*n)], {k,1,9*n}],1],Plus@@#==DigitSum@(Times @@ #) &]),
    _?(#<10^n&)];
    g@18 (*Requires Mathematica version 14 or later*) (* Hans Rudolf Widmer, Jan 20 2024 *)
  • PARI
    isok(m) = my(f=factor(m)); sumdigits(m) == f[, 1]~*f[, 2]; \\ Michel Marcus, Dec 18 2020
    
  • Python
    MAXDIGITS=20
    maxsum,maxval = 9*MAXDIGITS,10**MAXDIGITS-1
    from sympy import primerange
    primes=list(primerange(0,maxsum))
    nprimes, results = len(primes), []
    def lensumdigits(x):
        s,t = str(x),0
        for c in s: t+= ord(c)-48
        return len(s),t
    def solve(startidx, sump, val):
        for idx in range(startidx,nprimes):
            p=primes[idx]
            s2,v2 = sump+p,val*p
            ld,sd = lensumdigits(v2)
            if sd==s2: results.append(v2)
            if (s2 > maxsum) or (v2 > maxval) or ((p>10) and (s2 > 9*ld)):
                return
            solve(idx, s2, v2)
    solve(0, 0, 1) ; print(sorted(results)) # Bert Dobbelaere, Jun 16 2024

Extensions

More terms from Klaus Brockhaus, Aug 17 2001
More terms from David Wasserman, Jul 11 2002