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.

Showing 1-4 of 4 results.

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

Original entry on oeis.org

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, 14, 28, 15, 30, 16, 22, 17, 28, 18, 36, 19, 26, 20, 40, 21, 42, 22, 30, 23, 46, 24, 42, 25, 34, 26, 52, 27, 44, 28, 38, 29, 58, 30, 60, 31, 42, 32, 52, 33, 66, 34, 46, 35, 70, 36, 72, 37
Offset: 1

Views

Author

Labos Elemer, Apr 19 2001

Keywords

Comments

Is a(n) the least m > 0 such that n - m divides n! + m? - Clark Kimberling, Jul 28 2012
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
Records give A006093. - Omar E. Pol, Oct 26 2013
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
a(n) is also the smallest LCM of positive integers x and y where x + y = n. - Felix Huber, Aug 28 2024

Examples

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

Crossrefs

Cf. A013661, A020639, A060680, A060682, A060683, A060685, A064097 (number of iterations needed to reach 1).
Cf. also A171462, A366387.

Programs

  • Haskell
    a060681 n = div n p * (p - 1) where p = a020639 n
    -- Reinhard Zumkeller, Apr 06 2015
    
  • Maple
    read("transforms") :
    A060681 := proc(n)
        if n = 1 then
            0 ;
        else
            sort(convert(numtheory[divisors](n),list)) ;
            DIFF(%) ;
            max(op(%)) ;
        end if;
    end proc:
    seq(A060681(n),n=1..60) ; # R. J. Mathar, May 23 2018
    # second Maple program:
    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
  • Mathematica
    a[n_ ] := n - n/FactorInteger[n][[1, 1]]
    Array[Max[Differences[Divisors[#]]] &, 80, 2] (* Harvey P. Dale, Oct 26 2013 *)
  • PARI
    diff(v)=vector(#v-1,i,v[i+1]-v[i])
    a(n)=vecmax(diff(divisors(n))) \\ Charles R Greathouse IV, Sep 02 2015
    
  • PARI
    a(n) = if (n==1, 0, n - n/factor(n)[1,1]); \\ Michel Marcus, Oct 24 2015
    
  • 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
    
  • Python
    from sympy import primefactors
    def A060681(n): return n-n//min(primefactors(n),default=1) # Chai Wah Wu, Jun 21 2023

Formula

a(n) = n - n/A020639(n).
a(n) = n - A032742(n). - Omar E. Pol, Aug 31 2011
a(2n) = n, a(3*(2n+1)) = 2*(2n+1) = 4n + 2. - Antti Karttunen, Oct 23 2023
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

Extensions

Edited by Dean Hickerson, Jan 22 2002
a(1)=0 added by N. J. A. Sloane, Oct 01 2015 at the suggestion of Antti Karttunen

A060654 a(n) = gcd(n, A060766(n)).

Original entry on oeis.org

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

Views

Author

Labos Elemer, Apr 25 2001

Keywords

Examples

			If n is prime p, then A060766(p) = p-1 and lcm(p, p-1) = 1. If n=2k then a(2k)=k or as an "anomaly", a(2k)=2k.
At n=30, D={1, 2, 3, 5, 6, 10, 15, 30}, dD={1, 1, 2, 1, 4, 5, 15}={1, 2, 4, 5, 15}, lcm(dD)=60, gcd(n, lcm(dD(n))) = gcd(30, 60) = 30 = n.
At n=36, D={1, 2, 3, 4, 6, 9, 12, 18, 36}, dD={1, 1, 1, 2, 3, 3, 6, 18}={1, 2, 3, 6, 18}, lcm(dD)=18, gcd(n, lcm(dD(n))) = gcd(36, 18) = 18 = n/2.
		

Crossrefs

Programs

  • Maple
    A060766:= proc(n) local F; F:= sort(convert(numtheory:-divisors(n),list));
       ilcm(op(F[2..-1] - F[1..-2])) end proc:
    seq(igcd(n,A060766(n)),n=2..100); # Robert Israel, Dec 20 2015
  • Mathematica
    Table[GCD[n, LCM @@ Differences@ Divisors@ n], {n, 2, 82}] (* Michael De Vlieger, Dec 20 2015 *)

Formula

a(n) = gcd(n, lcm(dd(n))), where dd(n) is the first difference of divisors (ordered by size).

A060695 a(n) = gcd(2n, A060766(2n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 30, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 60, 31, 32, 33, 34, 70, 36, 37, 38, 39, 40, 41, 42, 43, 44, 90, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 126, 64, 65, 66, 67, 68, 69, 140, 71
Offset: 1

Views

Author

Labos Elemer, Apr 25 2001

Keywords

Examples

			n = 30: D = {1, 2, 3, 5, 6, 10, 15, 30}, dD = {1, 1, 2, 1, 4, 5, 15}={1, 2, 4, 5, 15}, lcm(dD) = 60, gcd(n, lcm(dD(n))) = gcd(30, 60) = 30 = n
n = 36: D = {1, 2, 3, 4, 6, 9, 12, 18, 36}, dD = {1, 1, 1, 2, 3, 3, 6, 18} = {1, 2, 3, 6, 18}, lcm(dD) = 18, gcd(n, lcm(dD(n))) = gcd(36, 18) = 18 = n/2.
		

Crossrefs

Programs

  • Mathematica
    Table[GCD[2 n, LCM @@ Differences@ Divisors[2 n]], {n, 71}] (* Michael De Vlieger, Dec 20 2015 *)
  • PARI
    a(n) = my(d=divisors(2*n), dd = vector(#d-1, k, d[k+1] - d[k])); gcd(2*n, lcm(dd)); \\ Michel Marcus, Mar 22 2020

Formula

a(n) = a(2k) is either n = 2k or n/2 = k. a(n) = n/2 seems regular, a(n) = n seems "anomalous".

A060700 "Anomalous" numbers k such that for even numbers 2k, gcd(2k, lcm(dd(2k)))=2k and not k, where dd(2k) is the first difference set of divisors of 2k.

Original entry on oeis.org

15, 30, 35, 45, 63, 70, 75, 77, 91, 99, 105, 117, 126, 135, 140, 143, 150, 153, 154, 165, 175, 182, 187, 189, 195, 198, 209, 221, 225, 231, 234, 245, 247, 252, 255, 273, 280, 285, 286, 297, 299, 306, 308, 315, 323, 325, 330, 345, 350, 351, 357, 364, 374, 375
Offset: 1

Views

Author

Labos Elemer, Apr 25 2001

Keywords

Examples

			63 is here because for 126 = 2*63, lcm(dd(126)) = lcm(1, 1, 3, 1, 2, 5, 4, 3, 21, 21, 63) = 1260, so gcd(126, lcm(dd(126))) = gcd(126, 1260) = 126.
		

Crossrefs

Programs

  • PARI
    f(n) = {my(d = divisors(n), dd = vector(#d-1, k, d[k+1] - d[k])); gcd(n, lcm(dd));}
    isok(n) = (f(2*n) == 2*n); \\ Michel Marcus, Mar 29 2018
Showing 1-4 of 4 results.