A230199 Sum of digits of n-th palindromic prime.
2, 3, 5, 7, 2, 2, 5, 7, 10, 11, 7, 11, 13, 14, 16, 19, 22, 23, 19, 20, 5, 7, 8, 7, 8, 10, 13, 14, 11, 16, 17, 13, 17, 16, 17, 14, 17, 19, 20, 20, 25, 19, 22, 23, 28, 29, 7, 8, 10, 13, 14, 8, 13, 13, 14, 17, 19, 22, 16, 17, 19, 23, 20, 23, 22, 25, 22, 23, 29
Offset: 1
Examples
a(6) =2, since sum of digits of 6th palindromic prime i.e. 101 is 2.
Links
- Shyam Sunder Gupta, Table of n, a(n) for n = 1..5953
Programs
-
Mathematica
a = {}; Do[z = n*10^(IntegerLength[n] - 1) + FromDigits@Rest@Reverse@IntegerDigits[n]; If[PrimeQ[z], s = Apply[Plus, IntegerDigits[z]]; AppendTo[a, s]], {n, 1, 10^5}]; Insert[a, 2, 5] palQ[n_]:=Module[{idn=IntegerDigits[n]},idn==Reverse[idn]]; Total[ IntegerDigits[ #]]&/@ Select[Prime[Range[5000]],palQ] (* Harvey P. Dale, Oct 10 2014 *)