[go: up one dir, main page]

login
A348335
a(n) = smallest k such that the sum of the divisors of the n numbers from k to k+n-1 equals sigma(k+n), or -1 if no such k exists.
2
14, 1, 591357
OFFSET
1,1
COMMENTS
a(4) > 10^9, if it exists. - Amiram Eldar, Oct 13 2021
EXAMPLE
a(1) = 14 because sigma(14) = sigma(15) = 24; a(1) = A002961(1).
a(2) = 1 because sigma(1) + sigma(2) = 1 + 3 = 4, the same as sigma(3) = 4; a(2) = A104149(1).
a(3) = 591357 because sigma(591357) + sigma(591358) + sigma(591359) = 866880 + 890352 + 599760 = 2356992, the same as sigma(591360) = 2356992.
MATHEMATICA
a[n_] := Module[{sig = DivisorSigma[1, Range[n]], k = n + 1}, While[(s = DivisorSigma[1, k]) != Plus @@ sig, sig = Join[Drop[sig, 1], {s}]; k++]; k - n]; Array[a, 3] (* Amiram Eldar, Oct 29 2021 *)
PROG
(PARI) isok(m, nb) = sum(i=1, nb, sigma(m+i-1)) == sigma(m+nb);
a(n) = my(k=1); while (!isok(k, n), k++); k; \\ Michel Marcus, Oct 28 2021
CROSSREFS
KEYWORD
nonn,bref,more
AUTHOR
Metin Sariyar, Oct 13 2021
STATUS
approved