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.

A060680 Smallest difference between consecutive divisors of n.

Original entry on oeis.org

1, 2, 1, 4, 1, 6, 1, 2, 1, 10, 1, 12, 1, 2, 1, 16, 1, 18, 1, 2, 1, 22, 1, 4, 1, 2, 1, 28, 1, 30, 1, 2, 1, 2, 1, 36, 1, 2, 1, 40, 1, 42, 1, 2, 1, 46, 1, 6, 1, 2, 1, 52, 1, 4, 1, 2, 1, 58, 1, 60, 1, 2, 1, 4, 1, 66, 1, 2, 1, 70, 1, 72, 1, 2, 1, 4, 1, 78, 1, 2, 1, 82, 1, 4, 1, 2, 1, 88, 1, 6, 1, 2, 1, 4
Offset: 2

Views

Author

Labos Elemer, Apr 19 2001

Keywords

Comments

a(n) = 1 if n is even and a(n) is even if n is odd.
a(n) = least m>0 such that n!+1+m and n-m are not relatively prime. - Clark Kimberling, Jul 21 2012

Examples

			For n = 35, divisors = {1,5,7,35}; differences = {4,2,28}; a(35) = smallest difference = 2.
		

Crossrefs

Cf. A060681 (largest difference), A060682, A060683, A060684.

Programs

  • Haskell
    a060680 = minimum . a193829_row  -- Reinhard Zumkeller, Jun 25 2015
    
  • Maple
    read("transforms") :
    A060680 := proc(n)
        sort(convert(numtheory[divisors](n),list)) ;
        DIFF(%) ;
        min(op(%)) ;
    end proc:
    seq(A060680(n),n=2..60) ; # R. J. Mathar, May 23 2018
  • Mathematica
    a[n_] := Min@@(Drop[d=Divisors[n], 1]-Drop[d, -1]);
    (* Second program: *)
    a[n_] := Min[Differences[Divisors[n]]];
    Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Oct 16 2024 *)
  • PARI
    a(n) = {my(m = n, d1); fordiv(n, d, if(d > 1 && d - d1 < m, m = d - d1); d1 = d); m;} \\ Amiram Eldar, Mar 17 2025

Formula

a(2n+1) = A060684(n).

Extensions

Corrected by David W. Wilson, May 04 2001
Edited by Dean Hickerson, Jan 22 2002