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.

This page as a plain text file.
%I A060680 #37 Mar 17 2025 02:41:01
%S A060680 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,
%T A060680 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,
%U A060680 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
%N A060680 Smallest difference between consecutive divisors of n.
%C A060680 a(n) = 1 if n is even and a(n) is even if n is odd.
%C A060680 a(n) = least m>0 such that n!+1+m and n-m are not relatively prime. - _Clark Kimberling_, Jul 21 2012
%H A060680 Reinhard Zumkeller, <a href="/A060680/b060680.txt">Table of n, a(n) for n = 2..10000</a>
%H A060680 Antal Balog, Paul Erdős and Gérald Tenenbaum, <a href="http://dx.doi.org/10.1007/978-1-4612-3464-7_6">On Arithmetic Functions Involving Consecutive Divisors</a>, In: Analytical Number Theory, pp. 77-90, Birkhäuser, Basel, 1990.
%F A060680 a(2n+1) = A060684(n).
%e A060680 For n = 35, divisors = {1,5,7,35}; differences = {4,2,28}; a(35) = smallest difference = 2.
%p A060680 read("transforms") :
%p A060680 A060680 := proc(n)
%p A060680     sort(convert(numtheory[divisors](n),list)) ;
%p A060680     DIFF(%) ;
%p A060680     min(op(%)) ;
%p A060680 end proc:
%p A060680 seq(A060680(n),n=2..60) ; # _R. J. Mathar_, May 23 2018
%t A060680 a[n_] := Min@@(Drop[d=Divisors[n], 1]-Drop[d, -1]);
%t A060680 (* Second program: *)
%t A060680 a[n_] := Min[Differences[Divisors[n]]];
%t A060680 Table[a[n], {n, 2, 100}] (* _Jean-François Alcover_, Oct 16 2024 *)
%o A060680 (Haskell)
%o A060680 a060680 = minimum . a193829_row  -- _Reinhard Zumkeller_, Jun 25 2015
%o A060680 (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
%Y A060680 Cf. A060681 (largest difference), A060682, A060683, A060684.
%Y A060680 Cf. A193829, A027750.
%K A060680 nonn
%O A060680 2,2
%A A060680 _Labos Elemer_, Apr 19 2001
%E A060680 Corrected by _David W. Wilson_, May 04 2001
%E A060680 Edited by _Dean Hickerson_, Jan 22 2002