A196274 Half of the gaps A067970 between odd nonprimes A014076.
4, 3, 3, 2, 1, 3, 1, 2, 3, 2, 1, 2, 1, 3, 1, 2, 3, 1, 2, 2, 1, 2, 1, 1, 2, 3, 3, 2, 1, 1, 1, 1, 1, 2, 2, 1, 3, 1, 1, 1, 3, 1, 2, 1, 2, 2, 1, 2, 1, 3, 1, 1, 1, 3, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 3, 2, 1, 3, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 3, 1, 1, 1, 2
Offset: 1
Keywords
Examples
The smallest odd numbers which are not prime are 1, 9, 15, 21, 25, 27,... (sequence A014076). The gaps between these are: 8, 6, 6, 4, 2,... (sequence A067970), which are of course all even by construction, so it makes sense to divide all of them by 2, which yields this sequence: 4, 3, 3, 2, 1, ...
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A142723 for the decimal value of the associated continued fraction.
Programs
-
Mathematica
With[{nn=401},Differences[Complement[Range[1,nn,2],Prime[Range[ PrimePi[ nn]]]]]/2] (* Harvey P. Dale, May 06 2012 *)
-
PARI
L=1;forstep(n=3,299,2,isprime(n)&next;print1((n-L)/2",");L=n)
-
Python
from sympy import primepi, isprime def A196274(n): if n == 1: return 4 m, k = n-1, primepi(n) + n - 1 + (n>>1) while m != k: m, k = k, primepi(k) + n - 1 + (k>>1) for d in range(1,4): if not isprime(m+(d<<1)): return d # Chai Wah Wu, Jul 31 2024
Extensions
More terms from Harvey P. Dale, May 06 2012
Comments