cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A298008 a(n) = f(n-1,n) + 10*(n-1), where f(a,b) is the number of primes in the range [10*a,10*b].

This page as a plain text file.
%I A298008 #25 May 24 2021 07:59:44
%S A298008 4,14,22,32,43,52,62,73,82,91,104,111,121,133,141,152,162,172,181,194,
%T A298008 200,211,223,232,241,252,262,272,282,291,301,313,320,332,342,352,361,
%U A298008 372,382,391,402,411,421,433,442,451,463,471,481,492,502,510,522,530,542,551,562,572,581,592,602,613,620,631,643
%N A298008 a(n) = f(n-1,n) + 10*(n-1), where f(a,b) is the number of primes in the range [10*a,10*b].
%F A298008 a(n) = A038800(n-1) + 10*(n-1). - _Michel Marcus_, Jan 11 2018
%e A298008 The first term has the number of prime numbers between 0 and 9: 4. Since the numbers in this first range are smaller than 10, the left digit would be a zero (not represented). The second term has the number of prime numbers between 10 and 19 (4) and since it was counted in the range between 10 and 19 it represents this range with the one in the first digit in the left: 14. The third element is 22 as there are 2 primes between 20 and 29. And so on. Larger element: there is only one prime between 120 and 129, hence a(13)=121.
%t A298008 Block[{p = 1, k}, k = 10^p; Array[Apply[Subtract, PrimePi[{k #, k (# - 1)}]] + (# - 1) k &, 67]] (* _Michael De Vlieger_, Jan 11 2018 *)
%o A298008 (Python)
%o A298008 # Generates all elements of the sequence smaller than 'last'
%o A298008 last = 1000
%o A298008 p=[2]
%o A298008 c=1
%o A298008 for i in range(3,last+2,2):
%o A298008     prime = True
%o A298008     for j in p:
%o A298008         if i%j == 0:
%o A298008             prime=False;
%o A298008             break;
%o A298008     if prime:
%o A298008         p.append(i)
%o A298008         c = c + 1
%o A298008     ii = (i//10)*10
%o A298008     if i-ii == 1:
%o A298008         if prime:
%o A298008             print(ii-10+c-1, end=',')
%o A298008             c = 1
%o A298008         else:
%o A298008             print(ii-10+c, end=',')
%o A298008             c = 0
%Y A298008 Cf. A038800.
%K A298008 nonn
%O A298008 1,1
%A A298008 _Luis F.B.A. Alexandre_, Jan 10 2018
%E A298008 Edited by _N. J. A. Sloane_, Jan 28 2018