A179549 Primes p such that p minus the sum of the square of its digits yields a prime.
13, 53, 127, 233, 257, 293, 457, 521, 541, 547, 587, 857, 983, 1151, 1153, 1429, 1481, 1489, 1511, 1553, 1559, 1579, 1621, 1753, 1861, 2099, 2129, 2143, 2239, 2273, 2341, 2347, 2383, 2411, 2417, 2459, 2549, 2657, 2677, 2729, 2741, 2789, 2837, 2897, 2927
Offset: 1
Examples
a(5)=257 since 257-(2^2+5^2+7^2)=179 is a prime.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
ssdQ[n_]:=Module[{c=n-Total[IntegerDigits[n]^2]},Positive[c]&&PrimeQ[c]]; Select[Prime[Range[500]],ssdQ] (* Harvey P. Dale, Dec 26 2018 *)
-
PARI
isok(n) = {if (isprime(n), digs = digits(n, 10); isprime(n - sum(i=1, #digs, digs[i]^2));, 0)} \\ Michel Marcus, Jul 18 2013
Extensions
A-number typo and signs in the example corrected - R. J. Mathar, Oct 23 2010
Comments