How to Create a Prime Number Image in Mathematica?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
RyanJ
Messages
17
Reaction score
6
Hey guys!

Basically I have a table of prime numbers. What is to write this table as an image - from 1 too 480000 - showing each cell that is a prime as white and the others as black.

So basically I'm cycling the numbers from 1-480000 and if they are prime then I want the cell white and otherwise black. I also want to be able to wrap the table to 800x600 pixels.

Any help appreciated since I have no idea how to do this!
 
Physics news on Phys.org