A175038 In the sequence of positive integers A000027, number of digits between successive primes.
0, 1, 1, 4, 2, 6, 2, 6, 10, 2, 10, 6, 2, 6, 10, 10, 2, 10, 6, 2, 10, 6, 10, 14, 7, 3, 9, 3, 9, 39, 9, 15, 3, 27, 3, 15, 15, 9, 15, 15, 3, 27, 3, 9, 3, 33, 33, 9, 3, 9, 15, 3, 27, 15, 15, 15, 3, 15, 9, 3, 27, 39, 9, 3, 9, 39, 15, 27, 3, 9, 15, 21, 15, 15, 9, 15, 21, 9, 21, 27, 3, 27, 3, 15, 9, 15
Offset: 1
Examples
a(4) = 4 as prime(4) = 7 and prime(4+1) = 11 so the number of digits between these two primes is the number of digits of 8, 9 and 10. These numbers have 4 digits combined. Therefore a(4) = 4. - _David A. Corneth_, Jan 30 2019
Links
- Muniru A Asiru, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Table[Length[Flatten[IntegerDigits/@Range[Prime[n]+1,Prime[n+1]-1]]],{n,200}]
-
PARI
a(n) = sum(k=prime(n)+1, prime(n+1)-1, #Str(k)); \\ Michel Marcus, Jan 30 2019
Comments