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-10 of 16 results. Next

A001358 Semiprimes (or biprimes): products of two primes.

Original entry on oeis.org

4, 6, 9, 10, 14, 15, 21, 22, 25, 26, 33, 34, 35, 38, 39, 46, 49, 51, 55, 57, 58, 62, 65, 69, 74, 77, 82, 85, 86, 87, 91, 93, 94, 95, 106, 111, 115, 118, 119, 121, 122, 123, 129, 133, 134, 141, 142, 143, 145, 146, 155, 158, 159, 161, 166, 169, 177, 178, 183, 185, 187
Offset: 1

Views

Author

Keywords

Comments

Numbers of the form p*q where p and q are primes, not necessarily distinct.
These numbers are sometimes called semiprimes or 2-almost primes.
Numbers n such that Omega(n) = 2 where Omega(n) = A001222(n) is the sum of the exponents in the prime decomposition of n.
Complement of A100959; A064911(a(n)) = 1. - Reinhard Zumkeller, Nov 22 2004
The graph of this sequence appears to be a straight line with slope 4. However, the asymptotic formula shows that the linearity is an illusion and in fact a(n)/n ~ log(n)/log(log(n)) goes to infinity. See also the graph of A066265 = number of semiprimes < 10^n.
For numbers between 33 and 15495, semiprimes are more plentiful than any other k-almost prime. See A125149.
Numbers that are divisible by exactly 2 prime powers (not including 1). - Jason Kimberley, Oct 02 2011
The (disjoint) union of A006881 and A001248. - Jason Kimberley, Nov 11 2015
An equivalent definition of this sequence is a'(n) = smallest composite number which is not divided by any smaller composite number a'(1),...,a'(n-1). - Meir-Simchah Panzer, Jun 22 2016
The above characterization can be simplified to "Composite numbers not divisible by a smaller term." This shows that this is the equivalent of primes computed via Eratosthenes's sieve, but starting with the set of composite numbers (i.e., complement of 1 union primes) instead of all positive integers > 1. It's easy to see that iterating the method (using Eratosthenes's sieve each time on the remaining numbers, complement of the previously computed set) yields numbers with bigomega = k for k = 0, 1, 2, 3, ..., i.e., {1}, A000040, this, A014612, etc. - M. F. Hasler, Apr 24 2019
For all n except n = 2, a(n) is a deficient number. - Amrit Awasthi, Sep 10 2024
It is reasonable to assume that the "comforting numbers" which John T. Williams found in Chapter 3 of Milne's book "The House at Pooh Corner" are these semiprimes. Winnie-the-Pooh wonders whether he has 14 or 15 honey pots and concludes: "It's sort of comforting." To arrange a semiprime number of honey pots in a rectangular way, let's say on a shelf, with the larger divisor parallel to the wall, there is only one solution and this is for a simple mind like Winnie-the-Pooh comforting. - Ruediger Jehn, Dec 12 2024

Examples

			From _Gus Wiseman_, May 27 2021: (Start)
The sequence of terms together with their prime factors begins:
   4 = 2*2     46 = 2*23     91 = 7*13    141 = 3*47
   6 = 2*3     49 = 7*7      93 = 3*31    142 = 2*71
   9 = 3*3     51 = 3*17     94 = 2*47    143 = 11*13
  10 = 2*5     55 = 5*11     95 = 5*19    145 = 5*29
  14 = 2*7     57 = 3*19    106 = 2*53    146 = 2*73
  15 = 3*5     58 = 2*29    111 = 3*37    155 = 5*31
  21 = 3*7     62 = 2*31    115 = 5*23    158 = 2*79
  22 = 2*11    65 = 5*13    118 = 2*59    159 = 3*53
  25 = 5*5     69 = 3*23    119 = 7*17    161 = 7*23
  26 = 2*13    74 = 2*37    121 = 11*11   166 = 2*83
  33 = 3*11    77 = 7*11    122 = 2*61    169 = 13*13
  34 = 2*17    82 = 2*41    123 = 3*41    177 = 3*59
  35 = 5*7     85 = 5*17    129 = 3*43    178 = 2*89
  38 = 2*19    86 = 2*43    133 = 7*19    183 = 3*61
  39 = 3*13    87 = 3*29    134 = 2*67    185 = 5*37
(End)
		

References

  • Archimedeans Problems Drive, Eureka, 17 (1954), 8.
  • Raymond Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; Chapter II, Problem 60.
  • Edmund Landau, Handbuch der Lehre von der Verteilung der Primzahlen, Vol. 1, Teubner, Leipzig; third edition: Chelsea, New York (1974). See p. 211.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • John T. Williams, Pooh and the Philosophers, Dutton Books, 1995.

Crossrefs

Cf. A064911 (characteristic function).
Cf. A048623, A048639, A000040 (primes), A014612 (products of 3 primes), A014613, A014614, A072000 ("pi" for semiprimes), A065516 (first differences).
Sequences listing r-almost primes, that is, the n such that A001222(n) = r: A000040 (r=1), this sequence (r=2), A014612 (r=3), A014613 (r=4), A014614 (r=5), A046306 (r=6), A046308 (r=7), A046310 (r=8), A046312 (r=9), A046314 (r=10), A069272 (r=11), A069273 (r=12), A069274 (r=13), A069275 (r=14), A069276 (r=15), A069277 (r=16), A069278 (r=17), A069279 (r=18), A069280 (r=19), A069281 (r=20).
These are the Heinz numbers of length-2 partitions, counted by A004526.
The squarefree case is A006881 with odd/even terms A046388/A100484 (except 4).
Including primes gives A037143.
The odd/even terms are A046315/A100484.
Partial sums are A062198.
The prime factors are A084126/A084127.
Grouping by greater factor gives A087112.
The product/sum/difference of prime indices is A087794/A176504/A176506.
Positions of even/odd terms are A115392/A289182.
The terms with relatively prime/divisible prime indices are A300912/A318990.
Factorizations using these terms are counted by A320655.
The prime indices are A338898/A338912/A338913.
Grouping by weight (sum of prime indices) gives A338904, with row sums A024697.
The terms with even/odd weight are A338906/A338907.
The terms with odd/even prime indices are A338910/A338911.
The least/greatest term of weight n is A339114/A339115.

Programs

  • Haskell
    a001358 n = a001358_list !! (n-1)
    a001358_list = filter ((== 2) . a001222) [1..]
    
  • Magma
    [n: n in [2..200] | &+[d[2]: d in Factorization(n)] eq 2]; // Bruno Berselli, Sep 09 2015
    
  • Maple
    A001358 := proc(n) option remember; local a; if n = 1 then 4; else for a from procname(n-1)+1 do if numtheory[bigomega](a) = 2 then return a; end if; end do: end if; end proc:
    seq(A001358(n), n=1..120) ; # R. J. Mathar, Aug 12 2010
  • Mathematica
    Select[Range[200], Plus@@Last/@FactorInteger[#] == 2 &] (* Zak Seidov, Jun 14 2005 *)
    Select[Range[200], PrimeOmega[#]==2&] (* Harvey P. Dale, Jul 17 2011 *)
  • PARI
    select( isA001358(n)={bigomega(n)==2}, [1..199]) \\ M. F. Hasler, Apr 09 2008; added select() Apr 24 2019
    
  • PARI
    list(lim)=my(v=List(),t);forprime(p=2, sqrt(lim), t=p;forprime(q=p, lim\t, listput(v,t*q))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Sep 11 2011
    
  • PARI
    A1358=List(4); A001358(n)={while(#A1358M. F. Hasler, Apr 24 2019
    
  • Python
    from sympy import factorint
    def ok(n): return sum(factorint(n).values()) == 2
    print([k for k in range(1, 190) if ok(k)]) # Michael S. Branicky, Apr 30 2022
    
  • Python
    from math import isqrt
    from sympy import primepi, prime
    def A001358(n):
        def f(x): return int(n+x-sum(primepi(x//prime(k))-k+1 for k in range(1, primepi(isqrt(x))+1)))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return m # Chai Wah Wu, Jul 23 2024

Formula

a(n) ~ n*log(n)/log(log(n)) as n -> infinity [Landau, p. 211], [Ayoub].
Recurrence: a(1) = 4; for n > 1, a(n) = smallest composite number which is not a multiple of any of the previous terms. - Amarnath Murthy, Nov 10 2002
A174956(a(n)) = n. - Reinhard Zumkeller, Apr 03 2010
a(n) = A088707(n) - 1. - Reinhard Zumkeller, Feb 20 2012
Sum_{n>=1} 1/a(n)^s = (1/2)*(P(s)^2 + P(2*s)), where P is the prime zeta function. - Enrique Pérez Herrero, Jun 24 2012
sigma(a(n)) + phi(a(n)) - mu(a(n)) = 2*a(n) + 1. mu(a(n)) = ceiling(sqrt(a(n))) - floor(sqrt(a(n))). - Wesley Ivan Hurt, May 21 2013
mu(a(n)) = -Omega(a(n)) + omega(a(n)) + 1, where mu is the Moebius function (A008683), Omega is the count of prime factors with repetition, and omega is the count of distinct prime factors. - Alonso del Arte, May 09 2014
a(n) = A078840(2,n). - R. J. Mathar, Jan 30 2019
A100484 UNION A046315. - R. J. Mathar, Apr 19 2023
Conjecture: a(n)/n ~ (log(n)/log(log(n)))*(1-(M/log(log(n)))) as n -> oo, where M is the Mertens's constant (A077761). - Alain Rocchelli, Feb 02 2025

Extensions

More terms from James Sellers, Aug 22 2000

A020639 Lpf(n): least prime dividing n (when n > 1); a(1) = 1. Or, smallest prime factor of n, or smallest prime divisor of n.

Original entry on oeis.org

1, 2, 3, 2, 5, 2, 7, 2, 3, 2, 11, 2, 13, 2, 3, 2, 17, 2, 19, 2, 3, 2, 23, 2, 5, 2, 3, 2, 29, 2, 31, 2, 3, 2, 5, 2, 37, 2, 3, 2, 41, 2, 43, 2, 3, 2, 47, 2, 7, 2, 3, 2, 53, 2, 5, 2, 3, 2, 59, 2, 61, 2, 3, 2, 5, 2, 67, 2, 3, 2, 71, 2, 73, 2, 3, 2, 7, 2, 79, 2, 3, 2, 83, 2, 5, 2, 3, 2, 89, 2, 7, 2, 3, 2, 5, 2, 97
Offset: 1

Views

Author

Keywords

Comments

Also, the largest number of distinct integers such that all their pairwise differences are coprime to n. - Max Alekseyev, Mar 17 2006
The unit 1 is not a prime number (although it has been considered so in the past). 1 is the empty product of prime numbers, thus 1 has no least prime factor. - Daniel Forgues, Jul 05 2011
a(n) = least m > 0 for which n! + m and n - m are not relatively prime. - Clark Kimberling, Jul 21 2012
For n > 1, a(n) = the smallest k > 1 that divides n. - Antti Karttunen, Feb 01 2014
For n > 1, records are at prime indices. - Zak Seidov, Apr 29 2015
The initials "lpf" might be mistaken for "largest prime factor" (A009190), using "spf" for "smallest prime factor" would avoid this. - M. F. Hasler, Jul 29 2015
n = 89 is the first index > 1 for which a(n) differs from the smallest k > 1 such that (2^k + n - 2)/k is an integer. - M. F. Hasler, Aug 11 2015
From Stanislav Sykora, Jul 29 2017: (Start)
For n > 1, a(n) is also the smallest k, 1 < k <= n, for which the binomial(n,k) is not divisible by n.
Proof: (A) When k and n are relatively prime then binomial(n,k) is divisible by n because k*binomial(n,k) = n*binomial(n-1,k-1). (B) When gcd(n,k) > 1, one of its prime factors is the smallest; let us denote it p, p <= k, and consider the binomial(n,p) = (1/p!)*Product_{i=0..p-1} (n-i). Since p is a divisor of n, it cannot be a divisor of any of the remaining numerator factors. It follows that, denoting as e the largest e > 0 such that p^e|n, the numerator is divisible by p^e but not by p^(e+1). Hence, the binomial is divisible by p^(e-1) but not by p^e and therefore not divisible by n. Applying (A), (B) to all considered values of k completes the proof. (End)
From Bob Selcoe, Oct 11 2017, edited by M. F. Hasler, Nov 06 2017: (Start)
a(n) = prime(j) when n == J (mod A002110(j)), n, j >= 1, where J is the set of numbers <= A002110(j) with smallest prime factor = prime(j). The number of terms in J is A005867(j-1). So:
a(n) = 2 when n == 0 (mod 2);
a(n) = 3 when n == 3 (mod 6);
a(n) = 5 when n == 5 or 25 (mod 30);
a(n) = 7 when n == 7, 49, 77, 91, 119, 133, 161 or 203 (mod 210);
etc. (End)
For n > 1, a(n) is the leftmost term, other than 0 or 1, in the n-th row of A127093. - Davis Smith, Mar 05 2019

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section IV.1.

Crossrefs

Cf. A090368 (bisection).
Cf. A046669 (partial sums), A072486 (partial products).
Cf. A127093.

Programs

  • Haskell
    a020639 n = spf a000040_list where
      spf (p:ps) | n < p^2      = n
                 | mod n p == 0 = p
                 | otherwise    = spf ps
    -- Reinhard Zumkeller, Jul 13 2011
    
  • Maple
    A020639 := proc(n) if n = 1 then 1; else min(op(numtheory[factorset](n))) ; end if; end proc: seq(A020639(n),n=1..20) ; # R. J. Mathar, Oct 25 2010
  • Mathematica
    f[n_]:=FactorInteger[n][[1,1]]; Join[{1}, Array[f,120,2]]  (* Robert G. Wilson v, Apr 06 2011 *)
    Join[{1}, Table[If[EvenQ[n], 2, FactorInteger[n][[1,1]]], {n, 2, 120}]] (* Zak Seidov, Nov 17 2013 *)
    Riffle[Join[{1},Table[FactorInteger[n][[1,1]],{n,3,101,2}]],2] (* Harvey P. Dale, Dec 16 2021 *)
  • PARI
    A020639(n) = { vecmin(factor(n)[,1]) } \\ [Will yield an error for n = 1.] - R. J. Mathar, Mar 02 2012
    
  • PARI
    A020639(n)=if(n>1, if(n>n=factor(n,0)[1,1], n, factor(n)[1,1]), 1) \\ Avoids complete factorization if possible. Often the smallest prime factor can be found quickly even if it is larger than primelimit. If factoring takes too long for large n, use debugging level >= 3 (\g3) to display the smallest factor as soon as it is found. - M. F. Hasler, Jul 29 2015
    
  • Python
    from sympy import factorint
    def a(n): return 1 if n == 1 else min(factorint(n))
    print([a(n) for n in range(1, 98)]) # Michael S. Branicky, Dec 09 2021
  • Sage
    def A020639_list(n) : return [1] + [prime_divisors(n)[0] for n in (2..n)]
    A020639_list(97) # Peter Luschny, Jul 16 2012
    
  • Sage
    [trial_division(n) for n in (1..100)] # Giuseppe Coppoletta, May 25 2016
    
  • Scheme
    (define (A020639 n) (if (< n 2) n (let loop ((k 2)) (cond ((zero? (modulo n k)) k) (else (loop (+ 1 k))))))) ;; Antti Karttunen, Feb 01 2014
    

Formula

A014673(n) = a(A032742(n)); A115561(n) = a(A054576(n)). - Reinhard Zumkeller, Mar 10 2006
A028233(n) = a(n)^A067029(n). - Reinhard Zumkeller, May 13 2006
a(n) = A027746(n,1) = A027748(n,1). - Reinhard Zumkeller, Aug 27 2011
For n > 1: a(n) = A240694(n,2). - Reinhard Zumkeller, Apr 10 2014
a(n) = A000040(A055396(n)) = n / A032742(n). - Antti Karttunen, Mar 07 2017
a(n) has average order n/(2 log n) [Brouwer] - N. J. A. Sloane, Sep 03 2017

Extensions

Deleted wrong comment from M. Lagneau in 2012, following an observation by Gionata Neri. - M. F. Hasler, Aug 11 2015
Edited by M. F. Hasler, Nov 06 2017
Expanded definition to make this easier to find. - N. J. A. Sloane, Sep 21 2020

A027746 Irregular triangle in which first row is 1, n-th row (n>1) gives prime factors of n with repetition.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

n-th row has length A001222(n) (n>1).

Examples

			Triangle begins
  1;
  2;
  3;
  2, 2;
  5;
  2, 3;
  7;
  2, 2, 2;
  3, 3;
  2, 5;
  11;
  2, 2, 3;
  ...
		

Crossrefs

a(A022559(A000040(n))+1) = A000040(n).
Column 1 is A020639, columns 2 and 3 correspond to A014673 and A115561.
A281890 measures frequency of each prime in each column, with A281889 giving median values.
Cf. A175943 (partial products), A265110 (partial row products), A265111.

Programs

  • Haskell
    import Data.List (unfoldr)
    a027746 n k = a027746_tabl !! (n-1) !! (k-1)
    a027746_tabl = map a027746_row [1..]
    a027746_row 1 = [1]
    a027746_row n = unfoldr fact n where
       fact 1 = Nothing
       fact x = Just (p, x `div` p) where p = a020639 x
    -- Reinhard Zumkeller, Aug 27 2011
    
  • Maple
    P:=proc(n) local FM: FM:=ifactors(n)[2]: seq(seq(FM[j][1],k=1..FM[j][2]),j=1..nops(FM)) end: 1; for n from 2 to 45 do P(n) od; # yields sequence in triangular form; Emeric Deutsch, Feb 13 2005
  • Mathematica
    row[n_] := Flatten[ Table[#[[1]], {#[[2]]}] & /@ FactorInteger[n]]; Flatten[ Table[ row[n], {n, 1, 45}]] (* Jean-François Alcover, Dec 01 2011 *)
  • PARI
    A027746_row(n,o=[1])=if(n>1,concat(apply(t->vector(t[2],i,t[1]), Vec(factor(n)~))),o) \\ Use %(n,[]) if you want the more natural [] for the first row. - M. F. Hasler, Jul 29 2015
    
  • Python
    def factors(n: int) -> list[int]:
        p = n
        L:list[int] = []
        for f in range(2, p + 1):
            if f * f > p: break
            while True:
                q, r = divmod(p, f)
                if r != 0: break
                L.append(f)
                p = q
                if p == 1: return L
        L.append(p)
        return L  # Peter Luschny, Jul 18 2024
  • Sage
    v=[1]
    for k in [2..45]: v.extend(p for (p, m) in factor(k) for _ in range(m))
    print(v) # Giuseppe Coppoletta, Dec 29 2017
    

Formula

Product_{k=1..A001222(n)} T(n,k) = n.
From Reinhard Zumkeller, Aug 27 2011: (Start)
A001414(n) = Sum_{k=1..A001222(n)} T(n,k), n>1;
A006530(n) = T(n,A001222(n)) = Max_{k=1..A001222(n)} T(n,k);
A020639(n) = T(n,1) = Min_{k=1..A001222(n)} T(n,k). (End)

Extensions

More terms from James Sellers

A084127 Prime factor >= other prime factor of n-th semiprime.

Original entry on oeis.org

2, 3, 3, 5, 7, 5, 7, 11, 5, 13, 11, 17, 7, 19, 13, 23, 7, 17, 11, 19, 29, 31, 13, 23, 37, 11, 41, 17, 43, 29, 13, 31, 47, 19, 53, 37, 23, 59, 17, 11, 61, 41, 43, 19, 67, 47, 71, 13, 29, 73, 31, 79, 53, 23, 83, 13, 59, 89, 61, 37, 17, 97, 67, 101, 29, 41, 103, 19, 71, 107, 43, 31
Offset: 1

Views

Author

Reinhard Zumkeller, May 15 2003

Keywords

Comments

Largest nontrivial divisor of n-th semiprime. [Juri-Stepan Gerasimov, Apr 18 2010]
Greater of the prime factors of A001358(n). - Jianing Song, Aug 05 2022

Crossrefs

Cf. A001358 (the semiprimes), A084126 (lesser of the prime factors of the semiprimes).

Programs

  • Haskell
    a084127 = a006530 . a001358  -- Reinhard Zumkeller, Nov 25 2012
    
  • Mathematica
    FactorInteger[#][[-1, 1]]& /@ Select[Range[1000], PrimeOmega[#] == 2&] (* Jean-François Alcover, Nov 17 2021 *)
  • PARI
    lista(nn) = {for (n=2, nn, if (bigomega(n)==2, f = factor(n); print1(f[length(f~),1], ", ")););} \\ Michel Marcus, Jun 05 2013
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange, primefactors
    def A084127(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n+x+((t:=primepi(s:=isqrt(x)))*(t-1)>>1)-sum(primepi(x//p) for p in primerange(s+1)))
        return max(primefactors(bisection(f,n,n))) # Chai Wah Wu, Oct 23 2024

Formula

a(n) = A006530(A001358(n)).
a(n) = A001358(n)/A020639(A001358(n)). [corrected by Michel Marcus, Jul 18 2020]
a(n) = A001358(n)/A084126(n).

Extensions

Corrected by T. D. Noe, Nov 15 2006

A119288 a(n) is the second smallest prime factor of n, or 1 if n is a prime power.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, May 13 2006

Keywords

Comments

Least prime factor of {n divided by the maximal power of the least prime factor of n}. - after the original name of the sequence.
a(n) = A020639(A028234(n)).
a(n) = 1 iff n is a prime power: a(A000961(n))=1 and a(A024619(n))>1.

Crossrefs

Programs

  • Mathematica
    Join[{1},Table[Which[PrimePowerQ[n],1,True,FactorInteger[n][[2,1]]],{n,2,100}]] (* Harvey P. Dale, Feb 08 2020 *)
  • PARI
    a(n) = if (isprimepower(n) || (n==1), 1, my(f=factor(n)[,1]); f[2]); \\ Michel Marcus, Mar 01 2023
    
  • Python
    from sympy import primefactors
    def A119288(n): return 1 if len(s:=primefactors(n)) <= 1 else sorted(s)[1] # Chai Wah Wu, Mar 31 2023

Formula

A010055(n) = 0^(a(n)-1). - Reinhard Zumkeller, May 13 2006

Extensions

Name changed by Antti Karttunen, Oct 04 2017

A085392 a(n) = largest prime divisor of n, or 1 if n is 1 or a prime.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a085392 = a006530 . a032742  -- Reinhard Zumkeller, Oct 03 2012
    
  • Maple
    A085392 := proc(n) max( op(numtheory[divisors](n) minus {n})) ; A006530(%) ;
    end proc:
    seq(A085392(n),n=1..50) ; # R. J. Mathar, Jun 26 2011
  • 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}]
    Join[{1},Table[FactorInteger[Divisors[n][[-2]]][[-1,1]],{n,2,120}]] (* Harvey P. Dale, Jul 02 2019 *)
    a[n_] := If[CompositeQ[n], FactorInteger[n][[-1, 1]], 1]; Array[a, 100] (* Amiram Eldar, Jun 19 2022 *)
  • PARI
    gpd(n) = if (n==1, 1, n/factor(n)[1,1]);
    gpf(n) = if (n==1, 1, vecmax(factor(n)[,1]));
    a(n) = gpf(gpd(n)); \\ Michel Marcus, Apr 08 2018

Formula

a(n) = A006530(A032742(n)). - R. J. Mathar, Jun 26 2011

Extensions

Definition corrected by N. J. A. Sloane, Jul 02 2019. Also deleted an incorrect comment.

A281889 a(n) is the least integer k such that more than half of all integers are divisible by a product of n integers chosen from 2..k.

Original entry on oeis.org

3, 7, 433, 9257821
Offset: 1

Views

Author

Peter Munn, Feb 01 2017

Keywords

Comments

The n chosen integers need not be distinct.
By "more than half of all integers" we mean more precisely "more than half of the integers in -m..m, for all sufficiently large m (depending on n)", and similarly with 1..m for "more than half of all positive integers".
Equivalently, a(n) is the least prime p such that more than half of all positive integers can be written as a product of primes of which n or more are not greater than p. (In this sense, a(n) might be called the median n-th least prime factor of the integers.)
The number of integers that satisfy the "product of primes" criterion for p = prime(m) is the same in every interval of primorial(m)^n integers and is A281891(m,n). Primorial(m) = A002110(m), product of the first m primes.
a(n) is the least k = prime(m) such that 2 * A281891(m,n) > A002110(m)^n.
a(n) is the least k such that more than half of all positive integers equate to the volume of an orthotope with integral sides at least n of which are orthogonal with length between 2 and k inclusive.
The next term is estimated to be a(5) ~ 3*10^18.

Examples

			For n=1, we have a(1) = 3 since for all m > 1, more than half of the integers in -m..m are divisible by an integer chosen from 2..3, i.e., either 2 or 3. We must have a(1) > 2, because the only integer in 2..2 is 2, but in each interval -2m-1..2m+1, only 2m+1 integers are even, so 2 is not a divisor of more than half of all integers in the precise sense given above.
		

Crossrefs

Other sequences about medians of prime factors: A126282, A126283, A284411, A290154.

A281890 Square array A(n,k): number of integers having prime(n) as k-th factor when written as product of primes in nondecreasing order, in any interval of primorial(n)^k positive integers.

Original entry on oeis.org

1, 1, 1, 1, 5, 2, 1, 19, 62, 8, 1, 65, 1322, 1976, 48, 1, 211, 24182, 318392, 140496, 480, 1, 665, 408842, 42729464, 260656752, 19373280, 5760, 1, 2059, 6609302, 5208402488, 395975417424, 485262187680, 4125121920, 92160, 1, 6305, 103999562, 600582229496
Offset: 1

Views

Author

Peter Munn, Feb 08 2017

Keywords

Comments

Square array read by descending antidiagonals: A(n,k) with rows n >= 1, columns k >= 1. Primorial(n) = A002110(n): product of first n primes.
Visualize the prime factorizations of the positive integers as a table with row headings giving each successive integer, and the primes of which the row heading is the product listed across the columns in nondecreasing order, repeated when necessary. Except for 1, which lacks prime factors, column 1 has the row heading's least prime factor, column 2 has a value for composite numbers but is blank for primes, and so on. This sequence measures precisely how frequently the various primes occur in each column. This is possible because any given prime occurs cyclically in any given column, for the reason following.
The occurrence pattern of up to k factors of prime(n) in such prime factorizations has a fundamental period over the positive integers of prime(n)^k. The least common period for up to k factors of each of the first n primes is Primorial(n)^k, and this covers everything that can affect the occurrence of prime(n) in the least k factors. Thus prime(n) is k-th least prime factor of integer m if and only if it is k-th least prime factor of m+Primorial(n)^k.
Intermediate values in the calculation of this sequence appear in A281891.
A(n,1) = A005867(n-1) in accordance with the comment on A005867 dated Jul 16 2006.
A(2,k) = A001047(k) = 3^k - 2^k.

Examples

			Prime(2)=3 occurs as second least factor five times in the prime factorizations of every interval of 36=Primorial(2)^2 positive integers. See A014673. So A(2,2) = 5.
		

Crossrefs

A079474 re-read as a square array gives values of primorial(n)^k = A002110(n)^k.
The values in the body of the factorization table described in the author's comments are in the irregular array A027746.

Formula

A(n,k) = primorial(n-1) * A281891(n,k-1) - prime(n)^(k-1) * A281891(n-1,k).

A117358 a(n) = A032742(A032742(A032742(n))) = ((n/lpf(n))/lpf(n/lpf(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, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 3, 1, 7, 1, 1, 1, 5, 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 10, 3, 1, 1, 7, 1, 1, 1, 11, 1, 5, 1, 1, 1, 1, 1, 12, 1, 1, 1, 5, 1, 1, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 10 2006

Keywords

Crossrefs

Programs

Formula

a(n) = A032742(A032742(A032742(n))) = A032742(A054576(n)) = A054576(n)/A115561(n).
a(A037144(n)) = 1, a(A033987(n)) > 1.

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-10 of 16 results. Next