A066272 Number of anti-divisors of n.
0, 0, 1, 1, 2, 1, 3, 2, 2, 3, 3, 2, 4, 3, 3, 2, 5, 4, 3, 3, 3, 5, 5, 2, 5, 3, 5, 5, 3, 3, 5, 6, 5, 3, 5, 2, 5, 7, 5, 4, 4, 5, 5, 3, 7, 5, 5, 3, 6, 6, 3, 7, 7, 3, 5, 3, 5, 7, 7, 6, 4, 5, 7, 2, 5, 5, 9, 7, 3, 5, 5, 6, 7, 5, 5, 5, 9, 5, 3, 5, 6, 7, 7, 4, 8, 5, 7, 7, 3, 5, 5, 5, 7, 9, 9, 1, 7, 8, 5, 4, 5, 7, 7, 7, 9
Offset: 1
Examples
For example, n = 18: 2n-1, 2n, 2n+1 are 35, 36, 37 with odd divisors > 1 {5,7,35}, {3,9}, {37} and quotients 7, 5, 1, 12, 4, 1, so the anti-divisors of 18 are 4, 5, 7, 12. Therefore a(18) = 4.
Links
- Diana Mecum and T. D. Noe, Table of n, a(n) for n = 1..10000
- Jon Perry, The Anti-divisor.
- Jon Perry, The Anti-divisor: Even More Anti-Divisors.
Crossrefs
Programs
-
Maple
antidivisors := proc(n) local a,k; a := {} ; for k from 2 to n-1 do if abs((n mod k)- k/2) < 1 then a := a union {k} ; end if; end do: a ; end proc: A066272 := proc(n) nops(antidivisors(n)) ; end proc: seq(A066272(n),n=1..120); # R. J. Mathar, May 24 2010
-
Mathematica
antid[ n_ ] := Select[ Union[ Join[ Select[ Divisors[ 2n - 1 ], OddQ[ # ] && # != 1 & ], Select[ Divisors[ 2n + 1 ], OddQ[ # ] && # != 1 & ], 2n / Select[ Divisors[ 2n ], OddQ[ # ] && # != 1 & ] ] ], # < n & ]; Table[ Length[ antid[ n ] ], {n, 1, 100} ] f[n_] := Length@ Complement[ Sort@Join[ Select[ Union@ Flatten@ Divisors[{2 n - 1, 2 n + 1}], OddQ@ # && # < n &], Select[ Divisors[2 n], EvenQ@ # && # < n &]], Divisors@ n]; Array[f, 105] (* Robert G. Wilson v, Jul 17 2007 *) nd[n_]:=Count[Range[2,n-1],?(Abs[Mod[n,#]-#/2]<1&)]; Array[nd,110] (* _Harvey P. Dale, Jul 11 2012 *)
-
PARI
al(n)=Vec(sum(k=1,n,(x^(3*k)+x*O(x^n))/(1-x^(2*k))+(x^(3*k+1)+x^(3*k+2)+x*O(x^n))/(1-x^(2*k+1)))) \\ Franklin T. Adams-Watters, Sep 11 2009
-
PARI
a(n) = if(n>1, numdiv(2*n+1) + numdiv(2*n-1) + numdiv(n/2^valuation(n,2)) - 5, 0) \\ Max Alekseyev, Apr 27 2010
-
PARI
antidivisors(n)=select(t->n%t && t
Charles R Greathouse IV, May 12 2016 -
Python
from sympy import divisors def A066272(n): return len([d for d in divisors(2*n) if n > d >=2 and n%d]) + len([d for d in divisors(2*n-1) if n > d >=2 and n%d]) + len([d for d in divisors(2*n+1) if n > d >=2 and n%d]) # Chai Wah Wu, Aug 11 2014
Formula
G.f.: Sum_{k>0} x^(3k) / (1 - x^(2k)) + (x^(3k+1) + x^(3k+2)) / (1 - x^(2k+1)). - Franklin T. Adams-Watters, Sep 11 2009
a(n) = Sum_{i=3..n} (i mod 2) * (3 + floor((2n-1)/i) - ceiling((2n-1)/i) + floor(2n/i) - ceiling(2n/i) + floor((2n+1)/i) - ceiling((2n+1)/i)). - Wesley Ivan Hurt, Aug 10 2014
Sum_{k=1..n} a(k) ~ (n/2) * (3*log(n) + 6*gamma - 13 + 7*log(2)), where gamma is Euler's constant (A001620). - Amiram Eldar, Jan 19 2024
Extensions
More terms from Robert G. Wilson v, Jan 02 2002
More terms from Max Alekseyev, Apr 27 2010
Comments