login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) is the smallest positive integer k such that n + k and n - k have the same number of divisors.
3

%I #14 Dec 03 2024 23:33:13

%S 1,2,1,1,2,1,3,3,1,6,3,2,3,6,1,1,3,2,9,5,2,6,3,3,6,12,1,4,6,4,1,5,2,2,

%T 6,2,3,1,1,8,3,2,11,3,4,7,3,1,6,2,3,1,1,4,7,9,1,4,7,4,3,6,5,2,2,2,3,6,

%U 1,4,4,4,3,6,4,9,6,2,5,5,2,8,1,3,3,2,3

%N a(n) is the smallest positive integer k such that n + k and n - k have the same number of divisors.

%C 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 Felix Huber, <a href="/A377319/b377319.txt">Table of n, a(n) for n = 4..10000</a>

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

%e a(8) = 2 because 10 and 6 have both four divisors. 9 and 7 have a different number of divisors.

%p A377319:=proc(n)

%p local k;

%p for k to n-1 do

%p if NumberTheory:-tau(n+k)=NumberTheory:-tau(n-k) then

%p return k

%p fi

%p od;

%p end proc;

%p seq(A377319(n),n=4..90);

%t A377319[n_] := Module[{k = 0}, While[DivisorSigma[0, ++k + n] != DivisorSigma[0, n - k]]; k];

%t Array[A377319, 100, 4] (* _Paolo Xausa_, Dec 03 2024 *)

%o (PARI) a(n) = my(k=1); while (numdiv(n+k) != numdiv(n-k), k++); k; \\ _Michel Marcus_, Nov 17 2024

%Y Cf. A000005, A067888 , A082467, A171937, A377320, A377321.

%K nonn,new

%O 4,2

%A _Felix Huber_, Nov 17 2024