OFFSET
1,2
COMMENTS
A number is refactorable if it is divisible by the number of its divisors.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Refactorable Number.
FORMULA
a(n) = Sum_{i=1..n} 1 + floor(i/d(i)) - ceiling(i/d(i)), where d(n) is the number of divisors of n.
EXAMPLE
a(1) = 1 since 1 is the first refactorable number, a(2) = 2 since there are two refactorable numbers less than or equal to 2, a(3) through a(7) = 2 since the next refactorable number is 8.
MAPLE
with(numtheory) a:=n->sum((1 + floor(i/tau(i)) - ceil(i/tau(i))), i=1..n);
MATHEMATICA
Accumulate[Table[If[Divisible[n, DivisorSigma[0, n]], 1, 0], {n, 1, 100}]] (* Amiram Eldar, Oct 11 2023 *)
PROG
(PARI) a(n) = sum(i=1, n, q = i/numdiv(i); 1+ floor(q) - ceil(q)); \\ Michel Marcus, Sep 10 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jan 12 2013
STATUS
approved