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

A085366 Semiprimes that are the sum of two positive cubes. Common terms of A003325 and A046315.

Original entry on oeis.org

9, 35, 65, 91, 133, 217, 341, 407, 559, 737, 793, 1027, 1241, 1339, 1343, 1843, 1853, 2071, 2413, 2771, 2869, 3197, 3383, 3439, 3473, 4097, 4439, 5129, 5833, 6119, 6641, 7471, 7859, 8027, 8587, 9773, 10261, 10649, 10991, 11377, 12679, 12913, 14023
Offset: 1

Views

Author

Hugo Pfoertner, Jun 25 2003

Keywords

Comments

Sum of two positive cubes x^3 + y^3 such that both x+y and x^2 - x*y + y^2 are primes.
The only square is 9. Also, all terms have a unique representation as a sum of two distinct positive cubes. - Zak Seidov, Jun 02 2011

Examples

			a(2) = 35 because 3^3 + 2^3 = 5*7.
a(5) = 133 = 5^3 + 2^3 = (5+2)*(5^2 - 5*2 + 2^2) = 7*19.
		

Crossrefs

A085770 Number of odd semiprimes < 10^n. Number of terms of A046315 < 10^n.

Original entry on oeis.org

0, 1, 19, 204, 1956, 18245, 168497, 1555811, 14426124, 134432669, 1258822220, 11840335764, 111817881036, 1059796387004, 10076978543513, 96091983644261, 918679875630905, 8803388145953381, 84537081118605467, 813340036541900706, 7838825925851034479, 75669246175972479567
Offset: 0

Views

Author

Hugo Pfoertner, Jul 22 2003

Keywords

Examples

			a(1)=1 because A046315(1)=9=3*3 is the only odd semiprime < 10^1,
a(2)=19 because there are 19 terms of A046315 < 10^2.
		

Crossrefs

Cf. A046315 (odd numbers divisible by exactly 2 primes), A066265 (number of semiprimes < 10^n), A220262, A292785.

