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.

A052128 a(1) = 1; for n > 1, a(n) is the largest divisor of n that is coprime to a larger divisor of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 3, 1, 1, 2, 1, 4, 3, 2, 1, 3, 1, 2, 1, 4, 1, 5, 1, 1, 3, 2, 5, 4, 1, 2, 3, 5, 1, 6, 1, 4, 5, 2, 1, 3, 1, 2, 3, 4, 1, 2, 5, 7, 3, 2, 1, 5, 1, 2, 7, 1, 5, 6, 1, 4, 3, 7, 1, 8, 1, 2, 3, 4, 7, 6, 1, 5, 1, 2, 1, 7, 5, 2, 3, 8, 1, 9, 7, 4, 3, 2, 5, 3, 1, 2, 9, 4, 1, 6
Offset: 1

Views

Author

James Sellers, Jan 21 2000

Keywords

Comments

Least k > 0 such that the resultant of the k-th cyclotomic polynomial and the n-th cyclotomic polynomial is not 1. - Benoit Cloitre, Oct 13 2002
From Jianing Song, Sep 28 2022: (Start)
a(n) is the largest divisor d of n such that d <= sqrt(n) and that gcd(d,n/d) = 1.
Proof: write n = Product_{1<=i<=r} (p_i)^(e_i), let d be the largest divisor of n such that d <= sqrt(n) and that gcd(d,n/d) = 1. Obviously we have a(n) >= d. Suppose that a(n) = Product_{1<=i<=s} (p_i)^(m_i) for s <= r, 1 <= m_i <= e_i, then the larger divisor to which a(n) is coprime is a divisor of Product_{s+1<=i<=r} (p_i)^(e_i), so by definition we have a(n) <= min{Product_{1<=i<=s} (p_i)^(e_i), Product_{s+1<=i<=r} (p_i)^(e_i)} <= d. Thus a(n) = d. (End)

Examples

			a(6) = 6 / 3^1 = 2.
		

Crossrefs

