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.
%I A377321 #12 Dec 03 2024 12:26:46 %S A377321 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, %T A377321 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, %U A377321 1,1,2,1,1,3,2,3,1,1,1,3,2,3,1,1,3,2,2 %N A377321 a(n) is the smallest positive integer k such that n + k and n - k have the same number of distinct prime factors. %C A377321 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. %H A377321 Felix Huber, <a href="/A377321/b377321.txt">Table of n, a(n) for n = 4..10000</a> %F A377321 1 <= a(n) <= A082467(n). %e A377321 a(7) = 2 because 9 and 5 have both one distinct prime factor. 8 and 6 have a different number of distinct prime factors. %p A377321 A377321:=proc(n) %p A377321 local k; %p A377321 for k to n-1 do %p A377321 if NumberTheory:-Omega(n+k,'distinct')=NumberTheory:-Omega(n-k,'distinct') then %p A377321 return k %p A377321 fi %p A377321 od; %p A377321 end proc; %p A377321 seq(A377321(n),n=4..90); %t A377321 A377321[n_] := Module[{k = 0}, While[PrimeNu[++k + n] != PrimeNu[n - k]]; k]; %t A377321 Array[A377321, 100, 4] (* _Paolo Xausa_, Dec 02 2024 *) %o A377321 (PARI) a(n) = my(k=1); while (omega(n+k) != omega(n-k), k++); k; \\ _Michel Marcus_, Nov 17 2024 %Y A377321 Cf. A001221, A082467, A188348, A377319, A377320. %K A377321 nonn %O A377321 4,2 %A A377321 _Felix Huber_, Nov 17 2024