login
A321150
Primes p such that p minus its digit sum is a square.
1
2, 3, 5, 7, 11, 13, 17, 19, 41, 43, 47, 97, 151, 157, 233, 239, 331, 337, 457, 593, 599, 743, 911, 919, 1301, 1303, 1307, 1531, 1783, 1787, 1789, 2039, 2311, 2617, 2939, 3613, 3617, 4373, 4783, 4787, 4789, 5641, 5647, 6581, 7079, 7591, 8111, 8117, 8677, 9239, 9829, 11681, 11689, 13001, 13003, 13007
OFFSET
1,1
LINKS
EXAMPLE
11 is prime and 11 - (1+1) = 9 = 3^2 is square, so 11 is a term of the sequence.
457 is prime and 457 - (4+5+7) = 441 = 21^2 is square, so 457 is a term of the sequence.
2939 is prime and 2939 - (2+9+3+9) = 2916 = 54^2 is square, so 2939 is a term of the sequence.
101 is prime and 101 - (1+0+1) = 99 is not square, so 101 is not a term of the sequence.
MAPLE
select(t -> isprime(t) and issqr(t - convert(convert(t, base, 10), `+`)),
[2, seq(i, i=3..20000, 2)]); # Robert Israel, Apr 15 2019
MATHEMATICA
Select[Prime@ Range@ 2000, IntegerQ@ Sqrt[# - Total@ IntegerDigits@ #] &] (* Michael De Vlieger, Nov 05 2018 *)
PROG
(PARI) isok(p) = isprime(p) && issquare(p-sumdigits(p)); \\ Michel Marcus, Oct 30 2018
CROSSREFS
Intersection of A000040 and A066566.
Sequence in context: A069709 A144755 A069090 * A088415 A175063 A248199
KEYWORD
nonn,base
AUTHOR
Marius A. Burtea, Oct 28 2018
EXTENSIONS
a(26) corrected by Robert Israel, Apr 15 2019
STATUS
approved