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