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.
%I A116434 #25 Sep 02 2024 13:03:25 %S A116434 0,1,3,13,90,726,7089,78369,973404,13377156,201443165,3297443264, %T A116434 58304208767,1107693755122 %N A116434 Consider the array T(r,c), the number of c-almost primes less than or equal to r^c. This is the diagonal T(r,r-1). %t A116434 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 *) %t A116434 Do[ Print@ AlmostPrimePi[n, (n + 1)^n], {n, 11}] %o A116434 (Python) %o A116434 from math import isqrt, prod %o A116434 from sympy import primerange, integer_nthroot, primepi %o A116434 def A116434(n): %o A116434 def almostprimepi(n, k): %o A116434 def g(x, a, b, c, m): yield from (((d, ) for d in enumerate(primerange(b, isqrt(x//c)+1), a)) if m==2 else (((a2, b2), )+d for a2, b2 in enumerate(primerange(b, integer_nthroot(x//c, m)[0]+1), a) for d in g(x, a2, b2, c*b2, m-1))) %o A116434 return int(sum(primepi(n//prod(c[1] for c in a))-a[-1][0] for a in g(n, 0, 1, 1, k)) if k>1 else primepi(n)) %o A116434 return almostprimepi((n+1)**n,n) # _Chai Wah Wu_, Sep 02 2024 %Y A116434 Cf. A116433, A116435. %K A116434 hard,more,nonn %O A116434 1,3 %A A116434 _Paul D. Hanna_ and _Robert G. Wilson v_, Feb 15 2006 %E A116434 Name rephrased by _R. J. Mathar_, Jun 20 2021 %E A116434 a(13)-a(14) from _Max Alekseyev_, Oct 12 2023