%I #34 Apr 10 2016 23:16:19
%S 13,31,79,97,103,211,277,349,367,439,457,547,619,673,691,709,727,853,
%T 907,997,1021,1069,1087,1201,1249,1429,1447,1483,1609,1627,1663,1699,
%U 1753,1789,1861,1879,1933,1951,1987,2011,2239,2293,2347,2383,2437,2473,2617,2671
%N Primes whose digit sum is a square.
%C Primes in A028839. [_K. D. Bajpai_, Jul 08 2014]
%C From _Altug Alkan_ and _Waldemar Puszkarz_, Apr 10 2016: All terms are congruent to 1 mod 6. Proof: For n > 2, prime(n) is 1 or 5 mod 6. If p is 5 mod 6, then it is of the form 3*k-1. For numbers of this form, the sum of digits is also of this form, as can be seen through the kind of reasoning used in proving that numbers divisible by 3 have the sum of digits divisible by 3. However, 3*k-1 can never be a square, meaning n^2+1 is never divisible by 3: any n is equal to one of 0, 1, 2 mod 3, thus by the rules of modular arithmetic, n^2+1 is 1 or 2 mod 3, never 0. Hence p must be congruent to 1 mod 6.
%H K. D. Bajpai, <a href="/A107288/b107288.txt">Table of n, a(n) for n = 1..10000</a>
%e 79 is in the sequence because it is prime. Also, (7 + 9) = 16 = 4^2.
%e 997 is in the sequence because it is prime. Also, (9 + 9 + 7) = 25 = 5^2.
%p 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
%t bb = {}; Do[If[IntegerQ[Sqrt[Apply[Plus, IntegerDigits[p = Prime[n]]]]], bb = Append[bb, p]], {n, 500}]; bb
%o (PARI) lista(nn) = {forprime(p=2, nn, if (issquare(sumdigits(p)), print1(p, ", ")););} \\ _Michel Marcus_, Apr 09 2016
%Y Cf. A000040, A007953, A028839, A048519.
%Y Cf. A244863 (Semiprimes whose digit sum is square).
%K nonn,base
%O 1,1
%A _Zak Seidov_, May 20 2005
%E Terms a(47) and a(48) added by _K. D. Bajpai_, Jul 08 2014