A155498 Number of odd digits in the concatenation of first n primes.
0, 1, 2, 3, 5, 7, 9, 11, 12, 13, 15, 17, 18, 19, 20, 22, 24, 25, 26, 28, 30, 32, 33, 34, 36, 38, 40, 42, 44, 47, 49, 52, 55, 58, 60, 63, 66, 68, 70, 73, 76, 78, 81, 84, 87, 90, 92, 93, 94, 95, 97, 99, 100, 102, 104, 105, 106, 108, 110, 111, 112, 114, 116, 119, 122, 125, 128
Offset: 1
Examples
If n=1, concatenate first 1 prime = 2, then number of odd digits = 0 = a(1). If n=2, concatenate first 2 primes = 23, then number of odd digits = 1 = a(2). If n=3, concatenate first 3 primes = 235, then number of odd digits = 2 = a(3).
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
ListTools:-PartialSums([seq(nops(select(type, convert(ithprime(i), base, 10), odd)), i=1..100)]); # Robert Israel, Jul 15 2018
-
Mathematica
Accumulate[Table[Count[IntegerDigits[p],?OddQ],{p,Prime[Range[100]]}]] (* _Harvey P. Dale, Apr 05 2025 *)
-
PARI
a(n) = sum(k=1, n, #select(x->(x%2), digits(prime(k)))); \\ Michel Marcus, Jul 16 2018
Extensions
Replaced 53 by 55. R. J. Mathar, Feb 13 2009
Comments