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.

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

A227948 Zeroless numbers n such that n + (product of digits of n) and n - (product of digits of n) are prime.

Original entry on oeis.org

21, 23, 27, 29, 81, 83, 253, 293, 299, 343, 347, 349, 431, 437, 439, 471, 473, 477, 529, 623, 653, 659, 677, 743, 893, 1123, 1219, 1253, 1257, 1297, 1423, 1489, 1521, 1523, 1529, 1587, 1589, 1657, 1763, 1853, 1867, 1927, 2151, 2167, 2239, 2277, 2279, 2321, 2327, 2329, 2377, 2413, 2443, 2459, 2467, 2497, 2543, 2569
Offset: 1

Views

Author

Derek Orr, Oct 04 2013

Keywords

Comments

Intersection of A157676 and A229221 (without the primes containing zero digits).

Examples

			29 - 2*9 = 11 (prime) and 29 + 2*9 = 47 (prime) so 29 is a member of this sequence.
743 - 7*4*3 = 659 (prime) and 743 + 7*4*3 = 827 (prime) so 743 is a member of this sequence.
		

Crossrefs

Programs

  • PARI
    for(n=1,5000,d=digits(n);p=prod(i=1,#d,d[i]);if(p&&isprime(n+p)&&isprime(n-p),print1(n,", "))) \\ Derek Orr, Apr 05 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(5000) if DP(n) and isprime(n+DP(n)) and isprime(n-DP(n))}
    ## Simplified by Derek Orr, Apr 05 2015
    

Extensions

More terms from Derek Orr, Apr 05 2015
Showing 1-2 of 2 results.