A107288 Primes whose digit sum is a square.
13, 31, 79, 97, 103, 211, 277, 349, 367, 439, 457, 547, 619, 673, 691, 709, 727, 853, 907, 997, 1021, 1069, 1087, 1201, 1249, 1429, 1447, 1483, 1609, 1627, 1663, 1699, 1753, 1789, 1861, 1879, 1933, 1951, 1987, 2011, 2239, 2293, 2347, 2383, 2437, 2473, 2617, 2671
Offset: 1
Examples
79 is in the sequence because it is prime. Also, (7 + 9) = 16 = 4^2. 997 is in the sequence because it is prime. Also, (9 + 9 + 7) = 25 = 5^2.
Links
- K. D. Bajpai, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Maple
with(numtheory): A107288:= proc() local a; a:=add(i,i = convert((n),base,10))(n); if isprime(n) and root(a,2)=floor(root(a,2)) then RETURN (n); fi; end: seq(A107288 (), n=1..5000); # K. D. Bajpai, Jul 08 2014
-
Mathematica
bb = {}; Do[If[IntegerQ[Sqrt[Apply[Plus, IntegerDigits[p = Prime[n]]]]], bb = Append[bb, p]], {n, 500}]; bb
-
PARI
lista(nn) = {forprime(p=2, nn, if (issquare(sumdigits(p)), print1(p, ", ")););} \\ Michel Marcus, Apr 09 2016
Extensions
Terms a(47) and a(48) added by K. D. Bajpai, Jul 08 2014
Comments