cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A178109 The maximum number d, 2 <= d <= n/2, which divides binomial(n-d-1,d-1) and is not coprime to n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 6, 0, 6, 0, 0, 0, 4, 0, 0, 0, 8, 6, 10, 0, 8, 0, 14, 0, 14, 0, 15, 0, 14, 9, 14, 0, 9, 0, 10, 15, 20, 0, 22, 0, 22, 21, 18, 0, 21, 20, 22, 24, 24, 0, 26, 0, 28, 24, 30, 10, 28, 0, 30, 24, 26, 0, 33, 0, 30, 20, 30, 21, 28, 0, 38, 33, 38, 0, 28, 20, 36
Offset: 1

Views

Author

Vladimir Shevelev, May 20 2010

Keywords

Comments

If no such divisors d exist, a(n)=0.

Crossrefs

Programs

  • 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 *)

Extensions

a(39), a(54) and a(70) corrected by R. J. Mathar, May 28 2010