OFFSET
1,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 1000 terms from Harvey P. Dale)
EXAMPLE
a(1) = 1st prime + 1st semiprime = 2 + 4 = 6.
a(2) = 2nd prime + 2nd semiprime = 3 + 6 = 9.
a(3) = 3rd prime + 3rd semiprime = 5 + 9 = 14.
MAPLE
A000040 := proc(n) ithprime(n) ; end: A001358 := proc(n) option remember ; local a ; if n = 1 then 4 ; else for a from A001358(n-1)+1 do if numtheory[bigomega](a) = 2 then RETURN(a) ; fi ; od: fi ; end: A133796 := proc(n) A000040(n)+A001358(n) ; end: seq(A133796(n), n=1..100) ; # R. J. Mathar, Jan 07 2008
MATHEMATICA
SemiPrimePi[n_] := Sum[ PrimePi[n/Prime@i] - i + 1, {i, PrimePi@ Sqrt@n}]; SemiPrime[n_] := Block[{e = Floor[Log[2, n] + 1], a, b}, a = 2^e; Do[b = 2^p; While[SemiPrimePi@a < n, a = a + b]; a = a - b/2, {p, e, 0, -1}]; a + b/2]; f[n_] := Prime@n + SemiPrime@n; Array[f, 56] (* Robert G. Wilson v *)
Module[{nn=300, pr, semi, len}, pr=Prime[Range[PrimePi[nn]]]; semi=Select[ Range[ nn], PrimeOmega[#]==2&]; len=Min[Length[pr], Length[semi]]; Total/@ Thread[{Take[pr, len], Take[semi, len]}]] (* Harvey P. Dale, Jun 27 2014 *)
PROG
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Jan 05 2008
EXTENSIONS
Corrected and extended by Robert G. Wilson v and R. J. Mathar, Jan 05 2008
Typo in first Mma program corrected by Giovanni Resta, Jun 12 2016
STATUS
approved