OFFSET
1,2
COMMENTS
An integer m is an exactly k-deficient-perfect number if sigma(n) = 2*n - Sum_{k} d_k, where d_i are distinct proper divisors of n.
LINKS
Saralee Aursukaree and Prapanpong Pongsriiam, On Exactly 3-Deficient-Perfect Numbers, arXiv:2001.06953 [math.NT], 2020.
FengJuan Chen, On Exactly k-deficient-perfect Numbers, Integers, 19 (2019), Article A37, 1-9.
EXAMPLE
117 is an exactly 2-deficient-perfect number with d1=13 and d2=39: sigma(117) = 182 = 2*117 - (13 + 39). See Theorem 1 p. 2 of Chen.
MATHEMATICA
kdef[n_] := n == 1 || Block[{s = 2*n - DivisorSigma[1, n], d}, If[s <= 0, False, d = Most@ Divisors@ n; MemberQ[ Total /@ Subsets[d, {1, Length@ d}], s]]]; Select[ Range[512], kdef] (* Giovanni Resta, Jan 23 2020 *)
PROG
(PARI) padbin(n, len) = {my(b = binary(n)); while(length(b) < len, b = concat(0, b); ); b; }
isok(n) = {my(d = divisors(n), s = vecsum(d))); my(nbdd = #d); for (i= 1, 2^nbdd-1, my(vecb = padbin(i, nbdd)); if (sum(j=1, nbdd, vecb[j]*d[j]) == 2*n - s, return(1)); ); }
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Jan 23 2020
STATUS
approved