OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
16 is a term since 16/f(16) = 4 is an integer, 4/f(4) = 2 is an integer, and 2/f(2) = 2 is an integer.
MATHEMATICA
fdigsum[n_] := Module[{k = n, m = 2, r, s = 0}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, s += r; m++]; s]; q[k_] := Module[{f = fdigsum[k], f2, m, n}, IntegerQ[m = k/f] && Divisible[m, f2 = fdigsum[m]] && Divisible[n = m/f2, fdigsum[n]]]; Select[Range[3000], q]
PROG
(PARI) fdigsum(n) = {my(k = n, m = 2, r, s = 0); while([k, r] = divrem(k, m); k != 0 || r != 0, s += r; m++); s; }
is(k) = {my(f = fdigsum(k), f2, m); if(k % f, return(0)); m = k/f; f2 = fdigsum(m); !(m % f2) && !((m/f2) % fdigsum(m/f2)); }
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Amiram Eldar, Oct 27 2024
STATUS
approved