A376714 Sum of squares of the decimal digits of the n-th prime.
4, 9, 25, 49, 2, 10, 50, 82, 13, 85, 10, 58, 17, 25, 65, 34, 106, 37, 85, 50, 58, 130, 73, 145, 130, 2, 10, 50, 82, 11, 54, 11, 59, 91, 98, 27, 75, 46, 86, 59, 131, 66, 83, 91, 131, 163, 6, 17, 57, 89, 22, 94, 21, 30, 78, 49, 121, 54, 102, 69, 77, 94, 58, 11
Offset: 1
Examples
For n=7, the 7th prime = 17 and those digits 1^2 + 7^2 = 50 = a(7).
Links
- Katie Khan, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
a[n_]:=Norm[IntegerDigits[Prime[n]]]^2; Array[a,64] (* Stefano Spezia, Oct 03 2024 *)
-
PARI
a(n) = norml2(digits(prime(n))); \\ Michel Marcus, Oct 03 2024
-
Python
from sympy import prime def A376714(n): return sum((0, 1, 4, 9, 16, 25, 36, 49, 64, 81)[int(d)] for d in str(prime(n)) if d>'0') # Chai Wah Wu, Oct 04 2024