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.

This page as a plain text file.
%I A105997 #18 Aug 16 2024 23:08:55
%S A105997 26,39,74,77,118,119,178,194,219,235,299,301,329,377,381,454,471,502,
%T A105997 535,565,566,634,679,703,721,779,842,886,893,914,973,995,998,1006,
%U A105997 1126,1174,1227,1282,1294,1317,1337,1343,1389,1418,1457,1563,1577,1623,1642
%N A105997 Semiprime function n -> A001358(n) applied three times to n.
%H A105997 Chai Wah Wu, <a href="/A105997/b105997.txt">Table of n, a(n) for n = 1..10000</a>
%F A105997 a(n) = A001358(A001358(A001358(n))).
%e A105997 a(1) = semiprime(semiprime(semiprime(1))) = semiprime(semiprime(4)) = semiprime(10) = 26.
%p A105997 issp:= n-> not isprime(n) and numtheory[bigomega](n)=2:
%p A105997 sp:= proc(n) option remember; local k; if n=1 then 4 else
%p A105997        for k from 1+sp(n-1) while not issp(k) do od; k fi end:
%p A105997 a:= n-> (sp@@3)(n):
%p A105997 seq(a(n), n=1..49);  # _Alois P. Heinz_, Aug 16 2024
%t A105997 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 *)
%o A105997 (Python)
%o A105997 from math import isqrt
%o A105997 from sympy import primepi, primerange
%o A105997 def A105997(n):
%o A105997     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)))
%o A105997     def A001358(n):
%o A105997         m, k = n, f(n,n)
%o A105997         while m != k:
%o A105997             m, k = k, f(k,n)
%o A105997         return m
%o A105997     return A001358(A001358(A001358(n))) # _Chai Wah Wu_, Aug 16 2024
%Y A105997 Cf. A001358, A007097, A091022, A105998, A105999.
%K A105997 easy,nonn
%O A105997 1,1
%A A105997 _Jonathan Vos Post_, Apr 29 2005
%E A105997 Corrected and extended by _Robert G. Wilson v_, Apr 30 2005