RosettaCodeData/Task/Goldbachs-comet/Mathematica/goldbachs-comet.math

9 lines
280 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
ClearAll[GoldbachFuncion]
GoldbachFuncion[e_Integer] := Module[{ps},
ps = Prime[Range[PrimePi[e/2]]];
Total[Boole[PrimeQ[e - ps]]]
]
Grid[Partition[GoldbachFuncion /@ Range[4, 220, 2], 10]]
GoldbachFuncion[10^6]
DiscretePlot[GoldbachFuncion[e], {e, 4, 2000}, Filling -> None]