A121242 Number of 2's in first n primes.
1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 7, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24
Offset: 1
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
ListTools:-PartialSums([seq(numboccur(2,convert(ithprime(i),base,10)),i=1..100)]); # Robert Israel, Jun 13 2018
-
Mathematica
Accumulate[DigitCount[Prime[Range[90]],10,2]] (* Harvey P. Dale, Nov 09 2013 *)
Comments