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.

A078846 Where 11^n occurs in n-almost-primes, starting at a(0)=1.

This page as a plain text file.
%I A078846 #29 Feb 16 2025 08:32:48
%S A078846 1,5,40,328,2556,18452,126096,827901,5276913,32887213,201443165,
%T A078846 1217389949,7279826998,43168558912,254258462459,1489291941733,
%U A078846 8683388113017,50433408838966
%N A078846 Where 11^n occurs in n-almost-primes, starting at a(0)=1.
%C A078846 A k-almost-prime is a positive integer that has exactly k prime factors, counted with multiplicity.
%H A078846 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/AlmostPrime.html">Almost Prime.</a>
%e A078846 a(2) = 40 since 11^2 is the 40th 2-almost-prime: A001358(40) = 121.
%t A078846 AlmostPrimePi[k_Integer /; k > 1, n_] := Module[{a, i}, a[0] = 1; 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 A078846 Table[ AlmostPrimePi[n, 11^n], {n, 2, 11}] (* _Robert G. Wilson v_, Feb 09 2006 *)
%o A078846 (PARI)
%o A078846 almost_prime_count(N, k) = if(k==1, return(primepi(N))); (f(m, p, k, j=0) = my(c=0, s=sqrtnint(N\m, k)); if(k==2, forprime(q=p, s, c += primepi(N\(m*q))-j; j += 1), forprime(q=p, s, c += f(m*q, q, k-1, j); j += 1)); c); f(1, 2, k);
%o A078846 a(n) = if(n == 0, 1, almost_prime_count(11^n, n)); \\ _Daniel Suteu_, Jul 10 2023
%o A078846 (Python)
%o A078846 from math import isqrt, prod
%o A078846 from sympy import primerange, integer_nthroot, primepi
%o A078846 def A078846(n):
%o A078846     def almostprimepi(n, k):
%o A078846         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 A078846         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 A078846     return almostprimepi(11**n, n) if n else 1 # _Chai Wah Wu_, Sep 01 2024
%Y A078846 Cf. A078840, A078841, A078842, A078843, A078844, A078845.
%K A078846 more,nonn
%O A078846 0,2
%A A078846 _Benoit Cloitre_ and _Paul D. Hanna_, Dec 10 2002
%E A078846 a(6)-a(11) from _Robert G. Wilson v_, Feb 09 2006
%E A078846 a(12)-a(15) from _Donovan Johnson_, Sep 27 2010
%E A078846 a(16)-a(17) from _Daniel Suteu_, Jul 10 2023