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.

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