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.

Previous Showing 11-20 of 1773 results. Next

A122824 Prime(semiprime(n)) - semiprime(prime(n)). Commutator [A000040,A001358] at n.

Original entry on oeis.org

1, 4, 9, 8, 10, 12, 24, 24, 32, 15, 46, 24, 27, 34, 25, 40, 44, 46, 51, 54, 53, 46, 54, 60, 70, 70, 98, 105, 104, 91, 64, 72, 45, 48, 95, 118, 120, 120, 116, 108, 100, 96, 101, 118, 102, 144, 123, 86, 76, 81, 136, 138, 143, 112, 132, 131, 153, 160, 171, 169
Offset: 1

Views

Author

Jonathan Vos Post, Oct 23 2006

Keywords

Examples

			a(1) = prime(semiprime(1)) - semiprime(prime(1)) = prime(4) - semiprime(2) = 7 - 6 = 1.
a(2) = prime(semiprime(2)) - semiprime(prime(2)) = prime(6) - semiprime(3) = 13 - 9 = 4.
a(3) = prime(semiprime(3)) - semiprime(prime(3)) = prime(9) - semiprime(5) = 23 - 14 = 9.
a(4) = prime(semiprime(4)) - semiprime(prime(4)) = prime(10) - semiprime(7) = 29 - 21 = 8.
		

Crossrefs

