Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #16 Dec 15 2024 11:01:18
%S 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,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 a 6.
%H Harry J. Smith, <a href="/A065685/b065685.txt">Table of n, a(n) for n = 1..1000</a>
%e a(17) = 0, a(18) = 1: 61 = A000040(18) is the first prime beginning with 6. a(664579) = 72257 (A000040(664579) = 9999991 is the largest prime < 10^7).
%t Accumulate@ Array[Boole[First@ IntegerDigits@ Prime@ # == 6] &, 105] (* _Michael De Vlieger_, Jun 14 2018 *)
%o (PARI) lista(n) = { my(a=[p\10^logint(p,10)==6 | p<-primes(n)]); for(i=2, #a, a[i]+=a[i-1]); a} \\ _Harry J. Smith_, Oct 26 2009
%Y Cf. A000040, A045712, A065680.
%K base,nonn
%O 1,19
%A _Reinhard Zumkeller_, Nov 13 2001