A386963 Gaps between positions of odd terms in A065090.
5, 4, 4, 3, 2, 4, 2, 3, 4, 3, 2, 3, 2, 4, 2, 3, 4, 2, 3, 3, 2, 3, 2, 2, 3, 4, 4, 3, 2, 2, 2, 2, 2, 3, 3, 2, 4, 2, 2, 2, 4, 2, 3, 2, 3, 3, 2, 3, 2, 4, 2, 2, 2, 4, 4, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 4, 3, 2, 4, 2, 2, 2, 3, 2, 3, 2, 3, 2, 4, 2, 3, 4, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 4, 3, 2, 2, 2, 2, 2, 3, 2
Offset: 1
Examples
A065090: 1, 2, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, ... Odd terms occur at positions: 1, 6, 10, 14, 17, 19, 23, 25, ... Hence a(n): 5, 4, 4, 3, 2, 4, 2, ...
Programs
-
Mathematica
a065090=Select[Range[335],#==2||!PrimeQ[#]&];l=Length[a065090];p={};Do[If[OddQ[a065090[[i]] ],AppendTo[p,i]],{i,l}];Differences[p] (* James C. McMahon, Aug 29 2025 *)
-
PARI
lista(nn) = my(vio = select(x->(x % 2), select(m->(!isprime(m) || m==2), [1..nn]), 1)); vector(#vio-1, k, vio[k+1] - vio[k]); \\ Michel Marcus, Aug 16 2025
-
Python
from sympy import isprime def gaps_generator(): pos = 0 last = None k = 1 while True: if not (k % 2 == 1 and isprime(k)): # in A065090 pos += 1 if k % 2 == 1: # odd term (A014076) if last is None: last = pos else: yield pos - last last = pos k += 1 def a(n: int) -> int: g = gaps_generator() for _ in range(n - 1): next(g) return next(g)
Comments