OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Chris Caldwell, The First 1,000 Primes
EXAMPLE
139 is a prime whose digit sum of 13 contains the digits 1 and 3 which are also in the prime.
149 is a prime whose digit sum of 14 contains the digits 1 and 4 which are also in the prime.
419 is a prime whose digit sum of 14 contains the digits 1 and 4 which are also in the prime.
MAPLE
filter:= proc(n) local L, s;
L:= convert(n, base, 10);
s:= convert(L, `+`);
convert(convert(s, base, 10), set) intersect convert(L, set) <> {}
end proc:
select(filter, [seq(ithprime(i), i=1..100)]); # Robert Israel, Feb 27 2023
PROG
(PARI) isok(p) = isprime(p) && (#setintersect(Set(digits(p)), Set(digits(sumdigits(p)))) >= 1); \\ Michel Marcus, Nov 12 2017
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Parthasarathy Nambi, Mar 20 2009
EXTENSIONS
Single-digit primes added by R. J. Mathar, Jul 08 2009
Typos in data corrected by D. S. McNeil and Andrew Weimholt, Aug 17 2010
STATUS
approved