login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = prime(n) + semiprime(n) + 3almostprime(n) + 4almostprime(n).
3

%I #19 Sep 02 2024 13:04:23

%S 30,45,68,77,106,112,128,164,176,188,204,223,243,273,286,304,319,328,

%T 350,372,385,424,439,459,479,496,511,529,544,553,580,596,626,632,668,

%U 692,730,742,753,771,781,793,823,838,857,870,887,909,929,938,974,999

%N a(n) = prime(n) + semiprime(n) + 3almostprime(n) + 4almostprime(n).

%C Primes in this sequence include a(12) = 223, a(23) = 439, a(25) = 479, a(43) = 823, a(45) = 857, a(47) = 887, a(49) = 929.

%H Harvey P. Dale, <a href="/A114944/b114944.txt">Table of n, a(n) for n = 1..1000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/AlmostPrime.html">Almost Prime.</a>

%F a(n) = A000040(n) + A001358(n) + A014612(n) + A014613(n).

%F a(n) = A014613(n) + A114382(n).

%e a(1) = prime(1) + semiprime(1) + 3almostprime(1) + 4almostprime(1) = 2 + 4 + 8 + 16 = 30.

%e a(6) = (prime(6) + semiprime(6) + 3almostprime(6)) + 4almostprime(6) = A114382(6) + 4almostprime(6) = 56 + 56 = 112.

%t 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 AlmostPrime[k_, n_] := Block[{e = Floor[Log[2, n]], a, b}, a = 2^e; Do[b = 2^p; While[AlmostPrimePi[k, a] < n, a = a + b]; a = a - b/2, {p, e, 0, -1}]; a + b/2]; Table[ Sum[ AlmostPrime[k, n], {k, 4}], {n, 52}] (* _Robert G. Wilson v_, Feb 21 2006 *)

%t nn=500;Module[{p=Prime[Range[nn]],p2=Select[Range[nn], PrimeOmega[#] == 2&], p3=Select[Range[nn], PrimeOmega[#] ==3&],p4 =Select[Range[nn], PrimeOmega[#]==4&],len},len=Min[Length/@{p,p2,p3,p4}];Total/@Thread[ {Take[p,len],Take[p2,len],Take[p3,len],Take[p4,len]}]] (* _Harvey P. Dale_, Jul 13 2012 *)

%Y Cf. A000040, A001358, A014612, A014613, A114382.

%K easy,nonn

%O 1,1

%A _Jonathan Vos Post_, Feb 20 2006

%E Corrected by _Harvey P. Dale_, Jul 13 2012