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 40 results. Next

A005117 Squarefree numbers: numbers that are not divisible by a square greater than 1.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 21, 22, 23, 26, 29, 30, 31, 33, 34, 35, 37, 38, 39, 41, 42, 43, 46, 47, 51, 53, 55, 57, 58, 59, 61, 62, 65, 66, 67, 69, 70, 71, 73, 74, 77, 78, 79, 82, 83, 85, 86, 87, 89, 91, 93, 94, 95, 97, 101, 102, 103, 105, 106, 107, 109, 110, 111, 113
Offset: 1

Views

Author

Keywords

Comments

1 together with the numbers that are products of distinct primes.
Also smallest sequence with the property that a(m)*a(k) is never a square for k != m. - Ulrich Schimke (ulrschimke(AT)aol.com), Dec 12 2001
Numbers k such that there is only one Abelian group with k elements, the cyclic group of order k (the numbers such that A000688(k) = 1). - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 25 2001
Numbers k such that A007913(k) > phi(k). - Benoit Cloitre, Apr 10 2002
a(n) is the smallest m with exactly n squarefree numbers <= m. - Amarnath Murthy, May 21 2002
k is squarefree <=> k divides prime(k)# where prime(k)# = product of first k prime numbers. - Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Mar 30 2004
Numbers k such that omega(k) = Omega(k) = A072047(k). - Lekraj Beedassy, Jul 11 2006
The LCM of any finite subset is in this sequence. - Lekraj Beedassy, Jul 11 2006
This sequence and the Beatty Pi^2/6 sequence (A059535) are "incestuous": the first 20000 terms are bounded within (-9, 14). - Ed Pegg Jr, Jul 22 2008
Let us introduce a function D(n) = sigma_0(n)/2^(alpha(1) + ... + alpha(r)), sigma_0(n) number of divisors of n (A000005), prime factorization of n = p(1)^alpha(1) * ... * p(r)^alpha(r), alpha(1) + ... + alpha(r) is sequence (A001222). Function D(n) splits the set of positive integers into subsets, according to the value of D(n). Squarefree numbers (A005117) has D(n)=1, other numbers are "deviated" from the squarefree ideal and have 0 < D(n) < 1. For D(n)=1/2 we have A048109, for D(n)=3/4 we have A060687. - Ctibor O. Zizka, Sep 21 2008
Numbers k such that gcd(k,k')=1 where k' is the arithmetic derivative (A003415) of k. - Giorgio Balzarotti, Apr 23 2011
Numbers k such that A007913(k) = core(k) = k. - Franz Vrabec, Aug 27 2011
Numbers k such that sqrt(k) cannot be simplified. - Sean Loughran, Sep 04 2011
Indices m where A057918(m)=0, i.e., positive integers m for which there are no integers k in {1,2,...,m-1} such that k*m is a square. - John W. Layman, Sep 08 2011
It appears that these are numbers j such that Product_{k=1..j} (prime(k) mod j) = 0 (see Maple code). - Gary Detlefs, Dec 07 2011. - This is the same claim as Mohammed Bouayoun's Mar 30 2004 comment above. To see why it holds: Primorial numbers, A002110, a subsequence of this sequence, are never divisible by any nonsquarefree number, A013929, and on the other hand, the index of the greatest prime dividing any n is less than n. Cf. A243291. - Antti Karttunen, Jun 03 2014
Conjecture: For each n=2,3,... there are infinitely many integers b > a(n) such that Sum_{k=1..n} a(k)*b^(k-1) is prime, and the smallest such an integer b does not exceed (n+3)*(n+4). - Zhi-Wei Sun, Mar 26 2013
The probability that a random natural number belongs to the sequence is 6/Pi^2, A059956 (see Cesàro reference). - Giorgio Balzarotti, Nov 21 2013
Booker, Hiary, & Keating give a subexponential algorithm for testing membership in this sequence without factoring. - Charles R Greathouse IV, Jan 29 2014
Because in the factorizations into prime numbers these a(n) (n >= 2) have exponents which are either 0 or 1 one could call the a(n) 'numbers with a fermionic prime number decomposition'. The levels are the prime numbers prime(j), j >= 1, and the occupation numbers (exponents) e(j) are 0 or 1 (like in Pauli's exclusion principle). A 'fermionic state' is then denoted by a sequence with entries 0 or 1, where, except for the zero sequence, trailing zeros are omitted. The zero sequence stands for a(1) = 1. For example a(5) = 6 = 2^1*3^1 is denoted by the 'fermionic state' [1, 1], a(7) = 10 by [1, 0, 1]. Compare with 'fermionic partitions' counted in A000009. - Wolfdieter Lang, May 14 2014
From Vladimir Shevelev, Nov 20 2014: (Start)
The following is an Eratosthenes-type sieve for squarefree numbers. For integers > 1:
1) Remove even numbers, except for 2; the minimal non-removed number is 3.
2) Replace multiples of 3 removed in step 1, and remove multiples of 3 except for 3 itself; the minimal non-removed number is 5.
3) Replace multiples of 5 removed as a result of steps 1 and 2, and remove multiples of 5 except for 5 itself; the minimal non-removed number is 6.
4) Replace multiples of 6 removed as a result of steps 1, 2 and 3 and remove multiples of 6 except for 6 itself; the minimal non-removed number is 7.
5) Repeat using the last minimal non-removed number to sieve from the recovered multiples of previous steps.
Proof. We use induction. Suppose that as a result of the algorithm, we have found all squarefree numbers less than n and no other numbers. If n is squarefree, then the number of its proper divisors d > 1 is even (it is 2^k - 2, where k is the number of its prime divisors), and, by the algorithm, it remains in the sequence. Otherwise, n is removed, since the number of its squarefree divisors > 1 is odd (it is 2^k-1).
(End)
The lexicographically least sequence of integers > 1 such that each entry has an even number of proper divisors occurring in the sequence (that's the sieve restated). - Glen Whitney, Aug 30 2015
0 is nonsquarefree because it is divisible by any square. - Jon Perry, Nov 22 2014, edited by M. F. Hasler, Aug 13 2015
The Heinz numbers of partitions with distinct parts. We define the Heinz number of a partition p = [p_1, p_2, ..., p_r] as Product_{j=1..r} prime(j) (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). For example, for the partition [1, 1, 2, 4, 10] the Heinz number is 2*2*3*7*29 = 2436. The number 30 (= 2*3*5) is in the sequence because it is the Heinz number of the partition [1,2,3]. - Emeric Deutsch, May 21 2015
It is possible for 2 consecutive terms to be even; for example a(258)=422 and a(259)=426. - Thomas Ordowski, Jul 21 2015. [These form a subsequence of A077395 since their product is divisible by 4. - M. F. Hasler, Aug 13 2015]
There are never more than 3 consecutive terms. Runs of 3 terms start at 1, 5, 13, 21, 29, 33, ... (A007675). - Ivan Neretin, Nov 07 2015
a(n) = product of row n in A265668. - Reinhard Zumkeller, Dec 13 2015
Numbers without excess, i.e., numbers k such that A001221(k) = A001222(k). - Juri-Stepan Gerasimov, Sep 05 2016
Numbers k such that b^(phi(k)+1) == b (mod k) for every integer b. - Thomas Ordowski, Oct 09 2016
Boreico shows that the set of square roots of the terms of this sequence is linearly independent over the rationals. - Jason Kimberley, Nov 25 2016 (reference found by Michael Coons).
Numbers k such that A008836(k) = A008683(k). - Enrique Pérez Herrero, Apr 04 2018
The prime zeta function P(s) "has singular points along the real axis for s=1/k where k runs through all positive integers without a square factor". See Wolfram link. - Maleval Francis, Jun 23 2018
Numbers k such that A007947(k) = k. - Kyle Wyonch, Jan 15 2021
The Schnirelmann density of the squarefree numbers is 53/88 (Rogers, 1964). - Amiram Eldar, Mar 12 2021
Comment from Isaac Saffold, Dec 21 2021: (Start)
Numbers k such that all groups of order k have a trivial Frattini subgroup [Dummit and Foote].
Let the group G have order n. If n is squarefree and n > 1, then G is solvable, and thus by Hall's Theorem contains a subgroup H_p of index p for all p | n. Each H_p is maximal in G by order considerations, and the intersection of all the H_p's is trivial. Thus G's Frattini subgroup Phi(G), being the intersection of G's maximal subgroups, must be trivial. If n is not squarefree, the cyclic group of order n has a nontrivial Frattini subgroup. (End)
Numbers for which the squarefree divisors (A206778) and the unitary divisors (A077610) are the same; moreover they are also the set of divisors (A027750). - Bernard Schott, Nov 04 2022
0 = A008683(a(n)) - A008836(a(n)) = A001615(a(n)) - A000203(a(n)). - Torlach Rush, Feb 08 2023
From Robert D. Rosales, May 20 2024: (Start)
Numbers n such that mu(n) != 0, where mu(n) is the Möbius function (A008683).
Solutions to the equation Sum_{d|n} mu(d)*sigma(d) = mu(n)*n, where sigma(n) is the sum of divisors function (A000203). (End)
a(n) is the smallest root of x = 1 + Sum_{k=1..n-1} floor(sqrt(x/a(k))) greater than a(n-1). - Yifan Xie, Jul 10 2024
Number k such that A001414(k) = A008472(k). - Torlach Rush, Apr 14 2025
To elaborate on the formula from Greathouse (2018), the maximum of a(n) - floor(n*Pi^2/6 + sqrt(n)/17) is 10 at indices n = 48715, 48716, 48721, and 48760. The maximum is 11, at the same indices, if floor is taken individually for the two addends and the square root. If the value is rounded instead, the maximum is 9 at 10 indices between 48714 and 48765. - M. F. Hasler, Aug 08 2025

References

  • Jean-Marie De Koninck, Ces nombres qui nous fascinent, Entry 165, p. 53, Ellipses, Paris, 2008.
  • David S. Dummit and Richard M. Foote, Abstract algebra. Vol. 1999. Englewood Cliffs, NJ: David S.Prentice Hall, 1991.
  • Ivan M. Niven and Herbert S. Zuckerman, An Introduction to the Theory of Numbers. 2nd ed., Wiley, NY, 1966, p. 251.
  • Michael Pohst and Hans J. Zassenhaus, Algorithmic Algebraic Number Theory, Cambridge Univ. Press, page 432.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Complement of A013929. Subsequence of A072774 and A209061.
Characteristic function: A008966 (mu(n)^2, where mu = A008683).
Subsequences: A000040, A002110, A235488.
Subsequences: numbers j such that j*a(k) is squarefree where k > 1: A056911 (k = 2), A261034 (k = 3), A274546 (k = 5), A276378 (k = 6).

Programs

  • Haskell
    a005117 n = a005117_list !! (n-1)
    a005117_list = filter ((== 1) . a008966) [1..]
    -- Reinhard Zumkeller, Aug 15 2011, May 10 2011
    
  • Magma
    [ n : n in [1..1000] | IsSquarefree(n) ];
    
  • Maple
    with(numtheory); a := [ ]; for n from 1 to 200 do if issqrfree(n) then a := [ op(a), n ]; fi; od:
    t:= n-> product(ithprime(k),k=1..n): for n from 1 to 113 do if(t(n) mod n = 0) then print(n) fi od; # Gary Detlefs, Dec 07 2011
    A005117 := proc(n) option remember; if n = 1 then 1; else for a from procname(n-1)+1 do if numtheory[issqrfree](a) then return a; end if; end do: end if; end proc:  # R. J. Mathar, Jan 09 2013
  • Mathematica
    Select[ Range[ 113], SquareFreeQ] (* Robert G. Wilson v, Jan 31 2005 *)
    Select[Range[150], Max[Last /@ FactorInteger[ # ]] < 2 &] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 26 2006 *)
    NextSquareFree[n_, k_: 1] := Block[{c = 0, sgn = Sign[k]}, sf = n + sgn; While[c < Abs[k], While[ ! SquareFreeQ@ sf, If[sgn < 0, sf--, sf++]]; If[ sgn < 0, sf--, sf++]; c++]; sf + If[ sgn < 0, 1, -1]]; NestList[ NextSquareFree, 1, 70] (* Robert G. Wilson v, Apr 18 2014 *)
    Select[Range[250], MoebiusMu[#] != 0 &] (* Robert D. Rosales, May 20 2024 *)
  • PARI
    bnd = 1000; L = vector(bnd); j = 1; for (i=1,bnd, if(issquarefree(i),L[j]=i; j=j+1)); L
    
  • PARI
    {a(n)= local(m,c); if(n<=1,n==1, c=1; m=1; while( cMichael Somos, Apr 29 2005 */
    
  • PARI
    list(n)=my(v=vectorsmall(n,i,1),u,j); forprime(p=2,sqrtint(n), forstep(i=p^2, n, p^2, v[i]=0)); u=vector(sum(i=1,n,v[i])); for(i=1,n,if(v[i],u[j++]=i)); u \\ Charles R Greathouse IV, Jun 08 2012
    
  • PARI
    for(n=1, 113, if(core(n)==n, print1(n, ", "))); \\ Arkadiusz Wesolowski, Aug 02 2016
    
  • PARI
    S(n) = my(s); forsquarefree(k=1,sqrtint(n),s+=n\k[1]^2*moebius(k)); s;
    a(n) = my(min=1, max=231, k=0, sc=0); if(n >= 144, min=floor(zeta(2)*n - 5*sqrt(n)); max=ceil(zeta(2)*n + 5*sqrt(n))); while(min <= max, k=(min+max)\2; sc=S(k); if(abs(sc-n) <= sqrtint(n), break); if(sc > n, max=k-1, if(sc < n, min=k+1, break))); while(!issquarefree(k), k-=1); while(sc != n, my(j=1); if(sc > n, j = -1); k += j; sc += j; while(!issquarefree(k), k += j)); k; \\ Daniel Suteu, Jul 07 2022
    
  • PARI
    first(n)=my(v=vector(n),i); forsquarefree(k=1,if(n<268293,(33*n+30)\20,(n*Pi^2/6+0.058377*sqrt(n))\1), if(i++>n, return(v)); v[i]=k[1]); v \\ Charles R Greathouse IV, Jan 10 2023
    
  • PARI
    A5117=[1..3]; A005117(n)={if(n>#A5117, my(N=#A5117); A5117=Vec(A5117, max(n+999, N*5\4)); iferr(forsquarefree(k=A5117[N]+1, #A5117*Pi^2\6+sqrtint(#A5117)\17+11, A5117[N++]=k[1]),E,)); A5117[n]} \\ M. F. Hasler, Aug 08 2025
    
  • Python
    from sympy.ntheory.factor_ import core
    def ok(n): return core(n, 2) == n
    print(list(filter(ok, range(1, 114)))) # Michael S. Branicky, Jul 31 2021
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A005117_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:all(x == 1 for x in factorint(n).values()),count(max(startvalue,1)))
    A005117_list = list(islice(A005117_gen(),20)) # Chai Wah Wu, May 09 2022
    
  • Python
    from math import isqrt
    from sympy import mobius
    def A005117(n):
        def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return m # Chai Wah Wu, Jul 22 2024

Formula

Limit_{n->oo} a(n)/n = Pi^2/6 (see A013661). - Benoit Cloitre, May 23 2002
Equals A039956 UNION A056911. - R. J. Mathar, May 16 2008
A122840(a(n)) <= 1; A010888(a(n)) < 9. - Reinhard Zumkeller, Mar 30 2010
a(n) = A055229(A062838(n)) and a(n) > A055229(m) for m < A062838(n). - Reinhard Zumkeller, Apr 09 2010
A008477(a(n)) = 1. - Reinhard Zumkeller, Feb 17 2012
A055653(a(n)) = a(n); A055654(a(n)) = 0. - Reinhard Zumkeller, Mar 11 2012
A008966(a(n)) = 1. - Reinhard Zumkeller, May 26 2012
Sum_{n>=1} 1/a(n)^s = zeta(s)/zeta(2*s). - Enrique Pérez Herrero, Jul 07 2012
A056170(a(n)) = 0. - Reinhard Zumkeller, Dec 29 2012
A013928(a(n)+1) = n. - Antti Karttunen, Jun 03 2014
A046660(a(n)) = 0. - Reinhard Zumkeller, Nov 29 2015
Equals {1} UNION A000040 UNION A006881 UNION A007304 UNION A046386 UNION A046387 UNION A067885 UNION A123321 UNION A123322 UNION A115343 ... - R. J. Mathar, Nov 05 2016
|a(n) - n*Pi^2/6| < 0.058377*sqrt(n) for n >= 268293; this result can be derived from Cohen, Dress, & El Marraki, see links. - Charles R Greathouse IV, Jan 18 2018
From Amiram Eldar, Jul 07 2021: (Start)
Sum_{n>=1} (-1)^(a(n)+1)/a(n)^2 = 9/Pi^2.
Sum_{k=1..n} 1/a(k) ~ (6/Pi^2) * log(n).
Sum_{k=1..n} (-1)^(a(k)+1)/a(k) ~ (2/Pi^2) * log(n).
(all from Scott, 2006) (End)

A006881 Squarefree semiprimes: Numbers that are the product of two distinct primes.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Numbers k such that phi(k) + sigma(k) = 2*(k+1). - Benoit Cloitre, Mar 02 2002
Numbers k such that tau(k) = omega(k)^omega(k). - Benoit Cloitre, Sep 10 2002 [This comment is false. If k = 900 then tau(k) = omega(k)^omega(k) = 27 but 900 = (2*3*5)^2 is not the product of two distinct primes. - Peter Luschny, Jul 12 2023]
Could also be called 2-almost primes. - Rick L. Shepherd, May 11 2003
From the Goldston et al. reference's abstract: "lim inf [as n approaches infinity] [(a(n+1) - a(n))] <= 26. If an appropriate generalization of the Elliott-Halberstam Conjecture is true, then the above bound can be improved to 6." - Jonathan Vos Post, Jun 20 2005
The maximal number of consecutive integers in this sequence is 3 - there cannot be 4 consecutive integers because one of them would be divisible by 4 and therefore would not be product of distinct primes. There are several examples of 3 consecutive integers in this sequence. The first one is 33 = 3 * 11, 34 = 2 * 17, 35 = 5 * 7; (see A039833). - Matias Saucedo (solomatias(AT)yahoo.com.ar), Mar 15 2008
Number of terms less than or equal to 10^k for k >= 0 is A036351(k). - Robert G. Wilson v, Jun 26 2012
Are these the numbers k whose difference between the sum of proper divisors of k and the arithmetic derivative of k is equal to 1? - Omar E. Pol, Dec 19 2012
Intersection of A001358 and A030513. - Wesley Ivan Hurt, Sep 09 2013
A237114(n) (smallest semiprime k^prime(n)+1) is a term, for n != 2. - Jonathan Sondow, Feb 06 2014
a(n) are the reduced denominators of p_2/p_1 + p_4/p_3, where p_1 != p_2, p_3 != p_4, p_1 != p_3, and the p's are primes. In other words, (p_2*p_3 + p_1*p_4) never shares a common factor with p_1*p_3. - Richard R. Forberg, Mar 04 2015
Conjecture: The sums of two elements of a(n) forms a set that includes all primes greater than or equal to 29 and all integers greater than or equal to 83 (and many below 83). - Richard R. Forberg, Mar 04 2015
The (disjoint) union of this sequence and A001248 is A001358. - Jason Kimberley, Nov 12 2015
A263990 lists the subsequence of a(n) where a(n+1)=1+a(n). - R. J. Mathar, Aug 13 2019

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Zervos, Marie: Sur une classe de nombres composés. Actes du Congrès interbalkanique de mathématiciens 267-268 (1935)

Crossrefs

Products of exactly k distinct primes, for k = 1 to 6: A000040, A006881. A007304, A046386, A046387, A067885.
Cf. A030229, A051709, A001221 (omega(n)), A001222 (bigomega(n)), A001358 (semiprimes), A005117 (squarefree), A007304 (squarefree 3-almost primes), A213952, A039833, A016105 (subsequences), A237114 (subsequence, n != 2).
Subsequence of A007422.
Cf. A259758 (subsequence), A036351, A363923.

Programs

  • Haskell
    a006881 n = a006881_list !! (n-1)
    a006881_list = filter chi [1..] where
       chi n = p /= q && a010051 q == 1 where
          p = a020639 n
          q = n `div` p
    -- Reinhard Zumkeller, Aug 07 2011
    
  • Magma
    [n: n in [1..210] | EulerPhi(n) + DivisorSigma(1,n) eq 2*(n+1)]; // Vincenzo Librandi, Sep 17 2015
    
  • Maple
    N:= 1001: # to get all terms < N
    Primes:= select(isprime, [2,seq(2*k+1,k=1..floor(N/2))]):
    {seq(seq(p*q,q=Primes[1..ListTools:-BinaryPlace(Primes,N/p)]),p=Primes)} minus {seq(p^2,p=Primes)};
    # Robert Israel, Jul 23 2014
    # Alternative, using A001221:
    isA006881 := proc(n)
         if numtheory[bigomega](n) =2 and A001221(n) = 2 then
            true ;
        else
            false ;
        end if;
    end proc:
    A006881 := proc(n) if n = 1 then 6; else for a from procname(n-1)+1 do if isA006881(a) then return a; end if; end do: end if;
    end proc: # R. J. Mathar, May 02 2010
    # Alternative:
    with(NumberTheory): isA006881 := n -> is(NumberOfPrimeFactors(n, 'distinct') = 2 and NumberOfPrimeFactors(n) = 2):
    select(isA006881, [seq(1..205)]); # Peter Luschny, Jul 12 2023
  • Mathematica
    mx = 205; Sort@ Flatten@ Table[ Prime[n]*Prime[m], {n, Log[2, mx/3]}, {m, n + 1, PrimePi[ mx/Prime[n]]}] (* Robert G. Wilson v, Dec 28 2005, modified Jul 23 2014 *)
    sqFrSemiPrimeQ[n_] := Last@# & /@ FactorInteger@ n == {1, 1}; Select[Range[210], sqFrSemiPrimeQ] (* Robert G. Wilson v, Feb 07 2012 *)
    With[{upto=250},Select[Sort[Times@@@Subsets[Prime[Range[upto/2]],{2}]],#<=upto&]] (* Harvey P. Dale, Apr 30 2018 *)
  • PARI
    for(n=1,214,if(bigomega(n)==2&&omega(n)==2,print1(n,",")))
    
  • PARI
    for(n=1,214,if(bigomega(n)==2&&issquarefree(n),print1(n,",")))
    
  • PARI
    list(lim)=my(v=List()); forprime(p=2,sqrt(lim), forprime(q=p+1, lim\p, listput(v,p*q))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Jul 20 2011
    
  • Python
    from sympy import factorint
    def ok(n): f=factorint(n); return len(f) == 2 and sum(f[p] for p in f) == 2
    print(list(filter(ok, range(1, 206)))) # Michael S. Branicky, Jun 10 2021
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange
    def A006881(n):
        def f(x): return int(n+x+(t:=primepi(s:=isqrt(x)))+(t*(t-1)>>1)-sum(primepi(x//k) for k in primerange(1, s+1)))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return m # Chai Wah Wu, Aug 15 2024
  • Sage
    def A006881_list(n) :
        R = []
        for i in (6..n) :
            d = prime_divisors(i)
            if len(d) == 2 :
                if d[0]*d[1] == i :
                    R.append(i)
        return R
    A006881_list(205)  # Peter Luschny, Feb 07 2012
    

Formula

A000005(a(n)^(k-1)) = A000290(k) for all k>0. - Reinhard Zumkeller, Mar 04 2007
A109810(a(n)) = 4; A178254(a(n)) = 6. - Reinhard Zumkeller, May 24 2010
A056595(a(n)) = 3. - Reinhard Zumkeller, Aug 15 2011
a(n) = A096916(n) * A070647(n). - Reinhard Zumkeller, Sep 23 2011
A211110(a(n)) = 3. - Reinhard Zumkeller, Apr 02 2012
Sum_{n >= 1} 1/a(n)^s = (1/2)*(P(s)^2 - P(2*s)), where P is Prime Zeta. - Enrique Pérez Herrero, Jun 24 2012
A050326(a(n)) = 2. - Reinhard Zumkeller, May 03 2013
sopf(a(n)) = a(n) - phi(a(n)) + 1 = sigma(a(n)) - a(n) - 1. - Wesley Ivan Hurt, May 18 2013
d(a(n)) = 4. Omega(a(n)) = 2. omega(a(n)) = 2. mu(a(n)) = 1. - Wesley Ivan Hurt, Jun 28 2013
a(n) ~ n log n/log log n. - Charles R Greathouse IV, Aug 22 2013
A089233(a(n)) = 1. - Reinhard Zumkeller, Sep 04 2013
From Peter Luschny, Jul 12 2023: (Start)
For k > 1: k is a term <=> k^A001221(k) = k*A007947(k).
For k > 1: k is a term <=> k^A001222(k) = k*A007947(k).
For k > 1: k is a term <=> A363923(k) = k. (End)
a(n) ~ n log n/log log n. - Charles R Greathouse IV, Jan 13 2025

Extensions

Name expanded (based on a comment of Rick L. Shepherd) by Charles R Greathouse IV, Sep 16 2015

A007304 Sphenic numbers: products of 3 distinct primes.

Original entry on oeis.org

30, 42, 66, 70, 78, 102, 105, 110, 114, 130, 138, 154, 165, 170, 174, 182, 186, 190, 195, 222, 230, 231, 238, 246, 255, 258, 266, 273, 282, 285, 286, 290, 310, 318, 322, 345, 354, 357, 366, 370, 374, 385, 399, 402, 406, 410, 418, 426, 429, 430, 434, 435, 438
Offset: 1

Views

Author

Keywords

Comments

Note the distinctions between this and "n has exactly three prime factors" (A014612) or "n has exactly three distinct prime factors." (A033992). The word "sphenic" also means "shaped like a wedge" [American Heritage Dictionary] as in dentation with "sphenic molars." - Jonathan Vos Post, Sep 11 2005
Also the volume of a sphenic brick. A sphenic brick is a rectangular parallelepiped whose sides are components of a sphenic number, namely whose sides are three distinct primes. Example: The distinct prime triple (3,5,7) produces a 3x5x7 unit brick which has volume 105 cubic units. 3-D analog of 2-D A037074 Product of twin primes, per Cino Hilliard's comment. Compare with 3-D A107768 Golden 3-almost primes = Volumes of bricks (rectangular parallelepipeds) each of whose faces has golden semiprime area. - Jonathan Vos Post, Jan 08 2007
Sum(n>=1, 1/a(n)^s) = (1/6)*(P(s)^3 - P(3*s) - 3*(P(s)*P(2*s)-P(3*s))), where P is prime zeta function. - Enrique Pérez Herrero, Jun 28 2012
Also numbers n with A001222(n)=3 and A001221(n)=3. - Enrique Pérez Herrero, Jun 28 2012
n = 265550 is the smallest n with a(n) (=1279789) < A006881(n) (=1279793). - Peter Dolland, Apr 11 2020

Examples

			From _Gus Wiseman_, Nov 05 2020: (Start)
Also Heinz numbers of strict integer partitions into three parts, where the Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). These partitions are counted by A001399(n-6) = A069905(n-3), with ordered version A001399(n-6)*6. The sequence of terms together with their prime indices begins:
     30: {1,2,3}     182: {1,4,6}     286: {1,5,6}
     42: {1,2,4}     186: {1,2,11}    290: {1,3,10}
     66: {1,2,5}     190: {1,3,8}     310: {1,3,11}
     70: {1,3,4}     195: {2,3,6}     318: {1,2,16}
     78: {1,2,6}     222: {1,2,12}    322: {1,4,9}
    102: {1,2,7}     230: {1,3,9}     345: {2,3,9}
    105: {2,3,4}     231: {2,4,5}     354: {1,2,17}
    110: {1,3,5}     238: {1,4,7}     357: {2,4,7}
    114: {1,2,8}     246: {1,2,13}    366: {1,2,18}
    130: {1,3,6}     255: {2,3,7}     370: {1,3,12}
    138: {1,2,9}     258: {1,2,14}    374: {1,5,7}
    154: {1,4,5}     266: {1,4,8}     385: {3,4,5}
    165: {2,3,5}     273: {2,4,6}     399: {2,4,8}
    170: {1,3,7}     282: {1,2,15}    402: {1,2,19}
    174: {1,2,10}    285: {2,3,8}     406: {1,4,10}
(End)
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • "Sphenic", The American Heritage Dictionary of the English Language, Fourth Edition, Houghton Mifflin Company, 2000.

Crossrefs

Products of exactly k distinct primes, for k = 1 to 6: A000040, A006881. A007304, A046386, A046387, A067885.
Cf. A162143 (a(n)^2).
For the following, NNS means "not necessarily strict".
A014612 is the NNS version.
A046389 is the restriction to odds (NNS: A046316).
A075819 is the restriction to evens (NNS: A075818).
A239656 gives first differences.
A285508 lists terms of A014612 that are not squarefree.
A307534 is the case where all prime indices are odd (NNS: A338471).
A337453 is a different ranking of ordered triples (NNS: A014311).
A338557 is the case where all prime indices are even (NNS: A338556).
A001399(n-6) counts strict 3-part partitions (NNS: A001399(n-3)).
A005117 lists squarefree numbers.
A008289 counts strict partitions by sum and length.
A220377 counts 3-part pairwise coprime strict partitions (NNS: A307719).

Programs

  • Haskell
    a007304 n = a007304_list !! (n-1)
    a007304_list = filter f [1..] where
    f u = p < q && q < w && a010051 w == 1 where
    p = a020639 u; v = div u p; q = a020639 v; w = div v q
    -- Reinhard Zumkeller, Mar 23 2014
    
  • Maple
    with(numtheory): a:=proc(n) if bigomega(n)=3 and nops(factorset(n))=3 then n else fi end: seq(a(n),n=1..450); # Emeric Deutsch
    A007304 := proc(n)
        option remember;
        local a;
        if n =1 then
            30;
        else
            for a from procname(n-1)+1 do
                if bigomega(a)=3 and nops(factorset(a))=3 then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Dec 06 2016
    is_a := proc(n) local P; P := NumberTheory:-PrimeFactors(n); nops(P) = 3 and n = mul(P) end:
    A007304List := upto -> select(is_a, [seq(1..upto)]):  # Peter Luschny, Apr 14 2025
  • Mathematica
    Union[Flatten[Table[Prime[n]*Prime[m]*Prime[k], {k, 20}, {n, k+1, 20}, {m, n+1, 20}]]]
    Take[ Sort@ Flatten@ Table[ Prime@i Prime@j Prime@k, {i, 3, 21}, {j, 2, i - 1}, {k, j - 1}], 53] (* Robert G. Wilson v *)
    With[{upto=500},Sort[Select[Times@@@Subsets[Prime[Range[Ceiling[upto/6]]],{3}],#<=upto&]]] (* Harvey P. Dale, Jan 08 2015 *)
    Select[Range[100],SquareFreeQ[#]&&PrimeOmega[#]==3&] (* Gus Wiseman, Nov 05 2020 *)
  • PARI
    for(n=1,1e4,if(bigomega(n)==3 && omega(n)==3,print1(n", "))) \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    list(lim)=my(v=List(),t);forprime(p=2,(lim)^(1/3),forprime(q=p+1,sqrt(lim\p),t=p*q;forprime(r=q+1,lim\t,listput(v,t*r))));vecsort(Vec(v)) \\ Charles R Greathouse IV, Jul 20 2011
    
  • PARI
    list(lim)=my(v=List(), t); forprime(p=2, sqrtnint(lim\=1,3), forprime(q=p+1, sqrtint(lim\p), t=p*q; forprime(r=q+1, lim\t, listput(v, t*r)))); Set(v) \\ Charles R Greathouse IV, Jan 21 2025
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange, integer_nthroot
    def A007304(n):
        def f(x): return int(n+x-sum(primepi(x//(k*m))-b for a,k in enumerate(primerange(integer_nthroot(x,3)[0]+1),1) for b,m in enumerate(primerange(k+1,isqrt(x//k)+1),a+1)))
        kmin, kmax = 0,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 # Chai Wah Wu, Aug 29 2024
    
  • SageMath
    def is_a(n):
        P = prime_divisors(n)
        return len(P) == 3 and prod(P) == n
    print([n for n in range(1, 439) if is_a(n)]) # Peter Luschny, Apr 14 2025

Formula

A008683(a(n)) = -1.
A000005(a(n)) = 8. - R. J. Mathar, Aug 14 2009
A002033(a(n)-1) = 13. - Juri-Stepan Gerasimov, Oct 07 2009, R. J. Mathar, Oct 14 2009
A178254(a(n)) = 36. - Reinhard Zumkeller, May 24 2010
A050326(a(n)) = 5, subsequence of A225228. - Reinhard Zumkeller, May 03 2013
a(n) ~ 2n log n/(log log n)^2. - Charles R Greathouse IV, Sep 14 2015

Extensions

More terms from Robert G. Wilson v, Jan 04 2006
Comment concerning number of divisors corrected by R. J. Mathar, Aug 14 2009

A046386 Products of exactly four distinct primes.

Original entry on oeis.org

210, 330, 390, 462, 510, 546, 570, 690, 714, 770, 798, 858, 870, 910, 930, 966, 1110, 1122, 1155, 1190, 1218, 1230, 1254, 1290, 1302, 1326, 1330, 1365, 1410, 1430, 1482, 1518, 1554, 1590, 1610, 1722, 1770, 1785, 1794, 1806, 1830, 1870, 1914, 1938, 1974
Offset: 1

Views

Author

Patrick De Geest, Jun 15 1998

Keywords

Comments

A squarefree subsequence of A033993. Numbers like 420 = 2^2*3*5*7 with at least one prime exponent greater than 1 in the prime signature are excluded here. - R. J. Mathar, Apr 03 2011
Numbers such that omega(n) = bigomega(n) = 4. - Michel Marcus, Dec 15 2015

Examples

			210 = 2*3*5*7;
330 = 2*3*5*11;
390 = 2*3*5*13;
462 = 2*3*7*11.
		

Crossrefs

Products of exactly k distinct primes, for k = 1 to 6: A000040, A006881. A007304, A046386, A046387, A067885.
Cf. A001221 (omega), A001222 (bigomega), A014613 (bigomega(N) = 4) and A033993 (omega(N) = 4).
Cf. A046402 (4 palindromic prime factors).

Programs

  • Mathematica
    fQ[n_] := Last /@ FactorInteger[n] == {1, 1, 1, 1}; Select[ Range[2000], fQ[ # ] &] (* Robert G. Wilson v, Aug 04 2005 *)
    Select[Range[2000],PrimeNu[#]==PrimeOmega[#]==4&] (* Harvey P. Dale, Jan 05 2025 *)
  • PARI
    is(n)=factor(n)[,2]==[1,1,1,1]~ \\ Charles R Greathouse IV, Sep 17 2015
    
  • PARI
    is(n) = omega(n)==4 && bigomega(n)==4 \\ Hugo Pfoertner, Dec 18 2018
    
  • PARI
    list(lim)=my(v=List()); forprime(p=2,sqrtnint(lim\=1,4), forprime(q=p+1,sqrtnint(lim\p,3), forprime(r=q+2,sqrtint(lim\p\q), my(t=p*q*r); forprime(s=r+2,lim\t, listput(v,t*s))))); Set(v) \\ Charles R Greathouse IV, Dec 05 2024
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange, integer_nthroot
    def A046386(n):
        def f(x): return int(n+x-sum(primepi(x//(k*m*r))-c for a,k in enumerate(primerange(integer_nthroot(x,4)[0]+1),1) for b,m in enumerate(primerange(k+1,integer_nthroot(x//k,3)[0]+1),a+1) for c,r in enumerate(primerange(m+1,isqrt(x//(k*m))+1),b+1)))
        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
        return bisection(f) # Chai Wah Wu, Aug 29 2024

Formula

Intersection of A014613 (product of 4 primes) and A033993 (divisible by 4 distinct primes). - M. F. Hasler, Mar 24 2022

A007774 Numbers that are divisible by exactly 2 different primes; numbers n with omega(n) = A001221(n) = 2.

Original entry on oeis.org

6, 10, 12, 14, 15, 18, 20, 21, 22, 24, 26, 28, 33, 34, 35, 36, 38, 39, 40, 44, 45, 46, 48, 50, 51, 52, 54, 55, 56, 57, 58, 62, 63, 65, 68, 69, 72, 74, 75, 76, 77, 80, 82, 85, 86, 87, 88, 91, 92, 93, 94, 95, 96, 98, 99, 100, 104, 106, 108, 111, 112, 115, 116, 117, 118
Offset: 1

Views

Author

Luke Pebody (ltp1000(AT)hermes.cam.ac.uk)

Keywords

Comments

Every group of order p^a * q^b is solvable (Burnside, 1904). - Franz Vrabec, Sep 14 2008
Characteristic function for a(n): floor(omega(n)/2) * floor(2/omega(n)) where omega(n) is the number of distinct prime factors of n. - Wesley Ivan Hurt, Jan 10 2013

Examples

			20 is a term because 20 = 2^2*5 with two distinct prime divisors 2, 5.
		

Crossrefs

Subsequence of A085736; A256617 is a subsequence.
Row 2 of A125666.
Cf. A001358 (products of two primes), A014612 (products of three primes), A014613 (products of four primes), A014614 (products of five primes), where the primes are not necessarily distinct.
Cf. A006881, A046386, A046387, A067885 (product of exactly 2, 4, 5, 6 distinct primes respectively).

Programs

  • Haskell
    a007774 n = a007774_list !! (n-1)
    a007774_list = filter ((== 2) . a001221) [1..]
    -- Reinhard Zumkeller, Aug 02 2012
    
  • Maple
    with(numtheory,factorset):f := proc(n) if nops(factorset(n))=2 then RETURN(n) fi; end;
  • Mathematica
    Select[Range[0,6! ],Length[FactorInteger[ # ]]==2&] (* Vladimir Joseph Stephan Orlovsky, Apr 22 2010 *)
    Select[Range[120],PrimeNu[#]==2&] (* Harvey P. Dale, Jun 03 2020 *)
  • PARI
    is(n)=omega(n)==2 \\ Charles R Greathouse IV, Apr 01 2013
    
  • Python
    from sympy import primefactors
    A007774_list = [n for n in range(1,10**5) if len(primefactors(n)) == 2] # Chai Wah Wu, Aug 23 2021

Extensions

Expanded definition. - N. J. A. Sloane, Aug 22 2021

A067885 Products of exactly 6 distinct primes.

Original entry on oeis.org

30030, 39270, 43890, 46410, 51870, 53130, 62790, 66990, 67830, 71610, 72930, 79170, 81510, 82110, 84630, 85470, 91770, 94710, 98670, 99330, 101010, 102102, 103530, 106590, 108570, 110670, 111930, 114114, 115710, 117390, 122430, 123690, 124410, 125970, 128310
Offset: 1

Views

Author

Benoit Cloitre, Mar 02 2002

Keywords

Crossrefs

Subsequence of A074969. - R. J. Mathar, Nov 24 2009
Products of exactly k distinct primes, for k = 1 to 6: A000040, A006881. A007304, A046386, A046387, A067885.

Programs

  • Mathematica
    Select[Range[125000],PrimeNu[#]==PrimeOmega[#]==6&] (* Harvey P. Dale, May 14 2014 *)
  • PARI
    is(n)=factor(n)[,2]==[1,1,1,1,1,1]~ \\ Charles R Greathouse IV, Sep 14 2015
    
  • PARI
    is(n)=omega(n)==6 && bigomega(n)==6 \\ Hugo Pfoertner, Dec 18 2018
    
  • PARI
    list(lim)=lim\=1; my(v=List(), L1,L2,L3,L4,P4,P5); forprime(p=13,lim\2310, L1=lim\p; forprime(q=11,min(L1\210,p-2), L2=L1\q; forprime(r=7, min(L2\30,q-2), L3=L2\r; forprime(s=5,min(L3\6,r-2), L4=L3\s; P4=p*q*r*s; forprime(t=3, min(L4\2,s-2), P5=P4*t; forprime(u=2, min(L4\t,t-1), listput(v,P5*u))))))); Set(v) \\ Charles R Greathouse IV, Aug 27 2021
    
  • Python
    from math import prod, isqrt
    from sympy import primerange, integer_nthroot, primepi
    def A067885(n):
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b+1,isqrt(x//c)+1),a+1)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b+1,integer_nthroot(x//c,m)[0]+1),a+1) for d in g(x,a2,b2,c*b2,m-1)))
        def f(x): return int(n+x-sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,6)))
        kmin, kmax = 0,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 # Chai Wah Wu, Aug 29 2024

Formula

{k: A001221(k) = A001222(k) = 6}. - R. J. Mathar, Jul 18 2023

A085987 Product of exactly four primes, three of which are distinct (p^2*q*r).

Original entry on oeis.org

60, 84, 90, 126, 132, 140, 150, 156, 198, 204, 220, 228, 234, 260, 276, 294, 306, 308, 315, 340, 342, 348, 350, 364, 372, 380, 414, 444, 460, 476, 490, 492, 495, 516, 522, 525, 532, 550, 558, 564, 572, 580, 585, 620, 636, 644, 650, 666, 693, 708, 726
Offset: 1

Views

Author

Alford Arnold, Jul 08 2003

Keywords

Comments

A014613 is completely determined by A030514, A065036, A085986, A085987 and A046386 since p(4) = 5. (cf. A000041). More generally, the first term of sequences which completely determine the k-almost primes can be found in A036035 (a resorted version of A025487).
A050326(a(n)) = 4. - Reinhard Zumkeller, May 03 2013

Examples

			a(1) = 60 since 60 = 2*2*3*5 and has three distinct prime factors.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Sort[Last/@FactorInteger[n]]=={1,1,2}; Select[Range[2000], f] (* Vladimir Joseph Stephan Orlovsky, May 03 2011 *)
    pefp[{a_,b_,c_}]:={a^2 b c,a b^2 c,a b c^2}; Module[{upto=800},Select[ Flatten[ pefp/@Subsets[Prime[Range[PrimePi[upto/6]]],{3}]]//Union,#<= upto&]] (* Harvey P. Dale, Oct 02 2018 *)
  • PARI
    list(lim)=my(v=List(),t,x,y,z);forprime(p=2,lim^(1/4),t=lim\p^2;forprime(q=p+1,sqrtint(t),forprime(r=q+1,t\q,x=p^2*q*r;y=p*q^2*r;listput(v,x);if(y<=lim,listput(v,y);z=p*q*r^2;if(z<=lim,listput(v,z))))));vecsort(Vec(v)) \\ Charles R Greathouse IV, Jul 15 2011
    
  • PARI
    is(n)=vecsort(factor(n)[,2]~)==[1,1,2] \\ Charles R Greathouse IV, Oct 19 2015
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange, integer_nthroot
    def A085987(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = 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 n+x+sum((t:=primepi(s:=isqrt(y:=x//r**2)))+(t*(t-1)>>1)-sum(primepi(y//k) for k in primerange(1, s+1)) for r in primerange(isqrt(x)+1))+sum(primepi(x//p**3) for p in primerange(integer_nthroot(x,3)[0]+1))-primepi(integer_nthroot(x,4)[0])
        return bisection(f,n,n) # Chai Wah Wu, Mar 27 2025

Extensions

More terms from Reinhard Zumkeller, Jul 25 2003

A123321 Products of 7 distinct primes (squarefree 7-almost primes).

Original entry on oeis.org

510510, 570570, 690690, 746130, 870870, 881790, 903210, 930930, 1009470, 1067430, 1111110, 1138830, 1193010, 1217370, 1231230, 1272810, 1291290, 1345890, 1360590, 1385670, 1411410, 1438710, 1452990, 1504230, 1540770
Offset: 1

Views

Author

Rick L. Shepherd, Sep 25 2006

Keywords

Comments

Intersection of A005117 and A046308.
Intersection of A005117 and A176655. - R. J. Mathar, Dec 05 2016

Examples

			a(1) = 510510 = 2*3*5*7*11*13*17 = A002110(7).
		

Crossrefs

Cf. A005117, A046308, A048692, Squarefree k-almost primes: A000040 (k=1), A006881 (k=2), A007304 (k=3), A046386 (k=4), A046387 (k=5), A067885 (k=6), A123322 (k=8), A115343 (k=9).

Programs

  • Mathematica
    f7Q[n_]:=Last/@FactorInteger[n]=={1, 1, 1, 1, 1, 1, 1}; lst={};Do[If[f7Q[n], AppendTo[lst, n]], {n, 9!}];lst (* Vladimir Joseph Stephan Orlovsky, Aug 26 2008 *)
    Select[Range[1600000],PrimeNu[#]==7&&SquareFreeQ[#]&] (* Harvey P. Dale, Sep 19 2013 *)
  • PARI
    is(n)=omega(n)==7 && bigomega(n)==7 \\ Hugo Pfoertner, Dec 18 2018
    
  • Python
    from math import isqrt, prod
    from sympy import primerange, integer_nthroot, primepi
    def A123321(n):
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b+1,isqrt(x//c)+1),a+1)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b+1,integer_nthroot(x//c,m)[0]+1),a+1) for d in g(x,a2,b2,c*b2,m-1)))
        def f(x): return int(n+x-sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,7)))
        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
        return bisection(f) # Chai Wah Wu, Aug 31 2024

Extensions

More terms from Vladimir Joseph Stephan Orlovsky, Aug 26 2008

A115343 Products of 9 distinct primes.

Original entry on oeis.org

223092870, 281291010, 300690390, 340510170, 358888530, 363993630, 380570190, 397687290, 406816410, 417086670, 434444010, 455885430, 458948490, 481410930, 485555070, 497668710, 504894390, 512942430, 514083570, 531990690, 538047510, 547777230, 551861310
Offset: 1

Views

Author

Jonathan Vos Post, Mar 06 2006

Keywords

Examples

			514083570 is in the sequence as it is equal to 2*3*5*7*11*13*17*19*53.
		

Crossrefs

Programs

  • Maple
    N:= 10^9: # to get all terms < N
    n0:= mul(ithprime(i),i=1..8):
    Primes:= select(isprime,[$1..floor(N/n0)]):
    nPrimes:= nops(Primes):
    for i from 1 to 9 do
      for j from 1 to nPrimes do
        M[i,j]:= convert(Primes[1..min(j,i)],`*`);
    od od:
    A:= {}:
    for i9 from 9 to nPrimes do
      m9:= Primes[i9];
    for i8 in select(t -> M[7,t-1]*Primes[t]*m9 <= N, [$8..i9-1]) do
      m8:= m9*Primes[i8];
    for i7 in select(t -> M[6,t-1]*Primes[t]*m8 <= N, [$7..i8-1]) do
      m7:= m8*Primes[i7];
    for i6 in select(t -> M[5,t-1]*Primes[t]*m7 <= N, [$6..i7-1]) do
      m6:= m7*Primes[i6];
    for i5 in select(t -> M[4,t-1]*Primes[t]*m6 <= N, [$5..i6-1]) do
      m5:= m6*Primes[i5];
    for i4 in select(t -> M[3,t-1]*Primes[t]*m5 <= N, [$4..i5-1]) do
      m4:= m5*Primes[i4];
    for i3 in select(t -> M[2,t-1]*Primes[t]*m4 <= N, [$3..i4-1]) do
      m3:= m4*Primes[i3];
    for i2 in select(t -> M[1,t-1]*Primes[t]*m3 <= N, [$2..i3-1]) do
      m2:= m3*Primes[i2];
    for i1 in select(t -> Primes[t]*m2 <= N, [$1..i2-1]) do
      A:= A union {m2*Primes[i1]};
    od od od od od od od od od:
    A; # Robert Israel, Sep 02 2014
  • Mathematica
    Module[{n=6*10^8,k},k=PrimePi[n/Times@@Prime[Range[8]]];Select[ Union[ Times@@@ Subsets[Prime[Range[k]],{9}]],#<=n&]](* Harvey P. Dale with suggestions from Jean-François Alcover, Sep 03 2014 *)
    n = 10^9; n0 = Times @@ Prime[Range[8]]; primes = Select[Range[Floor[n/n0]], PrimeQ]; nPrimes = Length[primes]; Do[M[i, j] = Times @@ primes[[1 ;; Min[j, i]]], {i, 1, 9}, {j, 1, nPrimes}]; A = {};
    Do[m9 = primes[[i9]];
    Do[m8 = m9*primes[[i8]];
    Do[m7 = m8*primes[[i7]];
    Do[m6 = m7*primes[[i6]];
    Do[m5 = m6*primes[[i5]];
    Do[m4 = m5*primes[[i4]];
    Do[m3 = m4*primes[[i3]];
    Do[m2 = m3*primes[[i2]];
    Do[A = A ~Union~ {m2*primes[[i1]]},
    {i1, Select[Range[1, i2-1], primes[[#]]*m2 <= n &]}],
    {i2, Select[Range[2, i3-1], M[1, #-1]*primes[[#]]*m3 <= n &]}],
    {i3, Select[Range[3, i4-1], M[2, #-1]*primes[[#]]*m4 <= n &]}],
    {i4, Select[Range[4, i5-1], M[3, #-1]*primes[[#]]*m5 <= n &]}],
    {i5, Select[Range[5, i6-1], M[4, #-1]*primes[[#]]*m6 <= n &]}],
    {i6, Select[Range[6, i7-1], M[5, #-1]*primes[[#]]*m7 <= n &]}],
    {i7, Select[Range[7, i8-1], M[6, #-1]*primes[[#]]*m8 <= n &]}],
    {i8, Select[Range[8, i9-1], M[7, #-1]*primes[[#]]*m9 <= n &]}],
    {i9, 9, nPrimes}];
    A (* Jean-François Alcover, Sep 03 2014, translated and adapted from Robert Israel's Maple program *)
  • PARI
    is(n)=omega(n)==9 && bigomega(n)==9 \\ Hugo Pfoertner, Dec 18 2018
  • Python
    from operator import mul
    from functools import reduce
    from sympy import nextprime, sieve
    from itertools import combinations
    n = 190
    m = 9699690*nextprime(n-1)
    A115343 = []
    for x in combinations(sieve.primerange(1,n),9):
        y = reduce(mul,(d for d in x))
        if y < m:
            A115343.append(y)
    A115343 = sorted(A115343) # Chai Wah Wu, Sep 02 2014
    
  • Python
    from math import prod, isqrt
    from sympy import primerange, integer_nthroot, primepi
    def A115343(n):
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b+1,isqrt(x//c)+1),a+1)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b+1,integer_nthroot(x//c,m)[0]+1),a+1) for d in g(x,a2,b2,c*b2,m-1)))
        def f(x): return int(n+x-sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,9)))
        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
        return bisection(f) # Chai Wah Wu, Aug 31 2024
    

Extensions

Corrected and extended by Don Reble, Mar 09 2006
More terms and corrected b-file from Chai Wah Wu, Sep 02 2014

A176655 Numbers that are divisible by exactly 7 distinct primes.

Original entry on oeis.org

510510, 570570, 690690, 746130, 870870, 881790, 903210, 930930, 1009470, 1021020, 1067430, 1111110, 1138830, 1141140, 1193010, 1217370, 1231230, 1272810, 1291290, 1345890, 1360590, 1381380, 1385670, 1411410, 1438710
Offset: 1

Views

Author

Keywords

Examples

			1711710 = 2 * 3^2 * 5 * 7 * 11 * 13 * 19.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[9!,5*9! ],Length[FactorInteger[ # ]]==7&]
    Select[Range[144*10^4],PrimeNu[#]==7&] (* Harvey P. Dale, Jul 05 2022 *)
  • PARI
    isA176655(n)=omega(n)==7 \\ Charles R Greathouse IV, Mar 11 2011
    
  • PARI
    (PARI) A246655(lim)=my(v=List(primes([2,lim\=1]))); for(e=2,logint(lim,2), forprime(p=2,sqrtnint(lim,e), listput(v,p^e))); Set(v)
    list(lim,pr=7)=if(pr==1, return(A246655(lim))); my(v=List(),pr1=pr-1,mx=prod(i=1,pr1,prime(i))); forprime(p=prime(pr),lim\mx, my(u=list(lim\p,pr1)); for(i=1,#u,listput(v,p*u[i]))); Set(v) \\ Charles R Greathouse IV, Feb 03 2023
Showing 1-10 of 40 results. Next