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-6 of 6 results.

A032742 a(1) = 1; for n > 1, a(n) = largest proper divisor of n (that is, for n>1, maximum divisor d of n in range 1 <= d < n).

Original entry on oeis.org

1, 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, 15, 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, 30, 1, 31, 21, 32, 13, 33, 1, 34, 23, 35, 1, 36, 1, 37, 25, 38, 11, 39, 1, 40
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Comments

It seems that a(n) = Max_{j=n+1..2n-1} gcd(n,j). - Labos Elemer, May 22 2002
This is correct: No integer in the range [n+1, 2n-1] has n as its divisor, but certainly at least one multiple of the largest proper divisor of n will occur there (e.g., if it is n/2, then at n + (n/2)). - Antti Karttunen, Dec 18 2014
The slopes of the visible lines made by the points in the scatter plot are 1/2, 1/3, 1/5, 1/7, ... (reciprocals of primes). - Moosa Nasir, Jun 19 2022

Crossrefs

Maximal GCD of k positive integers with sum n for k = 2..10: this sequence (k=2,n>=2), A355249 (k=3), A355319 (k=4), A355366 (k=5), A355368 (k=6), A355402 (k=7), A354598 (k=8), A354599 (k=9), A354601 (k=10).

Programs

  • Haskell
    a032742 n = n `div` a020639 n  -- Reinhard Zumkeller, Oct 03 2012
    
  • Maple
    A032742 :=proc(n) option remember; if n = 1 then 1; else numtheory[divisors](n) minus {n} ; max(op(%)) ; end if; end proc: # R. J. Mathar, Jun 13 2011
    1, seq(n/min(numtheory:-factorset(n)), n=2..1000); # Robert Israel, Dec 18 2014
  • Mathematica
    f[n_] := If[n == 1, 1, Divisors[n][[-2]]]; Table[f[n], {n, 100}] (* Vladimir Joseph Stephan Orlovsky, Mar 03 2010 *)
    Join[{1},Divisors[#][[-2]]&/@Range[2,80]] (* Harvey P. Dale, Nov 29 2011 *)
    a[n_] := n/FactorInteger[n][[1, 1]]; Array[a, 100] (* Amiram Eldar, Nov 26 2020 *)
    Table[Which[n==1,1,PrimeQ[n],1,True,Divisors[n][[-2]]],{n,80}] (* Harvey P. Dale, Feb 02 2022 *)
  • PARI
    a(n)=if(n==1,1,n/factor(n)[1,1]) \\ Charles R Greathouse IV, Jun 15 2011
    
  • Python
    from sympy import factorint
    def a(n): return 1 if n == 1 else n//min(factorint(n))
    print([a(n) for n in range(1, 81)]) # Michael S. Branicky, Jun 21 2022
  • Scheme
    (define (A032742 n) (/ n (A020639 n))) ;; Antti Karttunen, Dec 18 2014
    

Formula

a(n) = n / A020639(n).
Other identities and observations:
A054576(n) = a(a(n)); A117358(n) = a(a(a(n))) = a(A054576(n)); a(A008578(n)) = 1, a(A002808(n)) > 1. - Reinhard Zumkeller, Mar 10 2006
a(n) = A130064(n) / A006530(n). - Reinhard Zumkeller, May 05 2007
a(m)*a(n) < a(m*n) for m and n > 1. - Reinhard Zumkeller, Apr 11 2008
a(m*n) = max(m*a(n), n*a(m)). - Robert Israel, Dec 18 2014
From Antti Karttunen, Mar 31 2018: (Start)
a(n) = n - A060681(n).
For n > 1, a(n) = A003961^(r)(A246277(n)), where r = A055396(n)-1 and A003961^(r)(n) stands for shifting the prime factorization of n by r positions towards larger primes.
For all n >= 1, A276085(a(A276086(n))) = A276151(n).
(End)
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Sum_{k>=1} A005867(k-1)/(prime(k)*A002110(k)) = 0.165049... . - Amiram Eldar, Nov 19 2022

Extensions

Definition clarified by N. J. A. Sloane, Dec 26 2022

A033987 Numbers that are divisible by at least 4 primes (counted with multiplicity).

Original entry on oeis.org

16, 24, 32, 36, 40, 48, 54, 56, 60, 64, 72, 80, 81, 84, 88, 90, 96, 100, 104, 108, 112, 120, 126, 128, 132, 135, 136, 140, 144, 150, 152, 156, 160, 162, 168, 176, 180, 184, 189, 192, 196, 198, 200, 204, 208, 210, 216, 220, 224, 225, 228, 232, 234, 240, 243
Offset: 1

Views

Author

Keywords

Comments

Complement of A037144: A001222(a(n)) > 3; A117358(a(n)) > 1. - Reinhard Zumkeller, Mar 10 2006
Also numbers such that no permutation of all proper divisors exists with coprime adjacent elements: A178254(a(n)) = 0. - Reinhard Zumkeller, May 24 2010
Also, numbers that can be written as a product of at least two composites, i.e., admit a nontrivial factorization into composites. - Felix Fröhlich, Dec 22 2018

Crossrefs

Subsequence of A033942; A178212 is a subsequence.

Programs

  • Maple
    with(numtheory): A033987:=n->`if`(bigomega(n)>3, n, NULL): seq(A033987(n), n=1..300); # Wesley Ivan Hurt, May 26 2015
  • Mathematica
    Select[Range[300],PrimeOmega[#]>3&] (* Harvey P. Dale, Mar 20 2016 *)
  • PARI
    is(n)=bigomega(n)>3 \\ Charles R Greathouse IV, May 26 2015
    
  • Python
    from math import prod, isqrt
    from sympy import primerange, integer_nthroot, primepi
    def A033987(n):
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b,isqrt(x//c)+1),a)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b,integer_nthroot(x//c,m)[0]+1),a) for d in g(x,a2,b2,c*b2,m-1)))
        def f(x): return int(n+primepi(x)+sum(sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,i)) for i in range(2,4)))
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmax # Chai Wah Wu, Aug 23 2024

Formula

Product p_i^e_i with Sum e_i >= 4.
A001055(a(n)) > A033273(a(n)). - Juri-Stepan Gerasimov, Nov 09 2009
a(n) ~ n. - Charles R Greathouse IV, Jul 11 2024

Extensions

More terms from Patrick De Geest, Jun 15 1998

A037144 Numbers with at most 3 prime factors (counted with multiplicity).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 55, 57, 58, 59, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 82, 83, 85, 86
Offset: 1

Views

Author

Keywords

Comments

Complement of A033987: A001222(a(n))<=3; A117358(a(n))=1. - Reinhard Zumkeller, Mar 10 2006
Also numbers such that exist permutations of all proper divisors only with coprime adjacent elements: A178254(a(n))>0. - Reinhard Zumkeller, May 24 2010

Crossrefs

A037143 is a subsequence.

Programs

  • Magma
    [ n: n in [1..86] | n eq 1 or &+[ t[2]: t in Factorization(n) ] le 3 ]; /* Klaus Brockhaus, Mar 20 2007 */
    
  • Mathematica
    Select[Range[100],PrimeOmega[#]<4&] (* Harvey P. Dale, Oct 15 2015 *)
  • PARI
    is(n)=bigomega(n)<4 \\ Charles R Greathouse IV, Sep 14 2015
    
  • Python
    from math import prod, isqrt
    from sympy import primerange, integer_nthroot, primepi
    def A037144(n):
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b,isqrt(x//c)+1),a)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b,integer_nthroot(x//c,m)[0]+1),a) for d in g(x,a2,b2,c*b2,m-1)))
        def f(x): return int(n+x-2-primepi(x)-sum(sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,i)) for i in range(2,4)))
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmax # Chai Wah Wu, Aug 23 2024

Formula

a(n) ~ 2n log n/(log log n)^2. - Charles R Greathouse IV, Sep 14 2015

Extensions

More terms from Reinhard Zumkeller, Mar 10 2006
More terms from Klaus Brockhaus, Mar 20 2007

A014673 Smallest prime factor of greatest proper divisor of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 2, 3, 5, 1, 2, 1, 7, 5, 2, 1, 3, 1, 2, 7, 11, 1, 2, 5, 13, 3, 2, 1, 3, 1, 2, 11, 17, 7, 2, 1, 19, 13, 2, 1, 3, 1, 2, 3, 23, 1, 2, 7, 5, 17, 2, 1, 3, 11, 2, 19, 29, 1, 2, 1, 31, 3, 2, 13, 3, 1, 2, 23, 5, 1, 2, 1, 37, 5, 2, 11, 3, 1, 2, 3, 41, 1, 2, 17, 43, 29, 2, 1, 3, 13, 2, 31, 47
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 24 2003

Keywords

Comments

For n > 1: a(n) = 1 iff n is prime; a(A001358(n)) = A084127(n); a(A025475(n)) = A020639(A025475(n)). [corrected by Peter Munn, Feb 19 2017]
When n is composite, this is the 2nd factor when n is written as a product of primes in nondecreasing order. For example, 12 = 2*2*3, so a(12) = 2. - Peter Munn, Feb 19 2017
For all sufficiently large n the median value of a(1), a(2), ... a(n) is A281889(2) = 7. - Peter Munn, Jul 12 2019

Crossrefs

Programs

  • Mathematica
    PrimeFactors[ n_ ] := Flatten[ Table[ # [ [ 1 ] ], {1} ] & /@ FactorInteger[ n ] ]; f[ n_ ] := Block[ {gpd = Divisors[ n ][ [ -2 ] ]}, If[ gpd == 1, 1, PrimeFactors[ gpd ][ [ 1 ] ] ] ]; Table[ If[ n == 1, 1, f[ n ] ], {n, 1, 95} ]
    (* Second program: *)
    Table[If[Or[PrimeQ@ n, n == 1], 1, FactorInteger[n/SelectFirst[Prime@ Range@ PrimePi[Sqrt@ n], Divisible[n, #] &]][[1, 1]] ], {n, 94}] (* Michael De Vlieger, Aug 14 2017 *)
  • PARI
    lpf(n)=if(n>1,factor(n)[1,1],1)
    a(n)=lpf(n/lpf(n)) \\ Charles R Greathouse IV, May 09 2013
    
  • PARI
    a(n)=if(n<4||isprime(n),return(1)); my(f=factor(n)); if(f[1,2]>1, f[1,1], f[2,1]) \\ Charles R Greathouse IV, May 09 2013
    
  • Scheme
    (define (A014673 n) (A020639 (/ n (A020639 n)))) ;; Code for A020639 given under that entry - Antti Karttunen, Aug 12 2017

Formula

a(n) = A020639(A032742(n)).
A117357(n) = A020639(A054576(n)); A117358(n) = A032742(A054576(n)) = A054576(n)/A117357(n). - Reinhard Zumkeller, Mar 10 2006
If A001222(n) >= 2, a(n) = A027746(n,2), otherwise a(n) = 1. - Peter Munn, Jul 13 2019

A054576 Largest proper factor of the largest proper factor of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 4, 1, 3, 1, 5, 1, 1, 1, 6, 1, 1, 3, 7, 1, 5, 1, 8, 1, 1, 1, 9, 1, 1, 1, 10, 1, 7, 1, 11, 5, 1, 1, 12, 1, 5, 1, 13, 1, 9, 1, 14, 1, 1, 1, 15, 1, 1, 7, 16, 1, 11, 1, 17, 1, 7, 1, 18, 1, 1, 5, 19, 1, 13, 1, 20, 9, 1, 1, 21, 1, 1, 1, 22, 1, 15, 1, 23, 1, 1, 1, 24
Offset: 1

Views

Author

Henry Bottomley, Apr 11 2000

Keywords

Comments

Here a "proper factor of n" means 1 if n = 1, and otherwise any d that divides n with 1 <= d < n. - N. J. A. Sloane, Dec 26 2022

Examples

			The largest proper factor of 8 is 4, the largest proper factor of 4 is 2, so a(8) = 2. - _N. J. A. Sloane_, Dec 26 2022
		

Crossrefs

Programs

Formula

a(n) = A053598(A053598(n))
a(n) = A032742(A032742(n)); A117357(n) = A020639(a(n)); A117358(n) = A032742(a(n)) = a(n) / A117357(n); a(A037143(n)) = 1, a(A033942(n)) > 1. - Reinhard Zumkeller, Mar 10 2006

Extensions

Deleted an incorrect comment and link. - N. J. A. Sloane, Dec 26 2022

A115561 a(n) = lpf((n/lpf(n))/lpf(n/lpf(n))), where lpf=A020639, least prime factor.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 3, 1, 5, 1, 1, 1, 2, 1, 1, 3, 7, 1, 5, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 7, 1, 11, 5, 1, 1, 2, 1, 5, 1, 13, 1, 3, 1, 2, 1, 1, 1, 3, 1, 1, 7, 2, 1, 11, 1, 17, 1, 7, 1, 2, 1, 1, 5, 19, 1, 13, 1, 2, 3, 1, 1, 3, 1, 1, 1, 2, 1, 3, 1, 23, 1, 1, 1, 2, 1, 7, 11, 5, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 10 2006

Keywords

Comments

From Peter Munn, Jul 14 2019: (Start)
a(n) = 1 if and only if n is 1 or a prime or semiprime. Otherwise a(n) is the 3rd factor when n is written as a product of primes in nondecreasing order. For example, 60 = 2*2*3*5, so a(60) = 3.
Although values equal to 1 are predominant at low indices, their asymptotic density is 0, whereas for values equal to prime(k) for k > 0 the asymptotic density is positive, namely A281890(k,3)/A002110(k)^3. For all sufficiently large n the median value of a(1), a(2), ... a(n) is A281889(3) = 433.
(End)

Crossrefs

Programs

  • Mathematica
    f[n_] := FactorInteger[n][[1, 1]]; Table[f[#/f@ #] &[n/f@ n], {n, 101}] (* Michael De Vlieger, Aug 14 2017 *)
  • PARI
    a020639(n) = if(n>1, if(n>n=factor(n, 0)[1, 1], n, factor(n)[1, 1]), 1) \\ after M. F. Hasler in A020639
    a(n) = a020639((n/a020639(n))/a020639(n/a020639(n))) \\ Felix Fröhlich, Jul 15 2019
  • Python
    from sympy import divisors, primefactors
    def a032752(n): return 1 if n==1 else divisors(n)[-2]
    def a020639(n): return 1 if n==1 else primefactors(n)[0]
    def a(n): return a020639(a032752(a032752(n)))
    print([a(n) for n in range(1, 102)]) # Indranil Ghosh, Aug 12 2017
    

Formula

a(n) = A020639(A054576(n)).
If A001222(n) >= 3, a(n) = A027746(n,3), otherwise a(n) = 1. - Peter Munn, Jul 13 2019
Showing 1-6 of 6 results.