login
A065683
Number of primes <= prime(n) which begin with a 4.
2
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 20, 20
OFFSET
1,14
LINKS
EXAMPLE
41 = A000040(13) is the first prime beginning with 4, so a(13) = 1. a(664579) = 74114 (A000040(664579) = 9999991 is the largest prime < 10^7).
MATHEMATICA
Table[Count[Take[Prime[Range[100]], n], _?(First[IntegerDigits[#]] == 4&)], {n, 100}] (* Harvey P. Dale, Apr 18 2011 *)
PROG
(PARI) digitsIn(x)= { local(d); if (x==0, return(1)); d=1 + log(x)\log(10); if (10^d == x, d++, if (10^(d-1) > x, d--)); return(d) } MSD(x)= { return(x\10^(digitsIn(x)-1)) } { a=0; p=2; for (n=1, 1000, q=prime(n); while (p <= q, if(MSD(p) == 4, a++); p=nextprime(p+1)); write("b065683.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 26 2009
CROSSREFS
Sequence in context: A158799 A157532 A065684 * A065682 A065681 A121242
KEYWORD
base,nonn
AUTHOR
Reinhard Zumkeller, Nov 13 2001
STATUS
approved