Programs

  • Mathematica
    sp = Select[Range[1000], PrimeOmega[#] == 2 &]; Table[ Prime[ sp[[i]]] - sp[[Prime[i]]], {i, PrimePi@ Length@ sp}] (* Giovanni Resta, Jun 13 2016 *)

Formula

a(n) = A106349(n) - A106350(n).

Extensions

a(33)-a(54) corrected by and a(55)-a(60) from Giovanni Resta, Jun 13 2016

A105282 Positive integers n such that n^20 + 1 is semiprime (A001358).

Original entry on oeis.org

2, 4, 46, 154, 266, 472, 748, 1434, 1738, 2058, 2204, 2222, 2428, 2478, 2510, 2866, 3132, 3288, 3576, 3688, 3756, 4142, 4506, 4940, 5164, 6252, 6330, 6786, 7180, 7300, 7338, 7416, 7628, 7806, 9270, 9312, 10044, 10722, 10860, 12126, 12422, 12668, 12998, 13350
Offset: 1

Views

Author

Jonathan Vos Post, Apr 25 2005

Keywords

Comments

We have the polynomial factorization: n^20 + 1 = (n^4 + 1) * (n^16 - n^12 + n^8 - n^4 + 1). Hence after the initial n=1 prime, the binomial can never be prime. It can be semiprime iff n^4+1 is prime and (n^16 - n^12 + n^8 - n^4 + 1) is prime.

Examples

			2^20 + 1 = 1048577 = 17 * 61681,
4^20 + 1 = 1099511627777 = 257 * 4278255361,
46^20 + 1 = 1799519816997495209117766334283777 = 4477457 * 401906666439788301510827761,
1434^20 + 1 =
1352019721694375552250489804528860551814233886722212960509362177 =
4228599998737 * 319732233386510278346888399489424537759394853595121.
		

Crossrefs

Programs

  • Magma
    IsSemiprime:=func< n | &+[ k[2]: k in Factorization(n) ] eq 2 >; [n: n in [1..1000] | IsSemiprime(n^20+1)] // Vincenzo Librandi, Dec 21 2010
  • Mathematica
    Select[Range[1000000], PrimeQ[#^4 + 1] && PrimeQ[(#^20 + 1)/(#^4 + 1)] &] (* Robert Price, Mar 09 2015 *)

Formula

a(n)^20 + 1 is semiprime (A001358).

Extensions

a(9)-a(44) from Robert Price, Mar 09 2015

A074985 Squares of semiprimes (A001358).

Original entry on oeis.org

16, 36, 81, 100, 196, 225, 441, 484, 625, 676, 1089, 1156, 1225, 1444, 1521, 2116, 2401, 2601, 3025, 3249, 3364, 3844, 4225, 4761, 5476, 5929, 6724, 7225, 7396, 7569, 8281, 8649, 8836, 9025, 11236, 12321, 13225, 13924, 14161, 14641, 14884, 15129
Offset: 1

Views

Author

Jani Melik, Oct 07 2002

Keywords

Comments

Disjoint union of 4th powers of primes, A030514, and squares of squarefree semiprimes, A085986. - M. F. Hasler, Nov 12 2021

Examples

			4 is divisible by 2 (twice) and 4*4 = 16.
6 is divisible by exactly 2 and 3 and 6*6 = 36.
		

Crossrefs

Cf. A030514 (4th powers of primes), A085986 (squares of squarefree semiprimes).

Programs

  • Haskell
    a074985 = a000290 . a001358  -- Reinhard Zumkeller, Aug 02 2012
    
  • Maple
    readlib(issqr): ts_kv_sp := proc(n); if (numtheory[bigomega](n)=4 and issqr(n)='true') then RETURN(n); fi; end: seq(ts_kv_sp(i), i=1..50000);
  • Mathematica
    Select[Range[200],PrimeOmega[#]==2&]^2 (* Harvey P. Dale, Oct 03 2011 *)
  • PARI
    is(n)=if(issquare(n,&n), isprimepower(n)==2 || factor(n)[,2]==[1,1]~, 0) \\ Charles R Greathouse IV, Oct 16 2015
    
  • PARI
    list(lim)=lim=sqrtint(lim\1); my(v=List()); forprime(p=2, sqrtint(lim), forprime(q=p, lim\p, listput(v, (p*q)^2))); Set(v) \\ Charles R Greathouse IV, Nov 13 2021

Formula

a(n) ~ (n log n/log log n)^2. - Charles R Greathouse IV, Oct 16 2015
Sum_{n>=1} 1/a(n) = (P(2)^2 + P(4))/2 = (A085548^2 + A085964)/2 = 0.1407604343..., where P is the prime zeta function. - Amiram Eldar, Oct 30 2020

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

A255609 a(1)=2; a(n) = the smallest prime p such that a(n)-a(n-1) is semiprime (A001358).

Original entry on oeis.org

2, 11, 17, 23, 29, 43, 47, 53, 59, 73, 79, 83, 89, 103, 107, 113, 127, 131, 137, 151, 157, 163, 167, 173, 179, 193, 197, 211, 233, 239, 277, 281, 307, 311, 317, 331, 337, 347, 353, 359, 373, 379, 383, 389, 463, 467, 541, 547, 557, 563, 569, 607
Offset: 1

Views

Author

Zak Seidov, Feb 28 2015

Keywords

Comments

Sequence with any initial prime term a(1) eventually merges with this sequence: 3,7,11; 5,11; 13,17; 19,23; 31,37,41,47.
For n > 1, a(n) = A289750(n+1). - Jon E. Schoenfield, Nov 26 2017

Examples

			a(2) - a(1) = 11 - 2 = 9 = 3*3;
a(3) - a(2) = 17 - 11 = 6 = 2*3;
a(81) - a(80) = 1009 - 887 = 122 = 2*61.
		

Crossrefs

Programs

  • Maple
    A:= Vector(100): A[1]:= 2:
    for n from 2 to 100 do
      p:= A[n-1];
      do
        p:= nextprime(p);
        until numtheory:-bigomega(p-A[n-1]) = 2;
      A[n]:= p;
    od:
    convert(A,list); # Robert Israel, Dec 28 2022
  • Mathematica
    s = {2}; p = 2; Do[q = NextPrime[p]; While[2 != PrimeOmega[q - p], q = NextPrime[q]]; AppendTo[s, q]; p = q, {100}]; s
    sp[n_]:=Module[{p=NextPrime[n]},While[PrimeOmega[p-n]!=2,p= NextPrime[ p]];p]; NestList[sp,2,60] (* Harvey P. Dale, Oct 10 2015 *)
  • PARI
    v=[2];forprime(p=3,300,if(bigomega(p-v[#v])==2,v=concat(v,p)));v \\ Derek Orr, Feb 28 2015

A048623 Binary encoding of semiprimes (A001358).

Original entry on oeis.org

2, 3, 4, 5, 9, 6, 10, 17, 8, 33, 18, 65, 12, 129, 34, 257, 16, 66, 20, 130, 513, 1025, 36, 258, 2049, 24, 4097, 68, 8193, 514, 40, 1026, 16385, 132, 32769, 2050, 260, 65537, 72, 32, 131073, 4098, 8194, 136, 262145, 16386, 524289, 48, 516, 1048577, 1028
Offset: 1

Views

Author

Antti Karttunen, Jul 14 1999

Keywords

Comments

Permutation of A048645 (without the term 1).

Examples

			Squares p_i^2 are encoded with a single bit in position i (e.g. 25=ithprime(3)*ithprime(3) => 2^3 = 8) and other terms p_i*p_j are encoded with two bits, as sum 2^(i-1)+2^(j-1)
		

Crossrefs

Programs

  • Maple
    nthprime := proc(n) local i; if(isprime(n)) then for i from 1 to 1000000 do if(ithprime(i) = n) then RETURN(i); fi; od; else RETURN(0); fi; end; # nthprime(2) = 1, nthprime(3) = 2, nthprime(5) = 3, etc.
    bef := proc(n) local s,d; s := 0; for d in ifactors(n)[ 2 ] do s := s + d[ 2 ]*(2^(nthprime(d[ 1 ])-1)); od; RETURN(s); end; # bef = Binary Encode Factorization.
    encode_semiprimes := proc(upto_n) local b,i; b := [ ]; for i from 1 to upto_n do if((3 = tau(i)) or ((0 <> mobius(i)) and (4 = tau(i)))) then b := [ op(b), bef(i) ]; fi; od: RETURN(b); end;
  • Mathematica
    f[n_] := Block[{p = FactorInteger@ n}, Total[2^PrimePi@ # &@ Map[First, p - If[Length@ p == 2, 1, 0]]]]; f /@ Select[Range@ 156, PrimeOmega@ # == 2 &] (* Michael De Vlieger, Oct 01 2015 *)
  • PARI
    lista(nn) = {for (n=1, nn, if (bigomega(n)==2, if (issquare(n), x = 2^primepi(sqrtint(n)), f = factor(n); x = sum(k=1, #f~, 2^(primepi(f[k,1]) - 1))); print1(x, ", ");););} \\ Michel Marcus, Oct 02 2015
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange, factorint
    def A048623(n):
        def f(x): return int(n+x+((t:=primepi(s:=isqrt(x)))*(t-1)>>1)-sum(primepi(x//p) for p in primerange(s+1)))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return sum(e<Chai Wah Wu, Feb 22 2025

A118713 a(n) = determinant of n X n circulant matrix whose first row is A001358(1), A001358(2), ..., A001358(n) where A001358(n) = n-th semiprime.

Original entry on oeis.org

4, -20, 361, -3567, 218053, -3455872, 736439027, -16245418225, 1519211613654, -37662452460912, 20199655476042865, -643524421698841536, 46513669467992431114, -3754367220494585505280, 277686193779526116536293, -123973821931125256333959105, 20103033234038999233385180658
Offset: 1

Views

Author

Jonathan Vos Post, May 20 2006

Keywords

Comments

Semiprime analog of A066933 Circulant of prime numbers. a(n) alternates in sign. A048954 Wendt determinant of n-th circulant matrix C(n). A052182 Circulant of natural numbers. A086459 Circulant of powers of 2.

Examples

			a(2) = -20 = determinant
|4,6|
|6,4|.
a(3) = 361 = 19^2 = determinant
|4,6,9|
|9,4,6|
|6,9,4|.
		

Crossrefs

Programs

  • Maple
    A118713 := proc(n)
        local C,r,c ;
        C := Matrix(1..n,1..n) ;
        for r from 1 to n do
        for c from 1 to n do
            C[r,c] := A001358(1+((c-r) mod n)) ;
        end do:
        end do:
        LinearAlgebra[Determinant](C) ;
    end proc:
    seq(A118713(n),n=1..13) ;
  • Mathematica
    nmax = 13;
    sp = Select[Range[3 nmax], PrimeOmega[#] == 2&];
    a[n_] := Module[{M}, M[1] = sp[[1 ;; n]];
       M[k_] := M[k] = RotateRight[M[k - 1]];
       Det[Table[M[k], {k, 1, n}]]];
    Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Feb 16 2023 *)

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Aug 23 2007

A096003 Smallest semiprime (A001358) which is at the end of an arithmetic progression of n semiprimes.

Original entry on oeis.org

4, 6, 14, 46, 58, 221, 445, 497, 1211, 1561, 4195, 4393, 6347, 10717, 14233, 28213, 31451, 72965, 119029, 121603, 124177, 611261, 632171, 2003171, 2012771, 7466993, 7619243, 7771493, 7923743, 68029097, 142247113, 168901739
Offset: 1

Views

Author

N. J. A. Sloane, Jul 28 2004

Keywords

Comments

a(33) <= 1320196303 (gap of 39029760). a(34) <= 1359226063 (gap of 39029760). a(35) <= 1398255823 (gap of 39029760). - Donovan Johnson, Jun 03 2012

Examples

			a(3)=14 since (4,9,14) [or (6,10,14)] is an arithmetic progression of 3 semiprimes ending in 14 and 14 is the smallest semiprime with this property.
		

Crossrefs

Cf. A001358 (semiprimes), A005115 (analog for primes).
For the associated gaps see A097824.

Extensions

More terms from T. D. Noe and Ray Chandler, Jul 29 2004
a(18)-a(20) from Ray Chandler, Aug 01 2004
More terms from Hugo Pfoertner, Aug 27 2004
a(26)-a(30) from Hugo Pfoertner, Sep 07 2004
a(31)-a(32) from Donovan Johnson, Jun 03 2012

A130533 a(n) = smallest k such that A001358(n+1) = A001358(n) + (A001358(n) mod k), or 0 if no such k exists.

Original entry on oeis.org

0, 0, 2, 6, 13, 9, 2, 19, 2, 19, 2, 3, 4, 37, 8, 43, 47, 47, 53, 2, 6, 59, 61, 8, 71, 6, 79, 2, 5, 83, 89, 2, 3, 12, 101, 107, 4, 3, 3, 2, 11
Offset: 1

Views

Author

Rémi Eismann, Aug 16 2007 - Jan 20 2011

Keywords

Comments

a(n) is the "weight" of semiprimes.
The decomposition of semiprimes into weight * level + gap is A001358(n) = a(n) * A184729(n) + A065516(n) if a(n) > 0.

Examples

			For n = 1 we have A001358(n) = 4, A001358(n+1) = 6; there is no k such that 6 - 4 = 2 = (4 mod k), hence a(1) = 0.
For n = 3 we have A001358(n) = 9, A001358(n+1) = 10; 2 is the smallest k such that 10 - 9 = 1 = (9 mod k), hence a(3) = 2.
For n = 19 we have A001358(n) = 55, A001358(n+1) = 57; 53 is the smallest k such that 57 - 55 = 2 = (55 mod k), hence a(19) = 53.
		

Crossrefs

A105997 Semiprime function n -> A001358(n) applied three times to n.

Original entry on oeis.org

26, 39, 74, 77, 118, 119, 178, 194, 219, 235, 299, 301, 329, 377, 381, 454, 471, 502, 535, 565, 566, 634, 679, 703, 721, 779, 842, 886, 893, 914, 973, 995, 998, 1006, 1126, 1174, 1227, 1282, 1294, 1317, 1337, 1343, 1389, 1418, 1457, 1563, 1577, 1623, 1642
Offset: 1

Views

Author

Jonathan Vos Post, Apr 29 2005

Keywords

Examples

			a(1) = semiprime(semiprime(semiprime(1))) = semiprime(semiprime(4)) = semiprime(10) = 26.
		

Crossrefs

Programs

  • Maple
    issp:= n-> not isprime(n) and numtheory[bigomega](n)=2:
    sp:= proc(n) option remember; local k; if n=1 then 4 else
           for k from 1+sp(n-1) while not issp(k) do od; k fi end:
    a:= n-> (sp@@3)(n):
    seq(a(n), n=1..49);  # Alois P. Heinz, Aug 16 2024
  • Mathematica
    f[n_] := Plus @@ Flatten[ Table[ # [[2]], {1}] & /@ FactorInteger[ n]]; t = Select[ Range[ 1700], f[ # ] == 2 &]; Table[ Nest[ t[[ # ]] &, n, 3], {n, 50}] (* Robert G. Wilson v, Apr 30 2005 *)
  • Python
    from math import isqrt
    from sympy import primepi, primerange
    def A105997(n):
        def f(x,n): return int(n+x+((t:=primepi(s:=isqrt(x)))*(t-1)>>1)-sum(primepi(x//k) for k in primerange(1, s+1)))
        def A001358(n):
            m, k = n, f(n,n)
            while m != k:
                m, k = k, f(k,n)
            return m
        return A001358(A001358(A001358(n))) # Chai Wah Wu, Aug 16 2024

Formula

a(n) = A001358(A001358(A001358(n))).

Extensions

Corrected and extended by Robert G. Wilson v, Apr 30 2005
Previous Showing 11-20 of 1773 results. Next