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

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

Original entry on oeis.org

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

Views

Author

Keywords

Comments

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

Examples

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

References

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

Crossrefs

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

Programs

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

Formula

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

Extensions

More terms from James Sellers, Aug 22 2000

A064911 If n is semiprime (or 2-almost prime) then 1 else 0.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Patrick De Geest, Oct 13 2001

Keywords

Crossrefs

Programs

  • Haskell
    a064911 = a010051 . a032742 -- Reinhard Zumkeller, Mar 13 2011
    
  • Maple
    with(numtheory):
    a:= n-> `if`(bigomega(n)=2, 1, 0):
    seq(a(n), n=1..120);  # Alois P. Heinz, Mar 16 2011
  • Mathematica
    Table[If[PrimeOmega[n] == 2, 1, 0], {n, 105}] (* Jayanta Basu, May 25 2013 *)
  • PARI
    a(n)=bigomega(n)==2 \\ Charles R Greathouse IV, Mar 13 2011

Formula

a(n) = 1 iff n is in A001358 (semiprimes), a(n) = 0 iff n is in A100959 (non-semiprimes). - Reinhard Zumkeller, Nov 24 2004
Dirichlet g.f.: (primezeta(2s) + primezeta(s)^2)/2. - Franklin T. Adams-Watters, Jun 09 2006
a(n) = A057427(A174956(n)); a(n)*A072000(n) = A174956(n). - Reinhard Zumkeller, Apr 03 2010
a(n) = A010051(A032742(n)) (i.e., largest proper divisor is prime). - Reinhard Zumkeller, Mar 13 2011
From Antti Karttunen, Apr 24 2018 & Apr 22 2022: (Start)
a(n) = A280710(n) + A302048(n) = A101040(n) - A010051(n).
a(n) = A353478(n) + A353480(n) = A353477(n) + A353478(n) + A353479(n).
a(n) = A353475(n) + A353476(n).
(End)
a(n) = [Omega(n) = 2], where [ ] is the Iverson bracket. - Wesley Ivan Hurt, Jul 22 2025

Extensions

Edited by M. F. Hasler, Oct 18 2017

A072000 Number of semiprimes (A001358) <= n.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Jun 19 2002

Keywords

Comments

Number of k <= n such that bigomega(k) = 2.

References

  • A. Hildebrand, On the number of prime factors of an integer, in Ramanujan Revisited (Urbana-Champaign, Ill., 1987), pp. 167-185, Academic Press, Boston, MA, 1988.
  • E. Landau, Handbuch der Lehre von der Verteilung der Primzahlen, vol. 1, Teubner, Leipzig, 1909; third edition : Chelsea, New York (1974).
  • G. Tenenbaum, Introduction à la théorie analytique et probabiliste des nombres, p. 203, Publications de l'Institut Cartan, 1990.

Crossrefs

