OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
FORMULA
EXAMPLE
83 is in the sequence because 83^2=6889 and 6+8+8+9=31.
1721 is in the sequence because 1721^2=2961841 and 2+9+6+1+8+4+1=31.
MAPLE
A007953 := proc(n) add(d, d=convert(n, base, 10)) ; end:
for n from 1 to 10000 do if A123157(n) = 31 then printf("%d, ", ithprime(n)) ; fi; od: # R. J. Mathar, Sep 29 2009
MATHEMATICA
Select[Prime[Range[500]], Total[IntegerDigits[#^2]]== 31 &] (* Harvey P. Dale, Apr 13 2011 *)
PROG
(Magma) [p: p in PrimesUpTo(2600) | &+Intseq(p^2) eq 31]; // Vincenzo Librandi, Sep 12 2013
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Vincenzo Librandi, Sep 21 2009
EXTENSIONS
Edited by R. J. Mathar, Sep 29 2009
STATUS
approved