OFFSET
0,4
COMMENTS
a(n) = 0 for n from A033950.
EXAMPLE
a(0) = 1 because 0 + 1 = 1, the next higher refactorable number.
a(1) = 0 because 1 is refactorable number.
a(2) = 0 because 2 is refactorable number.
a(3) = 5 because 3 + 5 = 8, the next higher refactorable number.
and so on.
MATHEMATICA
a[n_] := Module[{m = n}, While[! Divisible[m, DivisorSigma[0, m]], m++]; m - n]; a[0] = 1; Array[a, 100, 0] (* Amiram Eldar, Feb 20 2023 *)
PROG
(PARI) a(n) = if (n==0, 1, my(k=0); while ((n+k) % numdiv(n+k), k++); k); \\ Michel Marcus, Feb 20 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Feb 20 2023
STATUS
approved