Programs

  • Mathematica
    Table[best = 1; d = Divisors[n]; While[Length[d] > 1, e = d[[1]]; d = Rest[d]; If[Min[GCD[e, d]] == 1, best = e]]; best, {n, 102}] (* T. D. Noe, Aug 23 2013 *)
  • PARI
    a(n) = my(i, j, d = divisors(n)); forstep (i = #d-1, 1, -1, for (j = i+1, #d, if (gcd(d[i], d[j]) == 1, return (d[i])))); 1 \\ Michel Marcus, Aug 22 2013
    
  • PARI
    a(n)=my(f=factor(n),v=[1]); for(i=1,#f~,v=concat(v, f[i,1]^f[i,2] *v)); v=vecsort(v); forstep(i=#v\2,2,-1,for(j=i+1,#v-1, if(gcd(v[i],v[j])==1,return(v[i])))); 1 \\ Charles R Greathouse IV, Aug 22 2013
    
  • PARI
    A052128(n) = fordiv(n,d,if((d>=(n/d)) && 1==gcd(d,n/d), return(n/d))); \\ Antti Karttunen, Jun 16 2022

Formula

a(n) = n / A354933(n) = A354933(n) - A076388(n). - Antti Karttunen, Jun 16 2022

Extensions

Terms corrected by Charles R Greathouse IV, Aug 22 2013
Definition rewritten by Jianing Song, Sep 28 2022

A354933 a(1) = 1; for n > 1, a(n) = n / the largest divisor of n that is coprime to a larger divisor of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 4, 13, 7, 5, 16, 17, 9, 19, 5, 7, 11, 23, 8, 25, 13, 27, 7, 29, 6, 31, 32, 11, 17, 7, 9, 37, 19, 13, 8, 41, 7, 43, 11, 9, 23, 47, 16, 49, 25, 17, 13, 53, 27, 11, 8, 19, 29, 59, 12, 61, 31, 9, 64, 13, 11, 67, 17, 23, 10, 71, 9, 73, 37, 25, 19, 11, 13, 79, 16, 81, 41, 83, 12, 17, 43
Offset: 1

Views

Author

Antti Karttunen, Jun 16 2022

Keywords

Comments

a(n) is the smallest divisor d of n such that d >= sqrt(n) and that gcd(d,n/d) = 1. For the proof see A052128. - Jianing Song, Sep 28 2022

Crossrefs

Differs from A346596 for the first time at n=60, where a(60) = 12, while A346596(60) = 15.

Programs

  • Mathematica
    a[n_] := SelectFirst[Divisors[n], # >= n/# && CoprimeQ[#, n/#] &]; Array[a, 100] (* Amiram Eldar, Jun 16 2022 *)
  • PARI
    A354933(n) = fordiv(n,d,if((d>=(n/d)) && 1==gcd(d,n/d), return(d)));

Formula

a(n) = n / A052128(n).
a(n) = A052128(n) + A076388(n).

Extensions

Definition rewritten by Jianing Song, Sep 28 2022

A354988 a(n) = A345993(n) - A345992(n).

Original entry on oeis.org

0, 1, 2, 3, 4, 1, 6, 7, 8, 3, 10, 1, 12, 5, -2, 15, 16, 7, 18, 1, 4, 9, 22, -5, 24, 11, 26, -3, 28, 1, 30, 31, -8, 15, -2, 5, 36, 17, 10, 3, 40, 1, 42, -7, -4, 21, 46, 13, 48, 23, -14, 9, 52, 25, 6, 1, 16, 27, 58, -11, 60, 29, -2, 63, 8, -5, 66, 13, -20, -9, 70, 1, 72, 35, 22, -15, 4, 7, 78, 11, 80, 39, 82, 17, -12
Offset: 1

Views

Author

Antti Karttunen, Jun 16 2022

Keywords

Crossrefs

Cf. A345992, A345993, A345995 (positions of negative terms), A354989 (their characteristic function).
Absolute values differ from A076388 for the first time at n=60, where a(60) = -11, while A076388(60) = 7.

Programs

  • Mathematica
    a[n_] := Module[{m = 1}, While[!Divisible[m*(m + 1), n], m++]; GCD[n, m + 1] - GCD[n, m]]; Array[a, 100] (* Amiram Eldar, Jun 16 2022 *)
  • PARI
    A354988(n) = for(m=1, oo, if((m*(m+1))%n==0, return(gcd(n,1+m)-gcd(n,m))));
    (Python 3.8+)
    from math import gcd, prod
    from itertools import combinations
    from sympy import factorint
    from sympy.ntheory.modular import crt
    def A354988(n):
        if n == 1:
            return 0
        plist = tuple(p**q for p, q in factorint(n).items())
        return n-1 if len(plist) == 1 else -gcd(n,s:=int(min(min(crt((m, n//m), (0, -1))[0], crt((n//m, m), (0, -1))[0]) for m in (prod(d) for l in range(1, len(plist)//2+1) for d in combinations(plist, l))))) + gcd(n,s+1) # Chai Wah Wu, Jun 16 2022

A243981 Minimum range of sets of natural numbers with a product of n.

Original entry on oeis.org

1, 2, 0, 4, 1, 6, 0, 0, 3, 10, 1, 12, 5, 2, 0, 16, 1, 18, 1, 4, 9, 22, 1, 0, 11, 0, 3, 28, 1, 30, 0, 8, 15, 2, 0, 36, 17, 10, 3, 40, 1, 42, 7, 2, 21, 46, 1, 0, 3, 14, 9, 52, 1, 6, 1, 16, 27, 58, 2, 60, 29, 2, 0, 8, 5, 66, 13, 20, 3, 70, 1, 72, 35, 2, 15, 4, 7, 78, 1, 0, 39, 82, 4, 12, 41, 26, 3, 88, 1, 6, 19, 28, 45, 14, 1, 96, 5, 2, 0
Offset: 2

Views

Author

Paul Richards, Nov 11 2014

Keywords

Comments

The minimum difference between the largest and smallest values in the sets of positive integers with a product of n, excluding the singleton set {n}.

Examples

			For 45 the sets are {1,45}, {3,15}, {5,9}, {3,3,5} with differences of 44, 12, 4 and 2 respectively.  2 is the minimum and so a(45) = 2.
		

Crossrefs

Formula

a(n) <= A046665(n) for all composite n, a(p) = p - 1 for primes p. - Charlie Neder, Jan 13 2019
Showing 1-4 of 4 results.