login
A114382
Prime(n) + Semiprime(n) + (3-almostPrime)(n).
3
14, 21, 32, 37, 52, 56, 68, 83, 92, 100, 114, 123, 139, 147, 154, 169, 183, 188, 200, 220, 229, 240, 250, 263, 281, 292, 301, 309, 319, 325, 348, 362, 378, 382, 408, 416, 436, 446, 456, 465, 473, 478, 495, 508, 517, 528, 543, 561, 579, 587, 610, 627, 631, 648
OFFSET
1,1
LINKS
Eric Weisstein's World of Mathematics, Almost Prime.
FORMULA
a(n) = A000040(n) + A001358(n) + A014612(n).
EXAMPLE
a(1) = Prime(1) + Semiprime(1) + 3AlmostPrime(1) = 2 + 4 + 8 = 14.
a(10) = Prime(10) + Semiprime(10) + 3AlmostPrime(10) = 29 + 26 + 45 = 100.
a(20) = Prime(20) + Semiprime(20) + 3AlmostPrime(20) = 71 + 57 + 92 = 220.
a(30) = Prime(30) + Semiprime(30) + 3AlmostPrime(30) = 113 + 87 + 125 = 325.
a(40) = Prime(40) + Semiprime(40) + 3AlmostPrime(40) = 173 + 121 + 71 = 465.
a(50) = Prime(50) + Semiprime(50) + 3AlmostPrime(50) = 229 + 146 + 212 = 587.
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]+k], 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, 3}], {n, 54}] (* Robert G. Wilson v, Feb 21 2006 *)
CROSSREFS
KEYWORD
easy,less,nonn
AUTHOR
Jonathan Vos Post, Feb 11 2006
EXTENSIONS
a(7) corrected by Georg Fischer, May 09 2024
STATUS
approved