A229875 Iterated sum-of-digits of palindromic prime; or digital root of palindromic prime.
2, 3, 5, 7, 2, 2, 5, 7, 1, 2, 7, 2, 4, 5, 7, 1, 4, 5, 1, 2, 5, 7, 8, 7, 8, 1, 4, 5, 2, 7, 8, 4, 8, 7, 8, 5, 8, 1, 2, 2, 7, 1, 4, 5, 1, 2, 7, 8, 1, 4, 5, 8, 4, 4, 5, 8, 1, 4, 7, 8, 1, 5, 2, 5, 4, 7, 4, 5, 2, 8, 7, 1, 2, 1, 7, 2, 7, 2, 4, 8, 4, 2, 2, 2, 5, 4
Offset: 1
Examples
a(7)=5 because the 7th palindromic prime is 131 and 1+3+1 = 5.
Links
- Shyam Sunder Gupta, Table of n, a(n) for n = 1..5953
Programs
-
Mathematica
t = {}; Do[z = n*10^(IntegerLength[n] - 1) + FromDigits@Rest@Reverse@IntegerDigits[n]; If[PrimeQ[z], AppendTo[t, Mod[z, 9]]], {n, 1, 99999}]; Insert[t, 2, 5] Mod[#,9]&/@Select[Prime[Range[9000]],PalindromeQ] (* Harvey P. Dale, Mar 25 2025 *)
Comments