A085562 Sum of the nonprime digits of n.
1, 0, 0, 4, 0, 6, 0, 8, 9, 1, 2, 1, 1, 5, 1, 7, 1, 9, 10, 0, 1, 0, 0, 4, 0, 6, 0, 8, 9, 0, 1, 0, 0, 4, 0, 6, 0, 8, 9, 4, 5, 4, 4, 8, 4, 10, 4, 12, 13, 0, 1, 0, 0, 4, 0, 6, 0, 8, 9, 6, 7, 6, 6, 10, 6, 12, 6, 14, 15, 0, 1, 0, 0, 4, 0, 6, 0, 8, 9, 8, 9, 8, 8, 12, 8, 14, 8, 16, 17, 9, 10, 9, 9, 13, 9, 15, 9
Offset: 1
Examples
a(123456)=11 because 1+4+6=11.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
Array[Total[DeleteCases[IntegerDigits[#],?PrimeQ]]&,100] (* _Harvey P. Dale, Apr 03 2016 *)
-
PARI
a(n) = vecsum(select(x->(!isprime(x)), digits(n))); \\ Michel Marcus, Feb 06 2021