A065680 Number of primes <= prime(n) which begin with a 1.
0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25
Offset: 1
Examples
13 is the second prime beginning with 1: A000040(6) = 13, therefore a(6) = 2. a(664579) = 80020 (A000040(664579) = 9999991 is the largest prime < 10^7).
Links
- Harry J. Smith, Table of n, a(n) for n = 1..1000
- Eric Weisstein's World of Mathematics, Benford's Law
- Index entries for sequences related to Benford's law
Crossrefs
Programs
-
Mathematica
Accumulate[If[First[IntegerDigits[#]]==1,1,0]&/@Prime[Range[80]]] (* Harvey P. Dale, Jan 22 2013 *)
-
PARI
lista(n) = { my(a=[p\10^logint(p,10)==1 | p<-primes(n)]); for(i=2, #a, a[i]+=a[i-1]); a} \\ Harry J. Smith, Oct 26 2009
Comments