OFFSET
1,1
FORMULA
a(n) = A038800(n-1) + 10*(n-1). - Michel Marcus, Jan 11 2018
EXAMPLE
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.
MATHEMATICA
Block[{p = 1, k}, k = 10^p; Array[Apply[Subtract, PrimePi[{k #, k (# - 1)}]] + (# - 1) k &, 67]] (* Michael De Vlieger, Jan 11 2018 *)
PROG
(Python)
# Generates all elements of the sequence smaller than 'last'
last = 1000
p=[2]
c=1
for i in range(3, last+2, 2):
prime = True
for j in p:
if i%j == 0:
prime=False;
break;
if prime:
p.append(i)
c = c + 1
ii = (i//10)*10
if i-ii == 1:
if prime:
print(ii-10+c-1, end=', ')
c = 1
else:
print(ii-10+c, end=', ')
c = 0
CROSSREFS
KEYWORD
nonn
AUTHOR
Luis F.B.A. Alexandre, Jan 10 2018
EXTENSIONS
Edited by N. J. A. Sloane, Jan 28 2018
STATUS
approved