OFFSET
1,14
COMMENTS
If no such divisors d exist, a(n)=0.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
V. Shevelev, On divisibility of binomial(n-i-1,i-1) by i, Int. J. Number Theory vol 3, no. 1 (2007), 119-139.
MAPLE
A178109 := proc(n) local dvs, d ; dvs := {} ; for d from 1 to n/2 do if gcd(n, d) > 1 and d in numtheory[divisors]( binomial(n-d-1, d-1)) then dvs := dvs union {d} ; end if; end do:
if nops(dvs) = 0 then 0; else max(op(dvs)) ; end if; end proc:
seq(A178109(n), n=1..90) ; # R. J. Mathar, May 28 2010
# Alternative:
f:= proc(n) local d;
for d from floor(n/2) to 2 by -1 do
if igcd(d, n) > 1 and binomial(n-d-1, d-1) mod d = 0 then return d fi
od;
0
end proc:
map(f, [$1..100]); # Robert Israel, Jan 15 2019
MATHEMATICA
a[n_] := If[n==1, 0, Module[{d=Floor[n/2]}, While[d>1 && (GCD[n, d]==1 || !Divisible[Binomial[n-d-1, d-1], d]), d--]; If[d==1, d=0]; d]]; Array[a, 100] (* Amiram Eldar, Dec 04 2018 *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Vladimir Shevelev, May 20 2010
EXTENSIONS
a(39), a(54) and a(70) corrected by R. J. Mathar, May 28 2010
STATUS
approved