login
A105997
Semiprime function n -> A001358(n) applied three times to n.
6
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,1
FORMULA
a(n) = A001358(A001358(A001358(n))).
EXAMPLE
a(1) = semiprime(semiprime(semiprime(1))) = semiprime(semiprime(4)) = semiprime(10) = 26.
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 *)
PROG
(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
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Apr 29 2005
EXTENSIONS
Corrected and extended by Robert G. Wilson v, Apr 30 2005
STATUS
approved