Programs

  • Mathematica
    OddSemiPrimePi[n_] := Sum[ PrimePi[n/Prime@i] - i + 1, {i, 2, PrimePi@ Sqrt@ n}]; Table[ OddSemiPrimePi[10^n], {n, 14}] (* Robert G. Wilson v, Feb 02 2006 *)
  • Python
    from math import isqrt
    from sympy import primepi, primerange
    def A085770(n): return int((-(t:=primepi(s:=isqrt(m:=10**n)))*(t-1)>>1)+sum(primepi(m//k) for k in primerange(3, s+1))) if n>1 else n # Chai Wah Wu, Oct 17 2024

Formula

a(n) = A066265(n) - A220262(n) for n > 1. - Jinyuan Wang, Jul 30 2021

Extensions

a(10)-a(14) from Robert G. Wilson v, Feb 02 2006
a(15)-a(16) from Donovan Johnson, Mar 18 2010
a(0) inserted by and a(17)-a(21) from Jinyuan Wang, Jul 30 2021

A114057 Start of record gap in odd semiprimes A046315.

Original entry on oeis.org

9, 25, 39, 95, 267, 2369, 6559, 8817, 13705, 15261, 21583, 35981, 66921, 113009, 340891, 783757, 872219, 3058853, 3586843, 5835191, 12345473, 108994623, 248706917, 268749691, 679956119, 709239621, 3648864859, 3790337723, 4171420481, 33955869693, 34279038379
Offset: 1

Views

Author

Jonathan Vos Post, Feb 02 2006

Keywords

Comments

3 of the first 5 values of record gaps in odd semiprimes are also record merits = (A046315(k+1)-A046315(k))/log_10(A046315(k)), namely: (15 - 9) / log_10(9) = 6.28770982; (111 - 95) / log_10(95) = 8.09010923; (287 - 267) / log_10(267) = 8.24228608. It is easy to prove that there are gaps of arbitrary length in even semiprimes (A100484); can we prove that there are gaps of arbitrary length in odd semiprimes (A046315) and in semiprimes (A001358)?
The record gaps have lengths 6, 8, 10, 16, 20, 22, 24, 26, 28, 32, 36, 38, 40, 44, 50, 52, 60, 64, 70, 74. - T. D. Noe, Feb 03 2006

Examples

			a(1) = A046315(2)-A046315(1) = 15 - 9 = 6.
a(2) = A046315(5)-A046315(4) = 33 - 25 = 8.
a(3) = A046315(8)-A046315(7) = 49 - 39 = 10.
a(4) = A046315(20)-A046315(19) = 111 - 95 = 16.
a(5) = A046315(55)-A046315(54) = 287 - 267 = 20.
		

Crossrefs

Starting at a(4)=95 the known terms of this sequence coincide with A350098.

Programs

  • Mathematica
    f[n_] := Block[{k = n + 2}, While[ Plus @@ Last /@ FactorInteger@k != 2, k += 2]; k]; lst = {}; d = 0; a = b = 9; Do[{a, b} = {b, f[a]}; If[b - a > d, d = b - a; AppendTo[lst, a]], {n, 10^8}]; lst (* Robert G. Wilson v, Feb 03 2006 *)

Formula

{a(n)} = {A046315(k) such that A046315(k+1)-A046315(k) is a record}.

Extensions

More terms from Robert G. Wilson v and T. D. Noe, Feb 03 2006
a(23)-a(28) from Donovan Johnson, Mar 14 2010
a(29)-a(31) from Donovan Johnson, Oct 20 2012

A221048 The odd semiprime numbers (A046315) which are orders of a non-Abelian group.

Original entry on oeis.org

21, 39, 55, 57, 93, 111, 129, 155, 183, 201, 203, 205, 219, 237, 253, 291, 301, 305, 309, 327, 355, 381, 417, 453, 471, 489, 497, 505, 543, 579, 597, 633, 655, 669, 687, 689, 723, 737, 755, 791, 813, 831, 849, 889, 905, 921, 939, 955, 979, 993, 1011, 1027, 1047
Offset: 1

Views

Author

David Brown, Apr 14 2013

Keywords

Comments

Numbers of the form pq where p,q are odd primes, p
The corresponding non-Abelian groups are the semidirect products of Z/qZ and Z/pZ. - Bernard Schott, May 16 2020

Crossrefs

Intersection of A046315 and A060652.

Programs

  • Mathematica
    Select[1 + 2*Range[500], (f = FactorInteger[#]; Last /@ f == {1, 1} && Mod @@ Reverse[First /@ f] == 1) &] (* Giovanni Resta, Apr 14 2013 *)
  • PARI
    lista(nn) = {forstep(n=1, nn, 2, my(f=factor(n)); if ((#f~ == 2) && (vecmax(f[,2]) == 1) && ((f[2,1] % f[1,1]) == 1), print1(n, ", ")););} \\ Michel Marcus, Sep 28 2017
    
  • PARI
    list(lim)=my(v=List()); if(lim<9, return([])); forprime(p=3,sqrtint(((lim\=1)-1)\2), forprimestep(q=2*p+1,lim,2*p, listput(v, p*q))); Set(v) \\ Charles R Greathouse IV, Feb 08 2021

Extensions

More terms from Jinyuan Wang, May 16 2020

A075730 Squares of odd semiprimes A046315, odd numbers divisible by exactly 2 primes (counted with multiplicity).

Original entry on oeis.org

81, 225, 441, 625, 1089, 1225, 1521, 2401, 2601, 3025, 3249, 4225, 4761, 5929, 7225, 7569, 8281, 8649, 9025, 12321, 13225, 14161, 14641, 15129, 16641, 17689, 19881, 20449, 21025, 24025, 25281, 25921, 28561, 31329, 33489, 34225, 34969, 40401
Offset: 1

Author

Jani Melik, Oct 07 2002

Keywords

Examples

			9 is odd and divisible by 3 (twice) and 9*9=81.
15 is odd and divisible by 3 and 5 and 15*15=225.
		

Crossrefs

Equals A046315(n)^2.

Programs

  • Maple
    readlib(issqr): ts_kv_sp_lih := proc(n); if (numtheory[bigomega](n)=4 and type(n,odd)='true' and issqr(n)='true') then RETURN(n); fi; end: seq(ts_kv_sp_lih(i), i=1..100000);
  • Mathematica
    Select[Range[1, 201, 2], PrimeOmega[#] == 2 &]^2 (* Amiram Eldar, Mar 22 2021 *)

Formula

Sum_{n>=1} 1/a(n) = P(2)^2/2 + P(4)/2 - P(2)/4 = 0.02769857933..., where P is the prime zeta function. - Amiram Eldar, Mar 22 2021

Extensions

Checked by Zak Seidov, Mar 08 2006

A280912 Number of partitions of n into odd semiprimes (A046315).

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 2, 0, 0, 2, 1, 1, 2, 0, 0, 3, 1, 0, 3, 1, 1, 3, 1, 0, 4, 2, 2, 5, 1, 1, 5, 3, 1, 6, 3, 2, 8, 2, 1, 7, 5, 4, 9, 4, 3, 11, 6, 3, 11, 6, 6, 14, 7, 5, 15, 9, 7, 16, 9, 8, 20, 14, 9, 21, 13, 11, 26, 16, 12, 28, 19, 17, 29, 19, 17, 37, 27
Offset: 0

Author

Ilya Gutkovskiy, Jan 10 2017

Keywords

Examples

			a(39) = 3 because we have [39], [21, 9, 9] and [15, 15, 9].
		

Programs

Formula

G.f.: Product_{k>=1} 1/(1 - floor(bigomega(2*k+1)/2)*floor(2/bigomega(2*k+ 1))*x^(2*k+1)), where bigomega(k) is the number of prime divisors of k counted with multiplicity (A001222).

A316780 a(n) is the least positive integer k such that ceiling(sqrt(A046315(n)*k))^2 - A046315(n)*k is a square.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 3, 1, 5, 1, 3, 7, 1, 7, 3, 9, 3, 3, 1, 9, 9, 3, 11, 1, 5, 5, 13, 3, 1, 15, 15, 5, 1, 17, 3, 5, 1, 17, 7, 3, 17, 1, 7, 19, 1, 21, 3, 5, 7, 23, 5, 1, 25, 9, 1, 5, 25, 9, 27, 3, 27, 1, 29, 5, 11, 29, 3, 11, 1, 11, 5, 3, 33, 1, 35, 13
Offset: 1

Author

Arnauld Chevallier, Jul 13 2018

Keywords

Comments

Fermat's factorization helper multiplier for the n-th odd semiprime.
a(n) is the least positive integer such that A046315(n) * a(n) can be factorized with a single iteration of Fermat's factorization method. Using the factorization of a(n), we can then deduce the prime factors of A046315(n). Example for n = 35490: A046315(n) = 199163 and a(n) = 40; ceiling(sqrt(199163*40)) = 2823; 199163*40 = 2823^2 - 2809 = 2823^2 - 53^2 = (2823+53)(2823-53) = 2876*2770, leading to 199163*(2*2*2*5) = (2*2*719)*(2*5*277) and eventually 199163 = 719*277.

Examples

			a(18) = 7 because the 18th odd semiprime is A046315(18) = 93, ceiling(sqrt(93*7))^2 - 93*7 = 25 is a perfect square and 7 is the least positive integer for which this holds.
		

Crossrefs

Cf. A046315.

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

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

A100484 The primes doubled; Even semiprimes.

Original entry on oeis.org

4, 6, 10, 14, 22, 26, 34, 38, 46, 58, 62, 74, 82, 86, 94, 106, 118, 122, 134, 142, 146, 158, 166, 178, 194, 202, 206, 214, 218, 226, 254, 262, 274, 278, 298, 302, 314, 326, 334, 346, 358, 362, 382, 386, 394, 398, 422, 446, 454, 458, 466, 478, 482, 502, 514, 526
Offset: 1

Author

Reinhard Zumkeller, Nov 22 2004

Keywords

Comments

Essentially the same as A001747.
Right edge of the triangle in A065342. - Reinhard Zumkeller, Jan 30 2012
A253046(a(n)) > a(n). - Reinhard Zumkeller, Dec 26 2014
Apart from first term, these are the tau2-primes as defined in [Anderson, Frazier] and [Lanterman]. - Michel Marcus, May 15 2019
For every positive integer b and each m in this sequence b^(m-1) == b (mod m). - Florian Baur, Nov 26 2021

Crossrefs

Subsequence of A091376. After the initial 4 also a subsequence of A039956.
Cf. A001748, A253046, A353478 (characteristic function).
Row 3 of A286625, column 3 of A286623.

Programs

Formula

a(n) = 2 * A000040(n).
a(n) = A001747(n+1).
n>1: A000005(a(n)) = 4; A000203(a(n)) = 3*A008864(n); A000010(a(n)) = A006093(n); intersection of A001358 and A005843.
a(n) = A116366(n-1, n-1) for n>1. - Reinhard Zumkeller, Feb 06 2006
a(n) = A077017(n+1), n>1. - R. J. Mathar, Sep 02 2008
A078834(a(n)) = A000040(n). - Reinhard Zumkeller, Sep 19 2011
a(n) = A087112(n, 1). - Reinhard Zumkeller, Nov 25 2012
A000203(a(n)) = 3*n/2 + 3, n > 1. - Wesley Ivan Hurt, Sep 07 2013

Extensions

Simpler definition.

A046388 Odd numbers of the form p*q where p and q are distinct primes.

Original entry on oeis.org

15, 21, 33, 35, 39, 51, 55, 57, 65, 69, 77, 85, 87, 91, 93, 95, 111, 115, 119, 123, 129, 133, 141, 143, 145, 155, 159, 161, 177, 183, 185, 187, 201, 203, 205, 209, 213, 215, 217, 219, 221, 235, 237, 247, 249, 253, 259, 265, 267, 287, 291, 295, 299, 301, 303
Offset: 1

Author

Patrick De Geest, Jun 15 1998

Keywords

Comments

These are the odd squarefree semiprimes.
These numbers k have the property that k is a Fermat pseudoprime for at least two bases 1 < b < k - 1. That is, b^(k - 1) == 1 (mod k). See sequence A175101 for the number of bases. - Karsten Meyer, Dec 02 2010

Crossrefs

Intersection of A005117 and A046315, or equally, of A005408 and A006881, or of A001358 and A056911.
Union of A080774 and A190299, which the latter is the union of A131574 and A016105.
Subsequence of A024556 and of A225375.
Cf. A353481 (characteristic function).
Different from A056913, A098905, A225375.

Programs

  • Haskell
    a046388 n = a046388_list !! (n-1)
    a046388_list = filter ((== 2) . a001221) a056911_list
    -- Reinhard Zumkeller, Jan 02 2014
    
  • Mathematica
    max = 300; A046388 = Sort@Flatten@Table[Prime[m] Prime[n], {n, 3, Ceiling[PrimePi[max/3]]}, {m, 2, n - 1}]; Select[A046388, # < max &] (* Alonso del Arte based on Robert G. Wilson v's program for A006881, Oct 24 2011 *)
  • PARI
    isok(n) = (n % 2) && (bigomega(n) == 2) && (omega(n)==2); \\ Michel Marcus, Feb 05 2015
    
  • Python
    from sympy import factorint
    def ok(n):
        if n < 2 or n%2 == 0: return False
        f = factorint(n)
        return len(f) == 2 and sum(f.values()) == 2
    print([k for k in range(304) if ok(k)]) # Michael S. Branicky, May 03 2022
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange
    def A046388(n):
        if n == 1: return 15
        def f(x): return int(n-1+x+(t:=primepi(s:=isqrt(x)))+(t*(t-1)>>1)-sum(primepi(x//k) for k in primerange(3, s+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,n,n) # Chai Wah Wu, Sep 10 2024

Formula

Sum_{n>=1} 1/a(n)^s = (1/2)*(P(s)^2 - P(2*s)) + 1/4^s - P(s)/2^s, for s>1, where P is the prime zeta function. - Amiram Eldar, Nov 21 2020

Extensions

I removed some ambiguity in the definition and edited the entry, merging in some material from A146166. - N. J. A. Sloane, May 09 2013
Showing 1-10 of 121 results. Next