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.

A229221 Numbers k such that k - (product of digits of k) is prime.

Original entry on oeis.org

21, 23, 27, 29, 41, 43, 47, 49, 81, 83, 87, 89, 101, 103, 107, 109, 127, 141, 143, 149, 181, 187, 223, 227, 229, 241, 247, 251, 253, 263, 271, 277, 293, 299, 307, 343, 347, 349, 367, 383, 389, 401, 409, 413, 417, 419, 431, 433, 437, 439, 451, 457, 471, 473, 477, 479, 481, 487, 503, 509, 527, 529, 541
Offset: 1

Views

Author

Derek Orr, Sep 16 2013

Keywords

Crossrefs

Cf. A157676.

Programs

  • Mathematica
    fQ[n_] := Module[{q = n - Times @@ IntegerDigits[n]}, q > 0 && PrimeQ[q]]; Select[Range[500], fQ] (* T. D. Noe, Sep 17 2013 *)
  • PARI
    for(n=1,10^3,d=digits(n);p=prod(i=1,#d,d[i]);if(isprime(n-p),print1(n,", "))) \\ Derek Orr, Apr 10 2015
  • Python
    from sympy import isprime
    def DP(n):
        p = 1
        for i in str(n):
            p *= int(i)
        return p
    {print(n,end=', ') for n in range(10**3) if isprime(n-DP(n))}
    ## Simplified by Derek Orr, Apr 10 2015
    
  • Sage
    [x for x in range(1000) if (x-prod(Integer(x).digits(base=10))) in Primes()] # Tom Edgar, Sep 18 2013
    

Extensions

More terms from Derek Orr, Apr 10 2015