A085563 Sum of the prime digits of n.
0, 2, 3, 0, 5, 0, 7, 0, 0, 0, 0, 2, 3, 0, 5, 0, 7, 0, 0, 2, 2, 4, 5, 2, 7, 2, 9, 2, 2, 3, 3, 5, 6, 3, 8, 3, 10, 3, 3, 0, 0, 2, 3, 0, 5, 0, 7, 0, 0, 5, 5, 7, 8, 5, 10, 5, 12, 5, 5, 0, 0, 2, 3, 0, 5, 0, 7, 0, 0, 7, 7, 9, 10, 7, 12, 7, 14, 7, 7, 0, 0, 2, 3, 0, 5, 0, 7, 0, 0, 0, 0, 2, 3, 0, 5, 0, 7, 0, 0, 0, 0, 2, 3
Offset: 1
Examples
a(1234567)=17 because 2+3+5+7=17.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
Table[Total[Select[IntegerDigits[n],PrimeQ]],{n,110}] (* Harvey P. Dale, Aug 15 2020 *)
-
PARI
a(n) = vecsum(select(isprime, digits(n))); \\ Michel Marcus, Feb 06 2021