OFFSET
0,4
COMMENTS
a(n) is the largest integer such that 2^a(n) divides binomial(n^2,n)=A014062(n).
a(n) is the number of carries when adding n to n^2-n in base 2. - Robert Israel, Oct 23 2019
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000(n=0 to 1000 from Harvey P. Dale)
Wikipedia, Kummer's theorem
EXAMPLE
For n = 6, binomial(36,6) = 1947792 = 2^4*3*7*11*17*31, the highest power of 2 is 2^4, and the exponent of 2^4 is a(6)=4.
MAPLE
A007814 := proc(n) if type(n, 'odd') then 0; else for p in ifactors(n)[2] do if op(1, p) = 2 then return op(2, p); end if; end do: end if; end proc:
A014062 := proc(n) binomial(n^2, n) ; end proc:
# Alternative:
nc:= proc(a, b, c)
local t;
if c=0 and (a=0 or b=0) then return 0 fi;
t:= (a mod 2) + (b mod 2) + c;
if t < 2 then procname(floor(a/2), floor(b/2), 0)
else 1 + procname(floor(a/2), floor(b/2), 1)
fi
end proc:
seq(nc(n, n^2-n, 0), n=0..100); # Robert Israel, Oct 23 2019
MATHEMATICA
IntegerExponent[Table[Binomial[n^2, n], {n, 0, 120}], 2] (* Harvey P. Dale, Mar 31 2019 *)
PROG
(Python)
from math import comb
def A177424(n): return (~(m:=comb(n**2, n))& m-1).bit_length() # Chai Wah Wu, Jul 08 2022
(PARI) valp(n, p=2)=my(s); while(n\=p, s+=n); s
a(n)=valp(n^2)-valp(n^2-n)-valp(n) \\ Charles R Greathouse IV, Jul 08 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michel Lagneau, May 07 2010
EXTENSIONS
Maple program replaced by a structured general version - R. J. Mathar, May 10 2010
STATUS
approved