OFFSET
1,1
COMMENTS
Like A033950 but using anti-divisors.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
EXAMPLE
There are 3 anti-divisors of 30: 4, 12, 10; 3 divides 30, so 30 is in the sequence.
MAPLE
with(numtheory);
P:=proc(i)
local a, b, k, n;
for n from 3 by 1 to i do
a:={};
for k from 2 to n-1 do if abs((n mod k)- k/2) < 1 then a:=a union {k}; fi; od;
b:=nops(a);
if trunc(n/b)=n/b then print(n); fi;
od;
end:
P(10000);
MATHEMATICA
Select[Range[3, 400], Function[n, Mod[n, Length@Select[Range[2, n - 1], Abs[Mod[n, #] - #/2] < 1 &]] == 0]] (* Olivier GĂ©rard, Jul 05 2011 *)
PROG
(Magma) Antidivisors:=func< n | [ d: d in [1..n-1] | n mod d ne 0 and ((IsEven(d) and 2*n mod d eq 0) or (IsOdd(d) and ((2*n-1) mod d eq 0 or (2*n+1) mod d eq 0))) ] >; [ n: n in [3..10^4] | IsDivisibleBy(n, #Antidivisors(n)) ]; // Bruno Berselli, Jul 06 2011
(Python)
[n for n in range(3, 10**5) if not n % len([d for d in range(2, n) if n%d and 2*n%d in [d-1, 0, 1]])] # Chai Wah Wu, Aug 08 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo P. Lava, Jul 05 2011
STATUS
approved