A377319 a(n) is the smallest positive integer k such that n + k and n - k have the same number of divisors.
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, 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, 1, 4, 4, 4, 3, 6, 4, 9, 6, 2, 5, 5, 2, 8, 1, 3, 3, 2, 3
Offset: 4
Keywords
Examples
a(8) = 2 because 10 and 6 have both four divisors. 9 and 7 have a different number of divisors.
Links
- Felix Huber, Table of n, a(n) for n = 4..10000
Programs
-
Maple
A377319:=proc(n) local k; for k to n-1 do if NumberTheory:-tau(n+k)=NumberTheory:-tau(n-k) then return k fi od; end proc; seq(A377319(n),n=4..90);
-
Mathematica
A377319[n_] := Module[{k = 0}, While[DivisorSigma[0, ++k + n] != DivisorSigma[0, n - k]]; k]; Array[A377319, 100, 4] (* Paolo Xausa, Dec 03 2024 *)
-
PARI
a(n) = my(k=1); while (numdiv(n+k) != numdiv(n-k), k++); k; \\ Michel Marcus, Nov 17 2024
Formula
1 <= a(n) <= A082467(n).
Comments