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-6 of 6 results.

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

A105998 Semiprime function n -> A001358(n) applied four times to n.

Original entry on oeis.org

77, 119, 219, 235, 377, 381, 566, 634, 721, 779, 998, 1006, 1126, 1282, 1294, 1563, 1642, 1745, 1853, 1959, 1961, 2209, 2402, 2483, 2554, 2785, 3005, 3149, 3173, 3242, 3481, 3574, 3587, 3622, 4101, 4282, 4471, 4681, 4714, 4798, 4859, 4882, 5095, 5201
Offset: 1

Views

Author

Jonathan Vos Post, Apr 29 2005

Keywords

Examples

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

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@@4)(n):
    seq(a(n), n=1..44);  # Alois P. Heinz, Aug 16 2024
  • Mathematica
    f[n_] := Plus @@ Flatten[ Table[ # [[2]], {1}] & /@ FactorInteger[ n]]; t = Select[ Range[ 5210], f[ # ] == 2 &]; Table[ Nest[ t[[ # ]] &, n, 4], {n, 45}] (* Robert G. Wilson v, Apr 30 2005 *)
  • Python
    from math import isqrt
    from sympy import primepi, primerange
    def A105998(n):
        def f(x): return int(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(A001358(n)))) # Chai Wah Wu, Aug 16 2024

Formula

Extensions

More terms from Robert G. Wilson v, Apr 30 2005

A119684 Ternary emirpimes.

Original entry on oeis.org

112, 211, 1021, 1102, 1201, 2011, 2022, 2202, 10111, 11101, 11112, 12102, 12202, 12212, 20121, 20212, 20221, 21111, 21202, 21221, 100102, 100201, 101011, 101122, 101221, 102001, 102002, 102012, 102022, 102122, 102222, 110101, 110102, 110122, 110211, 111102, 111202, 112011, 112121, 112122, 112202
Offset: 1

Views

Author

Jonathan Vos Post, Jun 08 2006

Keywords

Comments

These are semiprimes when read as base 3 numbers and their reversals are different semiprimes when read as base 3 numbers. Base 10 these are: 14, 22, 34, 38, 46, 58, 62, 74, 94, 118, 122, 146, 155, 158, 178, 185, 187, ... See: A097393 Emirpimes: numbers n such that n and its reversal are distinct semiprimes. See: A004086 Read n backwards (referred to as R(n) in many sequences). See: A007089 Numbers in base 3.
Apparently numbers with trailing zeros (reversed with leading zeros), like 1220 and 10020, are not included. - R. J. Mathar, Dec 22 2010

Examples

			a(1) = 112 because 112 (base 3) = 14 (base 10) is semiprime and R(112) = 211, where 211 (base 3) = 22 (base 10) is a different semiprime.
a(13) = 12202 because 12202 (base 3) = 155 (base 10) is semiprime and R(12202) = 20221, where 20221 (base 3) = 187 (base 10) is a different semiprime.
		

Crossrefs

Programs

  • Maple
    R:= NULL: count:= 0:
    for m from 2 while count < 100 do
    for j from 1 to 2 while count < 100 do
      n:= 3*m+j;
      if numtheory:-bigomega(n) <> 2 then next fi;
      L:= convert(n,base,3);
      r:= add(L[-i]*3^(i-1),i=1..nops(L));
      if r <> n and numtheory:-bigomega(r) = 2 then
         count:= count+1; R:= R, add(L[i]*10^(i-1),i=1..nops(L))
      fi
    od od:
    R; # Robert Israel, Jun 07 2020
  • Mathematica
    (* First run the program for A105999 *) SemiPrimeQ[n_Integer] := TrueQ[SemiPrimePi[n] > SemiPrimePi[n - 1]]; BaseForm[Select[Table[SemiPrime[n], {n, 100}], GCD[#, 3] == 1 && # != FromDigits[Reverse[IntegerDigits[#, 3]], 3] && SemiPrimeQ[FromDigits[Reverse[IntegerDigits[#, 3]], 3]] &], 3] (* From Alonso del Arte, Dec 22 2010 *)

Formula

a(n) = A007089(i) for some i in A001358 and R(a(n)) = A007089(j) for some j =/= i in A001358. a(n) = A007089(i) for some i in A001358 and A004086(a(n)) = A007089(j) for some j =/= i in A001358.

Extensions

More terms from Robert Israel, Jun 07 2020

A119965 The 3-almost primeth recurrence: a(0) = 1, a(n+1) = 3-almostprime(a(n)) = A014612(a(n)).

Original entry on oeis.org

1, 8, 42, 174, 705, 2764, 10772, 41967, 164793, 654242, 2634801, 10787937, 44983894, 191249703, 829651874, 3673967785, 16612478231, 76708135651, 361707435767, 1741601413569, 8561660600005
Offset: 0

Views

Author

Keywords

Comments

3-almostprime equivalent of Wilson's primeth recurrence: A007097.

Crossrefs

Programs

  • Mathematica
    ThreeAlmostPrimePi[n_] := Sum[PrimePi[n/(Prime@i*Prime@j)] - j + 1, {i, PrimePi[n^(1/3)]}, {j, i, PrimePi@Sqrt[n/Prime@i]}]; ThreeAlmostPrime[n_] := Block[{e = Floor[Log[2, n] + 1], a, b}, a = 2^e; Do[b = 2^p; While[ThreeAlmostPrimePi[a] < n, a = a + b]; a = a - b/2, {p, e, 0, -1}]; a + b/2]; NestList[ThreeAlmostPrime@# &, 1, 18]

Extensions

a(19)-a(20) from Donovan Johnson, Sep 29 2010

A119966 The n-almost primeth recurrence: a(0) = 1, a(n) = n-almostprime(a(n-1)).

Original entry on oeis.org

1, 2, 6, 28, 220, 2565, 45846, 1268622, 55336336, 3876385680, 443603651136, 84205632289664
Offset: 0

Views

Author

Keywords

Examples

			a(0)=1, a(1) is the first prime 2, a(2) is the second semiprime 6, a(3) is the sixth 3-almost prime 28, etc.
		

Crossrefs

Programs

  • Mathematica
    AlmostPrimePi[k_Integer, n_] := Module[{a, i}, a[0] = 1; If[k == 1, PrimePi[n], Sum[PrimePi[n/Times @@ Prime[Array[a, k - 1]]] - a[k - 1] + 1, Evaluate[ Sequence @@ Table[{a[i], a[i - 1], PrimePi[(n/Times @@ Prime[Array[a, i - 1]])^(1/(k - i + 1))]}, {i, k - 1}]]]]]; (* Eric W. Weisstein, Feb 07 2006 *)
    AlmostPrime[k_Integer,n] = Block[{e = Floor[ Log[2, n] + 1], a, b}, a = 2^e; Do[b = 2^p; While[AlmostPrimePi[k, a] < n, a = a + b]; a = a - b/2, {p, e, 0, -1}]; a + b/2]; a[n_] := a[n] = AlmostPrime[n, a[n - 1]]; a[0] = 1; Array[a, 11, 0] (* Robert G. Wilson v, Apr 14 2017 *)

Extensions

a(10)-a(11) from Donovan Johnson, Sep 18 2010

A179939 Largest semiprime divisor of all composite numbers between semiprime(n) and semiprime(n+1), or 0 if there are none.

Original entry on oeis.org

0, 4, 0, 6, 0, 10, 0, 6, 0, 15, 0, 0, 9, 0, 22, 6, 25, 26, 14, 0, 15, 21, 34, 35, 38, 39, 21, 0, 0, 22, 46, 0, 0, 51, 55, 57, 58, 0, 15, 0, 0, 62, 65, 0, 69, 0, 0, 9, 0, 77, 39, 0, 10, 82, 21, 87, 0, 91, 46, 93, 95, 65, 0, 0, 51, 0, 69, 106
Offset: 1

Views

Author

Jonathan Vos Post, Jan 12 2011

Keywords

Comments

This is to A052248 as semiprimes (A001358) are to primes (A000040). This defines a mapping f from semiprimes to semiprimes or 0 and f(s) < s holds for all semiprimes s. There is a block of k-1 consecutive 0's corresponding to each block of k consecutive semiprimes (i.e., a block of two consecutive 0's starting at the least of the triples in A115394).

Examples

			a(1) = 0 because there are no composite numbers between the 1st semiprime 4 and the 2nd semiprime 6.
a(2) = 4 because the composite numbers between the 2nd semiprime 6 and the 3rd semiprime 9 are {8} which is divisible by the semiprime 4=2*2.
a(10) = 15 because the composite numbers between the 10th semiprime 26 and the 11th semiprime 33 are {27, 28, 30, 32} of which the maximum is found for 30 which is divisible by the semiprime 15=3*5.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local k;
          if n=1 then 4
                 else for k from b(n-1)+1 while
                        isprime(k) or add(i[2], i=ifactors(k)[2])<>2
                      do od; k
          fi
        end:
    a:= proc(n) option remember; local k, l;
          k, l:= b(n)+1, b(n+1)-1;
          max(0,seq(seq(`if`(irem(j, b(i))=0, b(i), NULL),
                         i=1..n), j=k..l))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 14 2011
  • Mathematica
    (* First run the program for A105999 *) semiPrimeQ[x_] := TrueQ[Plus @@ Last /@ FactorInteger[x] == 2]; spGPF[start_, end_] := Module[{divList, spList}, divList = Union[Flatten[Table[Divisors[n], {n, start + 1, end - 1}]]]; spList = Select[divList, semiPrimeQ]; If[Length[spList] > 0, Return[Max[spList]], Return[0]]]; Table[spGPF[SemiPrime[n], SemiPrime[n + 1]], {n, 50}] (* Alonso del Arte, Jan 13 2011 *)

Formula

a(n) = max_{A001358(n) < k < A001358(n+1)} A179312(k).
Showing 1-6 of 6 results.