OFFSET
1,2
COMMENTS
Anti-imperfect numbers are anti-deficient numbers or anti-abundant numbers.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..600 (terms 1..100 from Paolo P. Lava)
EXAMPLE
n=1. Anti-divisors: 0. |0-1|=1
n=2. Anti-divisors: 0. |0-2|=2
n=3. Anti-divisors: 2. |2-3|=1 less than 2: 3 is not in the sequence.
n=4. Anti-divisors: 3. |3-4|=1 less than 2: 4 is not in the sequence.
n=5. Anti-divisors: 2,3. |5-3|=2 equal to the maximum: 5 is not in the sequence.
n=6. Anti-divisors: 4. |4-6|=2 equal to the maximum: 6 is not in the sequence.
n=7. Anti-divisors: 2,3,5. |10-7|=3 new maximum: 7 is in the sequence.
MAPLE
P:=proc(i)
local a, k, n, s;
s:=0;
for n from 1 to i do
a:=0;
for k from 2 to n-1 do if abs((n mod k)- k/2)<1 then a:=a+k; fi; od;
if abs(n-a)>s then s:=abs(n-a); print(n); fi;
od;
end:
P(3000);
MATHEMATICA
sig[n_] := Total[Cases[Range[2, n - 1], _?(Abs[Mod[n, #] - #/2] < 1 &)]]; d[n_] := Abs[sig[n] - n]; s = {}; dm = -1; Do[If[(d1 = d[n]) > dm, dm = d1; AppendTo[s, n]], {n, 1, 2700}]; s (* Amiram Eldar, Jan 13 2022 after Michael De Vlieger at A066417 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo P. Lava, Jan 04 2012
STATUS
approved