0

I got this code to solve problem 500 in euler project. I was managing to figure out what they mean but got stuck in translating the tilde (~). It seems tilde has no specific meaning and when I change the code to Tilde[Times[#1, #2],Mod,500500507]&, which should be an equivalent definition, it does not work. Could anyone give a hint? Thanks.

Fold[Times[#1, #2]~Mod~500500507 &, 1, (Sort@
Flatten@(NestWhileList[#^2 &, Prime@#, # < 10^7 &] & /@ 
   Range@PrimePi@(10^7)))[[1 ;; 500500]]]
Josh
  • 31
  • 2
  • 7
  • 1
    See here specifically: https://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users/25616#25616 – Szabolcs Oct 20 '21 at 14:53
  • 1
    Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory [tour] now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. – bbgodfrey Oct 20 '21 at 14:58
  • Thank you all soooooo much for your help! I will never get to know them without you. – Josh Oct 20 '21 at 15:08
  • 1
    In Mathematica, highlight the tilde (or other unknown symbols) and press F1 for help. – Bob Hanlon Oct 20 '21 at 17:29

0 Answers0