login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A065686 Number of primes <= prime(n) which begin with a 7. 2

%I #10 Jun 15 2018 08:13:18

%S 0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,4,4,4,4,4,4,4,4,4,4,4,4,4,

%T 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,

%U 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4

%N Number of primes <= prime(n) which begin with a 7.

%H Harry J. Smith, <a href="/A065686/b065686.txt">Table of n, a(n) for n = 1..1000</a>

%e a(3) = 0, a(4) = 1. a(664579) = 71564 (A000040(664579) = 9999991 is the largest prime < 10^7).

%o (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) == 7, a++); p=nextprime(p+1)); write("b065686.txt", n, " ", a) ) } \\ _Harry J. Smith_, Oct 26 2009

%Y Cf. A065680, A000040.

%K base,nonn

%O 1,20

%A _Reinhard Zumkeller_, Nov 13 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 07:16 EDT 2024. Contains 371905 sequences. (Running on oeis4.)