login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A128717
Primes that yield another prime if one adds either the sum of its digits or the product of its digits.
1
101, 103, 163, 233, 293, 307, 431, 499, 509, 563, 617, 701, 743, 1009, 1049, 1061, 1087, 1409, 1423, 1483, 1489, 1601, 1607, 1801, 1867, 2017, 2039, 2053, 2273, 2543, 2633, 2903, 3041, 3067, 3089, 3449, 3607, 4013, 4057, 4079, 4211, 4217, 4273, 4507
OFFSET
1,1
LINKS
EXAMPLE
163 + (1+6+3) = 173, 163 + 1*6*3 = 181; 173 and 181 are prime numbers.
MAPLE
filter:= proc(n) local S;
S:= convert(n, base, 10);
isprime(n+convert(S, `+`)) and isprime(n+convert(S, `*`))
end proc:
A:= NULL:
p:= 2:
while p < 10000 do
if filter(p) then A:= A, p fi;
p:= nextprime(p)
od:
A; # Robert Israel, Jul 12 2017
MATHEMATICA
Select[Prime[Range[500]], PrimeQ[ # + Plus @@ IntegerDigits[ # ]] && PrimeQ[ # + Times @@ IntegerDigits[ # ]] &]
PROG
(PARI) isok(n) = isprime(n) && (isprime(n+sumdigits(n)) && ((d=digits(n)) && isprime(n+prod(k=1, #d, d[k])))); \\ Michel Marcus, Jul 12 2017
CROSSREFS
Cf. A048519.
Sequence in context: A176929 A330563 A060400 * A111348 A081649 A344802
KEYWORD
base,easy,nonn
AUTHOR
J. M. Bergot, Jun 27 2007
EXTENSIONS
Edited, corrected and extended by Stefan Steinerberger, Jul 14 2007
STATUS
approved