cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A230199 Sum of digits of n-th palindromic prime.

Original entry on oeis.org

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

Views

Author

Shyam Sunder Gupta, Oct 11 2013

Keywords

Examples

			a(6) =2, since sum of digits of 6th palindromic prime i.e. 101 is 2.
		

Crossrefs

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 *)

Formula

a(n) = A007953(A002385(n)). - R. J. Mathar, Sep 09 2015