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.

A060681 Largest difference between consecutive divisors of n (ordered by size).

This page as a plain text file.
%I A060681 #79 Dec 21 2024 11:08:40
%S A060681 0,1,2,2,4,3,6,4,6,5,10,6,12,7,10,8,16,9,18,10,14,11,22,12,20,13,18,
%T A060681 14,28,15,30,16,22,17,28,18,36,19,26,20,40,21,42,22,30,23,46,24,42,25,
%U A060681 34,26,52,27,44,28,38,29,58,30,60,31,42,32,52,33,66,34,46,35,70,36,72,37
%N A060681 Largest difference between consecutive divisors of n (ordered by size).
%C A060681 Is a(n) the least m > 0 such that n - m divides n! + m? - _Clark Kimberling_, Jul 28 2012
%C A060681 Is a(n) the least m > 0 such that L(n-m) divides L(n+m), where L = A000032 (Lucas numbers)? - _Clark Kimberling_, Jul 30 2012
%C A060681 Records give A006093. - _Omar E. Pol_, Oct 26 2013
%C A060681 Divide n by its smallest prime factor p, then multiply with (p-1), with a(1) = 0 by convention. Compare also to A366387. - _Antti Karttunen_, Oct 23 2023
%C A060681 a(n) is also the smallest LCM of positive integers x and y where x + y = n. - _Felix Huber_, Aug 28 2024
%H A060681 Reinhard Zumkeller, <a href="/A060681/b060681.txt">Table of n, a(n) for n = 1..10000</a>
%H A060681 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 A060681 a(n) = n - n/A020639(n).
%F A060681 a(n) = n - A032742(n). - _Omar E. Pol_, Aug 31 2011
%F A060681 a(2n) = n, a(3*(2n+1)) = 2*(2n+1) = 4n + 2. - _Antti Karttunen_, Oct 23 2023
%F A060681 Sum_{k=1..n} a(k) ~ (1/2 - c) * n^2, where c is defined in the corresponding formula in A032742. - _Amiram Eldar_, Dec 21 2024
%e A060681 For n = 35, divisors are {1, 5, 7, 35}; differences are {4, 2, 28}; a(35) = largest difference = 28 = 35 - 35/5.
%p A060681 read("transforms") :
%p A060681 A060681 := proc(n)
%p A060681     if n = 1 then
%p A060681         0 ;
%p A060681     else
%p A060681         sort(convert(numtheory[divisors](n),list)) ;
%p A060681         DIFF(%) ;
%p A060681         max(op(%)) ;
%p A060681     end if;
%p A060681 end proc:
%p A060681 seq(A060681(n),n=1..60) ; # _R. J. Mathar_, May 23 2018
%p A060681 # second Maple program:
%p A060681 A060681:=n->if(n=1,0,min(map(x->ilcm(x,n-x),[$1..1/2*n]))); seq(A060681(n),n=1..74); # _Felix Huber_, Aug 28 2024
%t A060681 a[n_ ] := n - n/FactorInteger[n][[1, 1]]
%t A060681 Array[Max[Differences[Divisors[#]]] &, 80, 2] (* _Harvey P. Dale_, Oct 26 2013 *)
%o A060681 (Haskell)
%o A060681 a060681 n = div n p * (p - 1) where p = a020639 n
%o A060681 -- _Reinhard Zumkeller_, Apr 06 2015
%o A060681 (PARI) diff(v)=vector(#v-1,i,v[i+1]-v[i])
%o A060681 a(n)=vecmax(diff(divisors(n))) \\ _Charles R Greathouse IV_, Sep 02 2015
%o A060681 (PARI) a(n) = if (n==1, 0, n - n/factor(n)[1,1]); \\ _Michel Marcus_, Oct 24 2015
%o A060681 (PARI) first(n) = n = max(n, 1); my(res = vector(n)); res[1] = 0; forprime(p = 2, n, for(i = 1, n \ p, if(res[p * i] == 0, res[p * i] = i*(p-1)))); res \\ _David A. Corneth_, Jan 08 2019
%o A060681 (Python)
%o A060681 from sympy import primefactors
%o A060681 def A060681(n): return n-n//min(primefactors(n),default=1) # _Chai Wah Wu_, Jun 21 2023
%Y A060681 Cf. A013661, A020639, A060680, A060682, A060683, A060685, A064097 (number of iterations needed to reach 1).
%Y A060681 Cf. also A171462, A366387.
%K A060681 nonn,easy
%O A060681 1,3
%A A060681 _Labos Elemer_, Apr 19 2001
%E A060681 Edited by _Dean Hickerson_, Jan 22 2002
%E A060681 a(1)=0 added by _N. J. A. Sloane_, Oct 01 2015 at the suggestion of _Antti Karttunen_