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.

A377321 a(n) is the smallest positive integer k such that n + k and n - k have the same number of distinct prime factors.

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 3, 2, 2, 3, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, 4, 4, 1, 1, 2, 1, 2, 1, 3, 3, 1, 3, 3, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 4, 3, 1, 4, 6, 3, 1, 3, 3, 2, 2, 2, 2, 3, 1, 1, 2, 1, 1, 3, 2, 3, 1, 1, 1, 3, 2, 3, 1, 1, 3, 2, 2
Offset: 4

Views

Author

Felix Huber, Nov 17 2024

Keywords

Comments

If the strong Goldbach conjecture is true, that every even number >= 8 is the sum of two distinct primes, then a positive integer k <= A082467(n) exists for n >= 4.

Examples

			a(7) = 2 because 9 and 5 have both one distinct prime factor. 8 and 6 have a different number of distinct prime factors.
		

Crossrefs

Programs

  • Maple
    A377321:=proc(n)
       local k;
       for k to n-1 do
          if NumberTheory:-Omega(n+k,'distinct')=NumberTheory:-Omega(n-k,'distinct') then
             return k
          fi
       od;
    end proc;
    seq(A377321(n),n=4..90);
  • Mathematica
    A377321[n_] := Module[{k = 0}, While[PrimeNu[++k + n] != PrimeNu[n - k]]; k];
    Array[A377321, 100, 4] (* Paolo Xausa, Dec 02 2024 *)
  • PARI
    a(n) = my(k=1); while (omega(n+k) != omega(n-k), k++); k; \\ Michel Marcus, Nov 17 2024

Formula

1 <= a(n) <= A082467(n).