login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A229176 Primes p with nonzero digits such that p + product_of_digits and p - product_of_digits are both prime. 1
23, 29, 83, 293, 347, 349, 431, 439, 653, 659, 677, 743, 1123, 1297, 1423, 1489, 1523, 1657, 1867, 2239, 2377, 2459, 2467, 2543, 2579, 2663, 2753, 3163, 3253, 3271, 3329, 3457, 3461, 3581, 3691, 3727, 3833, 3947, 3967, 4129, 4253, 4297, 4423, 4567, 4957, 5323, 5381, 5651 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Numbers with nonzero digits in A227217; the non-degenerate cases, so to speak.

Intersection of primes with nonzero digits in A157677 and A225319.

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 1..1000

EXAMPLE

743 is prime.

743 - (7*4*3) = 659 is prime.

743 + (7*4*3) = 827 is prime.

So, 743 is a member of this sequence.

MAPLE

A007954 := proc(n)

    mul(d, d=convert(n, base, 10))

end proc:

isA229176 := proc(n)

    if isprime(n) and A007954(n) <> 0 then

        isprime(n+A007954(n)) and isprime(n-A007954(n))  ;

        simplify(%) ;

    else

        false;

    end if;

end proc:

for n from 1 to 10000 do

    if isA229176(n) then

        printf("%d, ", n) ;

    end if;

end do:

MATHEMATICA

id[x_] := IntegerDigits[x]; ti[x_] := Times @@ id[x]; m=5000; Select[Range[3, m, 2], PrimeQ[#] && Min[id[#]] > 0 && PrimeQ[#+ti[#]] && PrimeQ[#-ti[#]]&] (* Zak Seidov, Oct 02 2013 *)

PROG

(Python)

import sympy

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**4) if DP(n) and isprime(n) and isprime(n+DP(n)) and isprime(n-DP(n))}

# Simplified by Derek Orr, Mar 22 2015

(PARI) forprime(p=1, 10^4, d=digits(p); P=prod(i=1, #d, d[i]); if(P&&isprime(p+P)&&isprime(p-P), print1(p, ", "))) \\ Derek Orr, Mar 22 2015

CROSSREFS

Cf. A227217, A157677, A225319.

Sequence in context: A115396 A180538 A227217 * A232726 A029541 A068714

Adjacent sequences:  A229173 A229174 A229175 * A229177 A229178 A229179

KEYWORD

nonn,base,easy

AUTHOR

Derek Orr, Sep 30 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 23 07:05 EDT 2019. Contains 328335 sequences. (Running on oeis4.)