login
A114944
a(n) = prime(n) + semiprime(n) + 3almostprime(n) + 4almostprime(n).
3
30, 45, 68, 77, 106, 112, 128, 164, 176, 188, 204, 223, 243, 273, 286, 304, 319, 328, 350, 372, 385, 424, 439, 459, 479, 496, 511, 529, 544, 553, 580, 596, 626, 632, 668, 692, 730, 742, 753, 771, 781, 793, 823, 838, 857, 870, 887, 909, 929, 938, 974, 999
OFFSET
1,1
COMMENTS
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.
LINKS
Eric Weisstein's World of Mathematics, Almost Prime.
FORMULA
a(n) = A000040(n) + A001358(n) + A014612(n) + A014613(n).
a(n) = A014613(n) + A114382(n).
EXAMPLE
a(1) = prime(1) + semiprime(1) + 3almostprime(1) + 4almostprime(1) = 2 + 4 + 8 + 16 = 30.
a(6) = (prime(6) + semiprime(6) + 3almostprime(6)) + 4almostprime(6) = A114382(6) + 4almostprime(6) = 56 + 56 = 112.
MATHEMATICA
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 *)
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 *)
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 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Feb 20 2006
EXTENSIONS
Corrected by Harvey P. Dale, Jul 13 2012
STATUS
approved