Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #17 Dec 15 2024 11:01:09
%S 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,
%T 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
%U 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
%N Number of primes <= prime(n) which begin with an 8.
%H Harry J. Smith, <a href="/A065687/b065687.txt">Table of n, a(n) for n = 1..1000</a>
%e 83 = A000040(23) is the first prime beginning with an 8, so a(23) = 1 and a(i) = 0 for i < 23. a(664579) = 71038 (A000040(664579) = 9999991 is the largest prime < 10,000,000).
%t Accumulate[If[First[IntegerDigits[#]] == 8, 1, 0]&/@Prime[Range[100]]] (* _Vincenzo Librandi_, Nov 28 2016 *)
%o (PARI) lista(n) = { my(a=[p\10^logint(p,10)==8 | p<-primes(n)]); for(i=2, #a, a[i]+=a[i-1]); a} \\ _Harry J. Smith_, Oct 26 2009
%Y Cf. A000040, A045714, A065680.
%K base,nonn
%O 1,24
%A _Reinhard Zumkeller_, Nov 13 2001