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

A176451 Number of primes between two consecutive nonprimes in A037143.

Original entry on oeis.org

2, 1, 1, 0, 2, 0, 2, 0, 1, 0, 2, 0, 0, 1, 0, 2, 1, 0, 1, 0, 0, 2, 0, 1, 2, 0, 1, 1, 0, 0, 1, 0, 0, 0, 3, 2, 1, 0, 0, 0, 0, 0, 1, 1, 0, 2, 0, 0, 0, 0, 2, 1, 0, 0, 1, 1, 1, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 3, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 18 2010

Keywords

Comments

2 together with the number of primes between successive semiprimes.

Examples

			a(1) = 2 because A037143(1) = 1 (nonprime) < A037143(2) = 2 (prime) < A037143(3) = 3 (prime) < A037143(4) = 4 (nonprime).
		

Crossrefs

Programs

  • Mathematica
    Join[{2}, -1 + Differences[Position[Select[PrimeOmega[Range[400]], # < 3 &], 2] // Flatten]] (* Amiram Eldar, Sep 07 2024 *)

Formula

a(n) = A088700(n-1) for n >= 2.

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

A101296 n has the a(n)-th distinct prime signature.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 5, 3, 4, 2, 6, 2, 4, 4, 7, 2, 6, 2, 6, 4, 4, 2, 8, 3, 4, 5, 6, 2, 9, 2, 10, 4, 4, 4, 11, 2, 4, 4, 8, 2, 9, 2, 6, 6, 4, 2, 12, 3, 6, 4, 6, 2, 8, 4, 8, 4, 4, 2, 13, 2, 4, 6, 14, 4, 9, 2, 6, 4, 9, 2, 15, 2, 4, 6, 6, 4, 9, 2, 12, 7, 4, 2, 13, 4, 4, 4, 8, 2, 13, 4, 6, 4, 4, 4, 16, 2, 6, 6, 11, 2, 9, 2, 8, 9, 4, 2, 15, 2, 9, 4, 12, 2, 9, 4, 6, 6, 4, 4, 17
Offset: 1

Views

Author

David Wasserman, Dec 21 2004

Keywords

Comments

From Antti Karttunen, May 12 2017: (Start)
Restricted growth sequence transform of A046523, the least representative of each prime signature. Thus this partitions the natural numbers to the same equivalence classes as A046523, i.e., for all i, j: a(i) = a(j) <=> A046523(i) = A046523(j), and for that reason satisfies in that respect all the same conditions as A046523. For example, we have, for all i, j: if a(i) = a(j), then:
A000005(i) = A000005(j), A008683(i) = A008683(j), A286605(i) = A286605(j).
So, this sequence (instead of A046523) can be used for finding sequences where a(n)'s value is dependent only on the prime signature of n, that is, only on the multiset of prime exponents in the factorization of n. (End)
This is also the restricted growth sequence transform of many other sequences, for example, that of A181819. See further comments there. - Antti Karttunen, Apr 30 2022

Examples

			From _David A. Corneth_, May 12 2017: (Start)
1 has prime signature (), the first distinct prime signature. Therefore, a(1) = 1.
2 has prime signature (1), the second distinct prime signature after (1). Therefore, a(2) = 2.
3 has prime signature (1), as does 2. Therefore, a(3) = a(2) = 2.
4 has prime signature (2), the third distinct prime signature after () and (1). Therefore, a(4) = 3. (End)
From _Antti Karttunen_, May 12 2017: (Start)
Construction of restricted growth sequences: In this case we start with a(1) = 1 for A046523(1) = 1, and thereafter, for all n > 1, we use the least so far unused natural number k for a(n) if A046523(n) has not been encountered before, otherwise [whenever A046523(n) = A046523(m), for some m < n], we set a(n) = a(m).
For n = 2, A046523(2) = 2, which has not been encountered before (first prime), thus we allot for a(2) the least so far unused number, which is 2, thus a(2) = 2.
For n = 3, A046523(2) = 2, which was already encountered as A046523(1), thus we set a(3) = a(2) = 2.
For n = 4, A046523(4) = 4, not encountered before (first square of prime), thus we allot for a(4) the least so far unused number, which is 3, thus a(4) = 3.
For n = 5, A046523(5) = 2, as for the first time encountered at n = 2, thus we set a(5) = a(2) = 2.
For n = 6, A046523(6) = 6, not encountered before (first semiprime pq with distinct p and q), thus we allot for a(6) the least so far unused number, which is 4, thus a(6) = 4.
For n = 8, A046523(8) = 8, not encountered before (first cube of a prime), thus we allot for a(8) the least so far unused number, which is 5, thus a(8) = 5.
For n = 9, A046523(9) = 4, as for the first time encountered at n = 4, thus a(9) = 3.
(End)
From _David A. Corneth_, May 12 2017: (Start)
(Rough) description of an algorithm of computing the sequence:
Suppose we want to compute a(n) for n in [1..20].
We set up a vector of 20 elements, values 0, and a number m = 1, the minimum number we haven't checked and c = 0, the number of distinct prime signatures we've found so far.
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
We check the prime signature of m and see that it's (). We increase c with 1 and set all elements up to 20 with prime signature () to 1. In the process, we adjust m. This gives:
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]. The least number we haven't checked is m = 2. 2 has prime signature (1). We increase c with 1 and set all elements up to 20 with prime signature (1) to 2. In the process, we adjust m. This gives:
[1, 2, 2, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0]
We check the prime signature of m = 4 and see that its prime signature is (2). We increase c with 1 and set all numbers up to 20 with prime signature (2) to 3. This gives:
[1, 2, 2, 3, 2, 0, 2, 0, 3, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0]
Similarily, after m = 6, we get
[1, 2, 2, 3, 2, 4, 2, 0, 3, 4, 2, 0, 2, 4, 4, 0, 2, 0, 2, 0], after m = 8 we get:
[1, 2, 2, 3, 2, 4, 2, 5, 3, 4, 2, 0, 2, 4, 4, 0, 2, 0, 2, 0], after m = 12 we get:
[1, 2, 2, 3, 2, 4, 2, 5, 3, 4, 2, 6, 2, 4, 4, 0, 2, 6, 2, 0], after m = 16 we get:
[1, 2, 2, 3, 2, 4, 2, 5, 3, 4, 2, 6, 2, 4, 4, 7, 2, 6, 2, 0], after m = 20 we get:
[1, 2, 2, 3, 2, 4, 2, 5, 3, 4, 2, 6, 2, 4, 4, 7, 2, 6, 2, 8]. Now, m > 20 so we stop. (End)
The above method is inefficient, because the step "set all elements a(n) up to n = Nmax with prime signature s(n) = S[c] to c" requires factoring all integers up to Nmax (or at least comparing their signature, once computed, with S[c]) again and again. It is much more efficient to run only once over each m = 1..Nmax, compute its prime signature s(m), add it to an ordered list in case it did not occur earlier, together with its "rank" (= new size of the list), and assign that rank to a(m). The list of prime signatures is much shorter than [1..Nmax]. One can also use m'(m) := the smallest n with the prime signature of m (which is faster to compute than to search for the signature) as representative for s(m), and set a(m) := a(m'(m)). Then it is sufficient to have just one counter (number of prime signatures seen so far) as auxiliary variable, in addition to the sequence to be computed. - _M. F. Hasler_, Jul 18 2019
		

Crossrefs

Cf. A025487, A046523, A064839 (ordinal transform of this sequence), A181819, and arrays A095904, A179216.
Sequences that are unions of finite number (>= 2) of equivalence classes determined by the values that this sequence obtains (i.e., sequences mentioned in David A. Corneth's May 12 2017 formula): A001358 (A001248 U A006881, values 3 & 4), A007422 (values 1, 4, 5), A007964 (2, 3, 4, 5), A014612 (5, 6, 9), A030513 (4, 5), A037143 (1, 2, 3, 4), A037144 (1, 2, 3, 4, 5, 6, 9), A080258 (6, 7), A084116 (2, 4, 5), A167171 (2, 4), A217856 (6, 9).
Cf. also A077462, A305897 (stricter variants, with finer partitioning) and A254524, A286603, A286605, A286610, A286619, A286621, A286622, A286626, A286378 for other similarly constructed sequences.

Programs

  • Maple
    A101296 := proc(n)
        local a046523, a;
        a046523 := A046523(n) ;
        for a from 1 do
            if A025487(a) = a046523 then
                return a;
            elif A025487(a) > a046523 then
                return -1 ;
            end if;
        end do:
    end proc: # R. J. Mathar, May 26 2017
  • Mathematica
    With[{nn = 120}, Function[s, Table[Position[Keys@s, k_ /; MemberQ[k, n]][[1, 1]], {n, nn}]]@ Map[#1 -> #2 & @@ # &, Transpose@ {Values@ #, Keys@ #}] &@ PositionIndex@ Table[Times @@ MapIndexed[Prime[First@ #2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]] - Boole[n == 1], {n, nn}] ] (* Michael De Vlieger, May 12 2017, Version 10 *)
  • PARI
    find(ps, vps) = {for (k=1, #vps, if (vps[k] == ps, return(k)););}
    lisps(nn) = {vps = []; for (n=1, nn, ps = vecsort(factor(n)[,2]); ips = find(ps, vps); if (! ips, vps = concat(vps, ps); ips = #vps); print1(ips, ", "););} \\ Michel Marcus, Nov 15 2015; edited by M. F. Hasler, Jul 16 2019
    
  • PARI
    rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences,invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences,invec[i],i); outvec[i] = u; u++ )); outvec; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    write_to_bfile(1,rgs_transform(vector(100000,n,A046523(n))),"b101296.txt");
    \\ Antti Karttunen, May 12 2017

Formula

A025487(a(n)) = A046523(n).
Indices of records give A025487. - Michel Marcus, Nov 16 2015
From David A. Corneth, May 12 2017: (Start) [Corresponding characteristic function in brackets]
a(A000012(n)) = 1 (sig.: ()). [A063524]
a(A000040(n)) = 2 (sig.: (1)). [A010051]
a(A001248(n)) = 3 (sig.: (2)). [A302048]
a(A006881(n)) = 4 (sig.: (1,1)). [A280710]
a(A030078(n)) = 5 (sig.: (3)).
a(A054753(n)) = 6 (sig.: (1,2)). [A353472]
a(A030514(n)) = 7 (sig.: (4)).
a(A065036(n)) = 8 (sig.: (1,3)).
a(A007304(n)) = 9 (sig.: (1,1,1)). [A354926]
a(A050997(n)) = 10 (sig.: (5)).
a(A085986(n)) = 11 (sig.: (2,2)).
a(A178739(n)) = 12 (sig.: (1,4)).
a(A085987(n)) = 13 (sig.: (1,1,2)).
a(A030516(n)) = 14 (sig.: (6)).
a(A143610(n)) = 15 (sig.: (2,3)).
a(A178740(n)) = 16 (sig.: (1,5)).
a(A189975(n)) = 17 (sig.: (1,1,3)).
a(A092759(n)) = 18 (sig.: (7)).
a(A189988(n)) = 19 (sig.: (2,4)).
a(A179643(n)) = 20 (sig.: (1,2,2)).
a(A189987(n)) = 21 (sig.: (1,6)).
a(A046386(n)) = 22 (sig.: (1,1,1,1)).
a(A162142(n)) = 23 (sig.: (2,2,2)).
a(A179644(n)) = 24 (sig.: (1,1,4)).
a(A179645(n)) = 25 (sig.: (8)).
a(A179646(n)) = 26 (sig.: (2,5)).
a(A163569(n)) = 27 (sig.: (1,2,3)).
a(A179664(n)) = 28 (sig.: (1,7)).
a(A189982(n)) = 29 (sig.: (1,1,1,2)).
a(A179666(n)) = 30 (sig.: (3,4)).
a(A179667(n)) = 31 (sig.: (1,1,5)).
a(A179665(n)) = 32 (sig.: (9)).
a(A189990(n)) = 33 (sig.: (2,6)).
a(A179669(n)) = 34 (sig.: (1,2,4)).
a(A179668(n)) = 35 (sig.: (1,8)).
a(A179670(n)) = 36 (sig.: (1,1,1,3)).
a(A179671(n)) = 37 (sig.: (3,5)).
a(A162143(n)) = 38 (sig.: (2,2,2)).
a(A179672(n)) = 39 (sig.: (1,1,6)).
a(A030629(n)) = 40 (sig.: (10)).
a(A179688(n)) = 41 (sig.: (1,3,3)).
a(A179689(n)) = 42 (sig.: (2,7)).
a(A179690(n)) = 43 (sig.: (1,1,2,2)).
a(A189991(n)) = 44 (sig.: (4,4)).
a(A179691(n)) = 45 (sig.: (1,2,5)).
a(A179692(n)) = 46 (sig.: (1,9)).
a(A179693(n)) = 47 (sig.: (1,1,1,4)).
a(A179694(n)) = 48 (sig.: (3,6)).
a(A179695(n)) = 49 (sig.: (2,2,3)).
a(A179696(n)) = 50 (sig.: (1,1,7)).
(End)

Extensions

Data section extended to 120 terms by Antti Karttunen, May 12 2017
Minor edits/corrections by M. F. Hasler, Jul 18 2019

A109611 Chen primes: primes p such that p + 2 is either a prime or a semiprime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 47, 53, 59, 67, 71, 83, 89, 101, 107, 109, 113, 127, 131, 137, 139, 149, 157, 167, 179, 181, 191, 197, 199, 211, 227, 233, 239, 251, 257, 263, 269, 281, 293, 307, 311, 317, 337, 347, 353, 359, 379, 389, 401, 409
Offset: 1

Views

Author

Paul Muljadi, Jul 31 2005

Keywords

Comments

43 is the first prime which is not a member (see A102540).
Contains A001359 = lesser of twin primes.
A063637 is a subsequence. - Reinhard Zumkeller, Mar 22 2010
In 1966 Chen proved that this sequence is infinite; his proof did not appear until 1973 due to the Cultural Revolution. - Charles R Greathouse IV, Jul 12 2016
Primes p such that p + 2 is a term of A037143. - Flávio V. Fernandes, May 08 2021
Named after the Chinese mathematician Chen Jingrun (1933-1996). - Amiram Eldar, Jun 10 2021

Examples

			a(4) = 7 because 7 + 2 = 9 and 9 is a semiprime.
a(5) = 11 because 11 + 2 = 13, a prime.
		

Crossrefs

Programs

  • Maple
    A109611 := proc(n)
        option remember;
        if n =1 then
            2;
        else
            a := nextprime(procname(n-1)) ;
            while true do
                if isprime(a+2) or numtheory[bigomega](a+2) = 2 then
                    return a;
                end if;
                a := nextprime(a) ;
            end do:
        end if;
    end proc: # R. J. Mathar, Apr 26 2013
  • Mathematica
    semiPrimeQ[x_] := TrueQ[Plus @@ Last /@ FactorInteger[ x ] == 2]; Select[Prime[Range[100]], PrimeQ[ # + 2] || semiPrimeQ[ # + 2] &] (* Alonso del Arte, Aug 08 2005 *)
    SequencePosition[PrimeOmega[Range[500]], {1, , 1|2}][[All, 1]] (* _Jean-François Alcover, Feb 10 2018 *)
  • PARI
    isA001358(n)= if( bigomega(n)==2, return(1), return(0) );
    isA109611(n)={ if( ! isprime(n), return(0), if( isprime(n+2), return(1), return( isA001358(n+2)) ); ); }
    { n=1; for(i=1,90000, p=prime(i); if( isA109611(p), print(n," ",p); n++; ); ); } \\ R. J. Mathar, Aug 20 2006
    
  • PARI
    list(lim)=my(v=List([2]),semi=List(),L=lim+2,p=3); forprime(q=3,L\3, forprime(r=3,min(L\q,q), listput(semi,q*r))); semi=Set(semi); forprime(q=7,lim, if(setsearch(semi,q+2), listput(v,q))); forprime(q=5,L, if(q-p==2, listput(v,p)); p=q); Set(v) \\ Charles R Greathouse IV, Aug 25 2017
    
  • Python
    from sympy import isprime, primeomega
    def ok(n): return isprime(n) and (primeomega(n+2) < 3)
    print(list(filter(ok, range(1, 410)))) # Michael S. Branicky, May 08 2021

Formula

a(n)+2 = A139690(n).
Sum_{n>=1} 1/a(n) converges (Zhou, 2009). - Amiram Eldar, Jun 10 2021

Extensions

Corrected by Alonso del Arte, Aug 08 2005

A338913 Greater prime index of the n-th semiprime.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 20 2020

Keywords

Comments

A semiprime is a product of any two prime numbers. A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
After the first three terms, there appear to be no adjacent equal terms.

Examples

			The semiprimes are:
  2*2, 2*3, 3*3, 2*5, 2*7, 3*5, 3*7, 2*11, 5*5, 2*13, ...
so the greater prime factors are:
  2, 3, 3, 5, 7, 5, 7, 11, 5, 13, ...
with indices:
  1, 2, 2, 3, 4, 3, 4, 5, 3, 6, ...
		

Crossrefs

A115392 lists positions of first appearances of each positive integer.
A270652 is the squarefree case, with lesser part A270650.
A338898 has this as second column.
A338912 is the corresponding lesser prime index.
A001221 counts distinct prime indices.
A001222 counts prime indices.
A001358 lists semiprimes, with odd/even terms A046315/A100484.
A006881 lists squarefree semiprimes, with odd/even terms A046388/A100484.
A087794/A176504/A176506 are product/sum/difference of semiprime indices.
A338910/A338911 list products of pairs of odd/even-indexed primes.

Programs

  • Mathematica
    Table[Max[PrimePi/@First/@FactorInteger[n]],{n,Select[Range[100],PrimeOmega[#]==2&]}]

Formula

a(n) = A000720(A084127(n)).

A338898 Concatenated sequence of prime indices of semiprimes (A001358).

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 1, 3, 1, 4, 2, 3, 2, 4, 1, 5, 3, 3, 1, 6, 2, 5, 1, 7, 3, 4, 1, 8, 2, 6, 1, 9, 4, 4, 2, 7, 3, 5, 2, 8, 1, 10, 1, 11, 3, 6, 2, 9, 1, 12, 4, 5, 1, 13, 3, 7, 1, 14, 2, 10, 4, 6, 2, 11, 1, 15, 3, 8, 1, 16, 2, 12, 3, 9, 1, 17, 4, 7, 5, 5, 1, 18, 2
Offset: 1

Views

Author

Gus Wiseman, Nov 15 2020

Keywords

Comments

This is a triangle with two columns and weakly increasing rows, namely {A338912(n), A338913(n)}.
A semiprime is a product of any two prime numbers. A prime index of n is a number m such that the m-th prime number divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The sequence of semiprimes together with their prime indices begins:
      4: {1,1}     46: {1,9}      91: {4,6}     141: {2,15}
      6: {1,2}     49: {4,4}      93: {2,11}    142: {1,20}
      9: {2,2}     51: {2,7}      94: {1,15}    143: {5,6}
     10: {1,3}     55: {3,5}      95: {3,8}     145: {3,10}
     14: {1,4}     57: {2,8}     106: {1,16}    146: {1,21}
     15: {2,3}     58: {1,10}    111: {2,12}    155: {3,11}
     21: {2,4}     62: {1,11}    115: {3,9}     158: {1,22}
     22: {1,5}     65: {3,6}     118: {1,17}    159: {2,16}
     25: {3,3}     69: {2,9}     119: {4,7}     161: {4,9}
     26: {1,6}     74: {1,12}    121: {5,5}     166: {1,23}
     33: {2,5}     77: {4,5}     122: {1,18}    169: {6,6}
     34: {1,7}     82: {1,13}    123: {2,13}    177: {2,17}
     35: {3,4}     85: {3,7}     129: {2,14}    178: {1,24}
     38: {1,8}     86: {1,14}    133: {4,8}     183: {2,18}
     39: {2,6}     87: {2,10}    134: {1,19}    185: {3,12}
		

Crossrefs

A112798 restricted to rows of length 2 gives this triangle.
A115392 is the row number for the first appearance of each positive integer.
A176506 gives row differences.
A338899 is the squarefree version.
A338912 is column 1.
A338913 is column 2.
A001221 counts a number's distinct prime indices.
A001222 counts a number's prime indices.
A001358 lists semiprimes.
A004526 counts 2-part partitions.
A006881 lists squarefree semiprimes.
A037143 lists primes and semiprimes.
A046315 and A100484 list odd and even semiprimes.
A046388 and A100484 list odd and even squarefree semiprimes.
A065516 gives first differences of semiprimes.
A084126 and A084127 give the prime factors of semiprimes.
A270650 and A270652 give the prime indices of squarefree semiprimes.
A320655 counts factorizations into semiprimes.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Join@@primeMS/@Select[Range[100],PrimeOmega[#]==2&]

A338912 Lesser prime index of the n-th semiprime.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 4, 2, 3, 2, 1, 1, 3, 2, 1, 4, 1, 3, 1, 2, 4, 2, 1, 3, 1, 2, 3, 1, 4, 5, 1, 2, 2, 4, 1, 2, 1, 5, 3, 1, 3, 1, 2, 4, 1, 6, 2, 1, 2, 3, 5, 1, 2, 1, 4, 3, 1, 5, 2, 1, 3, 4, 1, 2, 6, 1, 3, 2, 6, 2, 5, 1, 4, 1, 3, 2, 1
Offset: 1

Views

Author

Gus Wiseman, Nov 20 2020

Keywords

Comments

A semiprime is a product of any two prime numbers. A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The semiprimes are:
  2*2, 2*3, 3*3, 2*5, 2*7, 3*5, 3*7, 2*11, 5*5, 2*13, ...
so the lesser prime factors are:
  2, 2, 3, 2, 2, 3, 3, 2, 5, 2, ...
with indices:
  1, 1, 2, 1, 1, 2, 2, 1, 3, 1, ...
		

Crossrefs

A084126 is the lesser prime factor (not index).
A084127 is the greater factor, with index A338913.
A115392 lists positions of ones.
A128301 lists positions of first appearances of each positive integer.
A270650 is the squarefree case, with greater part A270652.
A338898 has this as first column.
A001221 counts distinct prime indices.
A001222 counts prime indices.
A001358 lists semiprimes, with odds A046315 and evens A100484.
A006881 lists squarefree semiprimes, with odds A046388 and evens A100484.
A087794/A176504/A176506 are product/sum/difference of semiprime indices.
A338910/A338911 list products of pairs of odd/even-indexed primes.

Programs

  • Mathematica
    Table[Min[PrimePi/@First/@FactorInteger[n]],{n,Select[Range[100],PrimeOmega[#]==2&]}]

Formula

a(n) = A000720(A084126(n)).

A033942 Positive integers with at least 3 prime factors (counted with multiplicity).

Original entry on oeis.org

8, 12, 16, 18, 20, 24, 27, 28, 30, 32, 36, 40, 42, 44, 45, 48, 50, 52, 54, 56, 60, 63, 64, 66, 68, 70, 72, 75, 76, 78, 80, 81, 84, 88, 90, 92, 96, 98, 99, 100, 102, 104, 105, 108, 110, 112, 114, 116, 117, 120, 124, 125, 126, 128, 130, 132, 135, 136, 138, 140, 144
Offset: 1

Views

Author

Keywords

Comments

A001055(a(n)) > 2; e.g., for a(3)=18 there are 4 factorizations: 1*18 = 2*9 = 2*3*3 = 3*6. - Reinhard Zumkeller, Dec 29 2001
A001222(a(n)) > 2; A054576(a(n)) > 1. - Reinhard Zumkeller, Mar 10 2006
Also numbers such that no permutation of all divisors exists with coprime adjacent elements: A109810(a(n))=0. - Reinhard Zumkeller, May 24 2010
A211110(a(n)) > 3. - Reinhard Zumkeller, Apr 02 2012
A060278(a(n)) > 0. - Reinhard Zumkeller, Apr 05 2013
Volumes of rectangular cuboids with each side > 1. - Peter Woodward, Jun 16 2015
If k is a term then so is k*m for m > 0. - David A. Corneth, Sep 30 2020
Numbers k with a pair of proper divisors of k, (d1,d2), such that d1 < d2 and gcd(d1,d2) > 1. - Wesley Ivan Hurt, Jan 01 2021

Crossrefs

Cf. A014612.
A101040(a(n))=0.
A033987 is a subsequence; complement of A037143. - Reinhard Zumkeller, May 24 2010
Subsequence of A080257.
See also A002808 for 'Composite numbers' or 'Divisible by at least 2 primes'.

Programs

  • Haskell
    a033942 n = a033942_list !! (n-1)
    a033942_list = filter ((> 2) . a001222) [1..]
    -- Reinhard Zumkeller, Oct 27 2011
    
  • Maple
    with(numtheory): A033942:=n->`if`(bigomega(n)>2, n, NULL): seq(A033942(n), n=1..200); # Wesley Ivan Hurt, Jun 23 2015
  • Mathematica
    Select[ Range[150], Plus @@ Last /@ FactorInteger[ # ] > 2 &] (* Robert G. Wilson v, Oct 12 2005 *)
    Select[Range[150],PrimeOmega[#]>2&] (* Harvey P. Dale, Jun 22 2011 *)
  • PARI
    is(n)=bigomega(n)>2 \\ Charles R Greathouse IV, May 04 2013
    
  • Python
    from sympy import factorint
    def ok(n): return sum(factorint(n).values()) > 2
    print([k for k in range(145) if ok(k)]) # Michael S. Branicky, Sep 10 2022
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange
    def A033942(n):
        def f(x): return int(n+primepi(x)+sum(primepi(x//k)-a for a,k in enumerate(primerange(isqrt(x)+1))))
        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

Numbers of the form Product p_i^e_i with Sum e_i >= 3.
a(n) ~ n. - Charles R Greathouse IV, May 04 2013

Extensions

Corrected by Patrick De Geest, Jun 15 1998

A320663 Number of non-isomorphic multiset partitions of weight n using singletons or pairs.

Original entry on oeis.org

1, 1, 4, 7, 21, 40, 106, 216, 534, 1139, 2715, 5962, 14012, 31420, 73484, 167617, 392714, 908600, 2140429, 5015655, 11905145, 28228533, 67590229, 162067916, 391695348, 949359190, 2316618809, 5673557284, 13979155798, 34583650498, 86034613145, 214948212879
Offset: 0

Views

Author

Gus Wiseman, Oct 18 2018

Keywords

Examples

			Non-isomorphic representatives of the a(1) = 1 through a(4) = 21 multiset partitions:
  {{1}}  {{1,1}}    {{1},{1,1}}    {{1,1},{1,1}}
         {{1,2}}    {{1},{2,2}}    {{1,1},{2,2}}
         {{1},{1}}  {{1},{2,3}}    {{1,2},{1,2}}
         {{1},{2}}  {{2},{1,2}}    {{1,2},{2,2}}
                    {{1},{1},{1}}  {{1,2},{3,3}}
                    {{1},{2},{2}}  {{1,2},{3,4}}
                    {{1},{2},{3}}  {{1,3},{2,3}}
                                   {{1},{1},{1,1}}
                                   {{1},{1},{2,2}}
                                   {{1},{1},{2,3}}
                                   {{1},{2},{1,2}}
                                   {{1},{2},{2,2}}
                                   {{1},{2},{3,3}}
                                   {{1},{2},{3,4}}
                                   {{1},{3},{2,3}}
                                   {{2},{2},{1,2}}
                                   {{1},{1},{1},{1}}
                                   {{1},{1},{2},{2}}
                                   {{1},{2},{2},{2}}
                                   {{1},{2},{3},{3}}
                                   {{1},{2},{3},{4}}
		

Crossrefs

Programs

  • PARI
    EulerT(v)={Vec(exp(x*Ser(dirmul(v,vector(#v,n,1/n))))-1, -#v)}
    permcount(v) = {my(m=1,s=0,k=0,t); for(i=1,#v,t=v[i]; k=if(i>1&&t==v[i-1],k+1,1); m*=t*k;s+=t); s!/m}
    gs(v) = {sum(i=2, #v, sum(j=1, i-1, my(g=gcd(v[i],v[j])); g*x^(2*v[i]*v[j]/g))) + sum(i=1, #v, my(r=v[i]); (1 + (1+r)%2)*x^r + ((1+r)\2)*x^(2*r))}
    a(n)={my(s=0); forpart(p=n, s+=permcount(p)*EulerT(Vec(gs(p) + O(x*x^n), -n))[n]); s/n!} \\ Andrew Howroyd, Oct 26 2018

Extensions

Terms a(11) and beyond from Andrew Howroyd, Oct 26 2018

A320732 Number of factorizations of n into primes or semiprimes.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 20 2018

Keywords

Examples

			The a(60) = 5 factorizations are (2*2*3*5), (2*2*15), (2*3*10), (2*5*6), (3*4*5), (4*15), (6*10).
		

Crossrefs

Programs

  • Mathematica
    psemfacs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[psemfacs[n/d],Min@@#>=d&]],{d,Select[Rest[Divisors[n]],PrimeOmega[#]<=2&]}]];
    Table[Length[psemfacs[n]],{n,100}]
Showing 1-10 of 70 results. Next