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.

User: Aied Sulaiman

Aied Sulaiman's wiki page.

Aied Sulaiman has authored 1 sequences.

A386963 Gaps between positions of odd terms in A065090.

Original entry on oeis.org

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

Author

Aied Sulaiman, Aug 11 2025

Keywords

Comments

For n >= 2 we have a(n) in {2,3,4}:
a(n) = 2 if no prime lies between the two successive odd terms,
a(n) = 3 if a single prime lies between them,
a(n) = 4 if two primes lie between them.
The initial 5 comes from 3, 5, 7 between 1 and 9.
Conjecture: a(n) tends to 2 in frequency (i.e., {n : a(n) = 2} has natural density 1).
Conjecture is true because the primes have natural density 0. - Robert Israel, Aug 29 2025

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, ...
		

Crossrefs

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)