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.

A096125 Least value of k such that n!/((n-k)!)^2 is an integer.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 4, 4, 5, 4, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 13, 14, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 26, 27, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38
Offset: 1

Views

Author

Amarnath Murthy, Jul 01 2004

Keywords

Comments

If p is the first prime > n/2, then a(n) > n-p. - Robert Israel, Jun 27 2018

Examples

			a(10) = 4.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,k;
      p:= nextprime(floor(n/2));
      for k from n-p+1 do
        if (n!/((n-k)!)^2)::integer then return k fi
      od
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Jun 27 2018
  • Mathematica
    f[n_] := Block[{i = 1, t = Table[n!/(n - k)!^2, {k, n}]}, While[ !IntegerQ[ t[[i]]], i++ ]; i]; Table[ f[n], {n, 75}] (* Robert G. Wilson v, Jul 03 2004 *)

Extensions

Edited, corrected and extended by Robert G. Wilson v, Jul 03 2004