Programs

  • Maple
    A072000 := proc(n) local sp,t ; sp := 0 ; for t from 1 to n do if numtheory[bigomega](t) = 2 then sp := sp+1 ; fi ; od ; sp ; end proc: # R. J. Mathar, Jun 10 2007
  • Mathematica
    semiPrimePi[n_] := Sum[ PrimePi[n/Prime@i] -i + 1, {i, PrimePi@Sqrt@n}]; Array[semiPrimePi, 78] (* Robert G. Wilson v, Jan 03 2006 *)
    (* If version >= 7 *) a[n_] := Select[Range[n], PrimeOmega[#] == 2 &] // Length; Table[a[n], {n, 1, 77}] (* Jean-François Alcover, Jun 29 2013 *)
    Accumulate[Table[If[PrimeOmega[n]==2,1,0],{n,100}]] (* Harvey P. Dale, Jun 14 2014 *)
  • PARI
    for(n=1,100,print1(sum(i=1,n,if(bigomega(i)-2,0,1)),","))
    
  • PARI
    a(n)=my(s=0,i=0); forprime(p=2, sqrt(n), s+=primepi(n\p); i++); s - i * (i-1)/2 \\ Charles R Greathouse IV, Apr 21 2011
    
  • Python
    from math import isqrt
    from sympy import primepi, prime
    def A072000(n): return int(sum(primepi(n//prime(k))-k+1 for k in range(1,primepi(isqrt(n))+1))) # Chai Wah Wu, Jul 23 2024

Formula

Let PrimePi(x) denote the number of primes <= x (cf. A000720). Then 2*a(n) = Sum_{ primes p <= n/2 } PrimePi(n/p) + PrimePi(sqrt(n)). [Landau, p. 211]
Let PrimePi(x) denote the number of primes <= x (cf. A000720). Then a(n) = Sum_{i=1..PrimePi(sqrt(n))} (PrimePi(n/prime(i)) - i + 1). - Robert G. Wilson v, Feb 07 2006
a(n) = card { x <= n : bigomega(x) = 2 }.
Asymptotically a(n) ~ n*log(log(n))/log(n). [Landau, p. 211]
Let A be a positive integer. Then card { x <= n : bigomega(x) = A } ~ (n/log(n))*log(log(n))^(A-1)/(A-1)! [Landau, p. 211]
a(n) = A072613(n) + A056811(n). - R. J. Mathar, Jun 10 2007
a(n) = Sum_{i=1..n} A064911(i). - Jonathan Vos Post, Dec 30 2007
a(n)*A064911(n) = A174956(n). - Reinhard Zumkeller, Apr 03 2010

Extensions

Edited by Robert G. Wilson v, Feb 15 2006

A100959 Non-semiprimes.

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 11, 12, 13, 16, 17, 18, 19, 20, 23, 24, 27, 28, 29, 30, 31, 32, 36, 37, 40, 41, 42, 43, 44, 45, 47, 48, 50, 52, 53, 54, 56, 59, 60, 61, 63, 64, 66, 67, 68, 70, 71, 72, 73, 75, 76, 78, 79, 80, 81, 83, 84, 88, 89, 90, 92, 96, 97, 98, 99, 100, 101, 102, 103, 104
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 24 2004

Keywords

Comments

A001222(a(n)) <> 2; a(n) <> A020639(a(n)) * A006530(a(n)); complement of A001358; A064911(a(n)) = 0.
A174956(a(n)) = 0. - Reinhard Zumkeller, Apr 03 2010

Programs

  • Mathematica
    Select[Range[120], ! PrimeOmega[#] == 2 &] (* Vincenzo Librandi, Jun 14 2014 *)
  • PARI
    isok(n) = (bigomega(n) != 2) \\ Michel Marcus, Aug 01 2013
    
  • Python
    from math import isqrt
    from sympy import prime, primepi
    def A100959(n):
        def f(x): return n+int(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 + O(n log log n/log n). - Charles R Greathouse IV, Dec 29 2024

A138511 Semiprimes where the larger prime factor is greater than the square of the smaller prime factor, short: semiprimes p*q, p^2 < q.

Original entry on oeis.org

10, 14, 22, 26, 33, 34, 38, 39, 46, 51, 57, 58, 62, 69, 74, 82, 86, 87, 93, 94, 106, 111, 118, 122, 123, 129, 134, 141, 142, 145, 146, 155, 158, 159, 166, 177, 178, 183, 185, 194, 201, 202, 205, 206, 213, 214, 215, 218, 219, 226, 235, 237, 249, 254, 262, 265, 267, 274, 278, 291, 295, 298, 302, 303, 305
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 21 2008

Keywords

Comments

From Antti Karttunen, Dec 17 2014, further edited Jan 01 & 04 2014: (Start)
Semiprimes p*q, p < q, such that the smallest r for which r^k <= p and q < r^(k+1) [for some k >= 0] is q+1, and thus k = 0. In other words, semiprimes whose both prime factors do not fit (simultaneously) between any two consecutive powers of any natural number r less than or equal to the larger prime factor. This condition forces the larger prime factor q to be greater than the square of the smaller prime factor because otherwise the opposite condition given in A251728 would hold.
Assuming that A054272(n), the number of primes in interval [prime(n), prime(n)^2], is nondecreasing (implied for example if Legendre's or Brocard's conjecture is true), these are also "unsettled" semiprimes that occur in a square array A083221 constructed from the sieve of Eratosthenes, "above the line A251719", meaning that if and only if row < A251719(col) then a semiprime occurring at A083221(row, col) is in this sequence, and conversely, all the semiprimes that occur at any position A083221(row, col) where row >= A251719(col) are in the complementary sequence A251728.
(End)
Semiprimes p*q, p < q, such that b = q+1 is the minimal base with the property that p and q have equal length representations in base b. This was the original definition, which is based primarily on A138510: A138510(A174956(a(n))) = A084127(A174956(a(n))) + 1.

Examples

			See A138510.
		

Crossrefs

Cf. A138510.
Complement of A251728 in A001358.
Subsequence of A088381.
An intersection of A001358 (semiprimes) and A251727.
Also an intersection of A001358 and A253569, from the latter which this sequence differs for the first time at n=60, where A253569(60) = 290, while here a(60) = 291.
Also an intersection A001358 and A245729.

Programs

Formula

Other identities. For all n >= 1 it holds that:
A138510(A174956(a(n))) = A084127(A174956(a(n))) + 1.

Extensions

Wrong comment corrected by Reinhard Zumkeller, Dec 16 2014
New definition by Antti Karttunen, Jan 01 2015; old definition moved to comment.
More terms from Antti Karttunen, Jan 09 2015

A138510 Smallest number b such that in base b the prime factors of the n-th semiprime (A001358) have equal lengths.

Original entry on oeis.org

1, 2, 1, 6, 8, 3, 3, 12, 1, 14, 12, 18, 2, 20, 14, 24, 1, 18, 4, 20, 30, 32, 4, 24, 38, 4, 42, 5, 44, 30, 4, 32, 48, 5, 54, 38, 5, 60, 5, 1, 62, 42, 44, 5, 68, 48, 72, 2, 30, 74, 32, 80, 54, 5, 84, 1, 60, 90, 62, 38, 3, 98, 68, 102, 6, 42, 104, 3, 72, 108, 44, 6, 110, 74, 3, 114, 48, 80
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 21 2008

Keywords

Comments

a(n) = 1 iff A001358(n) is the square of a prime (A001248);
Equally, 1 if A001358(n) = p^2, otherwise, if A001358(n) = p*q (p, q primes, p < q), then a(n) = A252375(n) = the least r such that r^k <= p < q < r^(k+1), for some k >= 0. - Antti Karttunen, Dec 16 2014
a(A174956(A085721(n))) <= 2. - Reinhard Zumkeller, Dec 19 2014

Examples

			For n=31, the n-th semiprime is A001358(31) = 91 = 7*13;
     7 =  111_2 =  21_3 = 13_4
and 13 = 1101_2 = 111_3 = 31_4, so a(31) = 4. [corrected by _Jon E. Schoenfield_, Sep 23 2018]
.
Illustration of initial terms, n <= 25:
.   n | A001358(n) =  p * q |  b = a(n) | p and q in base b
. ----+---------------------+-----------+-------------------
.   1 |       4       2   2 |      1    |     [1]        [1]
.   2 |       6       2   3 |      2    |   [1,0]      [1,1]
.   3 |       9       3   3 |      1    | [1,1,1]    [1,1,1]
.   4 |  **  10       2   5 |      6    |     [2]        [5]
.   5 |  **  14       2   7 |      8    |     [2]        [7]
.   6 |      15       3   5 |      3    |   [1,0]      [1,2]
.   7 |      21       3   7 |      3    |   [1,0]      [2,1]
.   8 |  **  22       2  11 |     12    |     [2]       [11]
.   9 |      25       5   5 |      1    |   [1]^5      [1]^5
.  10 |  **  26       2  13 |     14    |     [2]       [13]
.  11 |  **  33       3  11 |     12    |     [3]       [11]
.  12 |  **  34       2  17 |     18    |     [2]       [17]
.  13 |      35       5   7 |      2    | [1,0,1]    [1,1,1]
.  14 |  **  38       2  19 |     20    |     [2]       [19]
.  15 |  **  39       3  13 |     14    |     [3]       [13]
.  16 |  **  46       2  23 |     24    |     [2]       [23]
.  17 |      49       7   7 |      1    |   [1]^7      [1]^7
.  18 |  **  51       3  17 |     18    |     [3]       [17]
.  19 |      55       5  11 |      4    |   [1,1]      [2,3]
.  20 |  **  57       3  19 |     20    |     [3]       [19]
.  21 |  **  58       2  29 |     30    |     [2]       [29]
.  22 |  **  62       2  31 |     32    |     [2]       [31]
.  23 |      65       5  13 |      4    |   [1,1]      [3,1]
.  24 |  **  69       3  23 |     24    |     [3]       [23]
.  25 |  **  74       2  37 |     38    |     [2]       [37]
where p = A084126(n) and q = A084127(n),
semiprimes marked with ** indicate terms of A138511, i.e. b = q + 1.
		

Crossrefs

Programs

  • Haskell
    import Data.List (genericIndex, unfoldr); import Data.Tuple (swap)
    import Data.Maybe (mapMaybe)
    a138510 n = genericIndex a138510_list (n - 1)
    a138510_list = mapMaybe f [1..] where
      f x | a010051' q == 0 = Nothing
          | q == p          = Just 1
          | otherwise       = Just $
            head [b | b <- [2..], length (d b p) == length (d b q)]
          where q = div x p; p = a020639 x
      d b = unfoldr (\z -> if z == 0 then Nothing else Just $ swap $ divMod z b)
    -- Reinhard Zumkeller, Dec 16 2014
    
  • Scheme
    (define (A138510 n) (A251725 (A001358 n))) ;; Antti Karttunen, Dec 16 2014

Formula

a(n) = A251725(A001358(n)). - Antti Karttunen, Dec 16 2014

Extensions

Wrong comment corrected by Reinhard Zumkeller, Dec 16 2014

A085721 Semiprimes whose prime factors have an equal number of digits in binary representation.

Original entry on oeis.org

4, 6, 9, 25, 35, 49, 121, 143, 169, 289, 323, 361, 391, 437, 493, 527, 529, 551, 589, 667, 713, 841, 899, 961, 1369, 1517, 1591, 1681, 1739, 1763, 1849, 1927, 1961, 2021, 2173, 2183, 2209, 2257, 2279, 2419, 2491, 2501, 2537, 2623, 2773, 2809
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 20 2003

Keywords

Comments

A138510(A174956(a(n))) <= 2. - Reinhard Zumkeller, Dec 19 2014

Examples

			A078972(35) = 527 = 17*31 -> 10001*11111, therefore 527 is a term;
A078972(37) = 533 = 13*41 -> 1101*101001, therefore 533 is not a term;
A001358(1920) = 7169 = 67*107 -> 1000011*1101011: therefore 7169 a term, but not of A078972.
		

Crossrefs

Cf. A261073, A261074, A261075 (subsequences).
Intersection of A001358 and A266346.

Programs

  • Haskell
    a085721 n = a085721_list !! (n-1)
    a085721_list = [p*q | (p,q) <- zip a084126_list a084127_list,
                          a070939 p == a070939 q]
    -- Reinhard Zumkeller, Nov 10 2013
  • Mathematica
    fQ[n_] := Block[{fi = FactorInteger@ n}, Plus @@ Last /@ fi == 2 && IntegerLength[ fi[[1, 1]], 2] == IntegerLength[ fi[[-1, 1]], 2]]; Select[ Range@ 2866, fQ] (* Robert G. Wilson v, Oct 29 2011 *)
    Select[Range@ 3000, And[Length@ # == 2, IntegerLength[#1, 2] == IntegerLength[#2, 2] & @@ #] &@ Flatten@ Map[ConstantArray[#1, #2] & @@ # &, FactorInteger@ #] &] (* Michael De Vlieger, Oct 08 2016 *)
  • PARI
    is(n)=bigomega(n)==2&&#binary(factor(n)[1,1])==#binary(n/factor(n)[1,1]) \\ Charles R Greathouse IV, Nov 08 2011
    

Extensions

Edited by Charles R Greathouse IV, Aug 02 2010

A174798 Numbers n such that 2*prime(n) and 2*prime(n+1) are consecutive semiprimes.

Original entry on oeis.org

1, 3, 10, 33, 43, 49, 50, 57, 63, 100, 113, 120, 131, 140, 149, 159, 173, 195, 206, 224, 230, 277, 284, 303, 315, 320, 332, 366, 373, 394, 395, 401, 448, 463, 469, 471, 473, 477, 483, 484, 492, 513, 524, 530, 534, 537, 543, 555, 558, 576, 577, 592, 600, 608
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Mar 29 2010

Keywords

Comments

There are no semiprimes strictly between 2*prime(n) and 2*prime(n+1).
A174956(A100484(a(n+1)))=A174956(A100484(a(n)))+1. [From Reinhard Zumkeller, Apr 03 2010]

Examples

			a(1)=1 because 2*prime(1)=4=semiprime(1) and 2*prime(1+1)=6=semiprime(2).
a(2)=3 because 2*prime(3)=10=semiprime(4) and 2*prime(3+1)=14=semiprime(5).
		

Crossrefs

Programs

  • Mathematica
    PrimePi[First[#]]&/@Select[Partition[Select[Range[20000],PrimeOmega[#] == 2&], 2,1]/2,And@@IntegerQ/@#&] (* Harvey P. Dale, Nov 19 2011 *)

Formula

A000040(a(n)) = A001358(A174797(n))/2.

Extensions

Edited, corrected and extended by Ray Chandler, Apr 07 2010

A176512 Indices of products of 2 single (or isolated or non-twin) primes in the semiprimes.

Original entry on oeis.org

1, 16, 25, 33, 35, 45, 52, 55, 58, 62, 76, 82, 84, 100, 104, 107, 111, 133, 137, 143, 155, 158, 162, 164, 174, 183, 188, 194, 198, 202, 214, 218, 222, 225, 229, 231, 234, 241, 243, 249, 257, 263, 265, 269, 274, 281, 287, 292, 294, 299, 301, 304, 319, 320, 321
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 19 2010

Keywords

Programs

  • Maple
    From R. J. Mathar, May 02 2010: (Start)
    isA007510 := proc(n) isprime(n) and not isprime(n+2) and not isprime(n-2) ; simplify(%) ; end proc:
    isA176312 := proc(n) for d in numtheory[divisors](n) do if isA007510(d) and isA007510(n/d) then return true; end if; end do: return false; end proc:
    A176312 := proc(n) option remember; if n = 1 then 4; else for a from procname(n-1)+1 do if isA176312(a) then return a; end if; end do: end if; end proc:
    A174956 := proc(p) option remember ; for n from 1 do if A001358(n) = p then return n; elif A001358(n) > p then return 0 ; end if; end do: end proc:
    A176512 := proc(n) A174956(A176312(n)) ; end proc:
    seq(A176512(n),n=1..120) ; (End)

Formula

A001358(k) = A176312(a(n)).
a(n) = A174956(A176312(n)). - R. J. Mathar, May 02 2010

Extensions

Entries checked by R. J. Mathar, May 02 2010

A176804 Lesser of twin primes p such that p = semiprime(k)/2 and p + 2 = semiprime(k+2)/2 for some integer k.

Original entry on oeis.org

3, 11, 17, 41, 179, 197, 239, 281, 311, 419, 431, 461, 521, 599, 641, 821, 827, 857, 1019, 1049, 1061, 1091, 1151, 1229, 1289, 1319, 1427, 1481, 1487, 1607, 1667, 1697, 1721, 1871, 1877, 1931, 1997, 2027, 2081, 2111, 2141, 2309, 2339, 2591, 2687, 2789
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 26 2010

Keywords

Examples

			3 is a term because 3 = semiprime(2)/2 = 6/2 and 3 + 2 = 5 = semiprime(2+2)/2 = 10/2.
		

Programs

  • Maple
    From R. J. Mathar, Apr 27 2010: (Start)
    isA001358 := proc(n) numtheory[bigomega](n) = 2 ; end proc:
    A001358 := proc(n) option remember ; if n = 1 then 4; else for a from procname(n-1)+1 do if isA001358(a) then return a; end if; end do: end if ; end proc:
    A174956 := proc(p) for n from 1 do if A001358(n) = p then return n; elif A001358(n) > p then return 0 ; end if; end do: end proc:
    A001359 := proc(n) option remember; if n = 1 then 3; else for a from procname(n-1)+2 by 2 do if isprime(a) and isprime(a+2) then return a; end if; end do: end if; end proc:
    for i from 1 to 400 do p := A001359(i) ; n := A174956(2*p) ; n2 := A174956(2*p+4) ; if n > 0 and n2 >0 and n2=n+2 then printf("%d,",p) ; end if; end do: (End)
  • Mathematica
    (Select[Partition[Select[Range[6000],PrimeOmega[#]==2&],3,1],AllTrue[ {#[[1]]/2 ,#[[3]]/2},PrimeQ]&&#[[3]]-#[[1]]==4&]/2)[[All,1]] (* Harvey P. Dale, Sep 24 2022 *)

Extensions

Corrected (541 replaced by 521, 1047 replaced by 1049, 1741 replaced by 1721) by R. J. Mathar, Apr 27 2010
Showing 1-10 of 11 results. Next