mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2016-09-22, 22:05   #1
pepi37
 
pepi37's Avatar
 
Dec 2011
After milion nines:)

134710 Posts
Default Primes as pictures

Lets say we have mega prime
So it can put in matrix of 1000*1000 pixels and then any of number in prime can be associated by another color.

I look for solution where I can

a: change size of matrix
b change "color" of numbers as I wish

Did you seen something like that on Net?
pepi37 is offline   Reply With Quote
Old 2016-09-22, 22:28   #2
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

3·3,041 Posts
Default

https://www.rstudio.com/wp-content/u...cheatsheet.pdf

https://wiki.nbic.nl/index.php/R_ggplot2_tutorial

or similar tools in python
Batalov is offline   Reply With Quote
Old 2016-09-22, 22:38   #3
pepi37
 
pepi37's Avatar
 
Dec 2011
After milion nines:)

25038 Posts
Default

Thanks!
I will now look at those links!
pepi37 is offline   Reply With Quote
Old 2017-07-21, 15:40   #4
storm5510
Random Account
 
storm5510's Avatar
 
Aug 2009
U.S.A.

22·401 Posts
Default

Quote:
Originally Posted by pepi37 View Post
Lets say we have mega prime
So it can put in matrix of 1000*1000 pixels and then any of number in prime can be associated by another color...
I did something similar to this a few years ago. The most recent prime, which I believe to be M74207281, has 22,338,618 digits. If one wanted a truly square image, then said image would need to be 4327 x 4327 pixels. I arrived at this by taking the square root of the number of digits, and rounding up. This probably coudn't be done on a screen, but I believe ti could be done in RAM then saved to a bitmap file. Using colors could be misleading. I would use grayscale. A value of 0 (zero) would be white, and 9 would be black. The values between could be represented by increasing the grayscale value by 25.
storm5510 is offline   Reply With Quote
Old 2017-07-21, 17:02   #5
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

2×2,963 Posts
Default

I used something like this as my profile picture on mymathforum for many years.
CRGreathouse is online now   Reply With Quote
Old 2017-07-21, 19:09   #6
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

2×4,643 Posts
Default

Quote:
Originally Posted by storm5510 View Post
A value of 0 (zero) would be white, and 9 would be black. The values between could be represented by increasing the grayscale value by 25.
Based on your rules, wouldn't you immediately switch white to black?
chalsall is offline   Reply With Quote
Old 2017-07-22, 01:11   #7
storm5510
Random Account
 
storm5510's Avatar
 
Aug 2009
U.S.A.

22·401 Posts
Default

Quote:
Originally Posted by chalsall View Post
Based on your rules, wouldn't you immediately switch white to black?
No, not for decimal numbers Below is a table of values for each decimal number, using the RGB color model.

Code:
0 = 250,250,250
1 = 225,225,225
2 = 200,200,200
3 = 175,175,175
4 = 150,150,150
5 = 125,125,125
6 = 100,100,100
7 = 50,50,50
8 = 25,25,25
9 = 0,0,0
If a person has the prime number in a text document, for example, you would read it, one digit at a time, and assign a color value, then place in the bitmap, starting at coordinate 0,0, then proceed right until coordinate 4326,0 was reached. Drop down to coordinate 0,1 and continue from there, repeating the process until the images was complete.

It would depend on what type of monitor a person has in regards to being able to see the entire image, without some type of resampling.
storm5510 is offline   Reply With Quote
Old 2017-07-22, 04:42   #8
Jayder
 
Jayder's Avatar
 
Dec 2012

2×139 Posts
Default

I've been working on this as a side project for over a year. I'm having problems with R where lines that should overlap do not, and I can't figure out a way to correct that. The following images are intentionally in low resolution, because it does not meet my standards:

M49, base 10

M30, base 6

This is a common idea, but I got it specifically from Nadieh Bremer. I will point you to her wonderful blog for the explanation of these: https://www.visualcinnamon.com/portfolio/the-art-in-pi (Her code has a few quirks and has trouble with large numbers, so I rewrote the bulk of it.)


I also converted M49 to base 2^24-1 in order to have (almost) every colour in the 24-bit colour space represent a digit. Here is that image (I cannot upload it to a hosting site because they compress large files): Google drive link
Jayder is offline   Reply With Quote
Old 2017-07-22, 17:01   #9
storm5510
Random Account
 
storm5510's Avatar
 
Aug 2009
U.S.A.

31048 Posts
Default

Quote:
Originally Posted by Jayder View Post
...I also converted M49 to base 2^24-1 in order to have (almost) every colour in the 24-bit colour space represent a digit. Here is that image (I cannot upload it to a hosting site because they compress large files): Google drive link
When whoever converted it to a PNG, a lot of data was lost in that instant. It got very fuzzy when I zoomed in. Still, this is a good example of what an image representation can look lilke.

storm5510 is offline   Reply With Quote
Old 2017-07-23, 01:27   #10
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

2·4,643 Posts
Default

Quote:
Originally Posted by storm5510 View Post
Still, this is a good example of what an image representation can look like.
Are you guys reproducing work which has already been done? Please see as an example.

Amusingly, I remembered this previous work, and first searched using Google Images using the term "Prime Curve".

This is the result I got back. And, of course, my girlfriend then immediately entered the room asking what I would like for dinner.

Thankfully she has a good sense of humour, but I'm going to cook tonight....
chalsall is offline   Reply With Quote
Old 2017-07-23, 03:11   #11
Jayder
 
Jayder's Avatar
 
Dec 2012

1000101102 Posts
Default

Quote:
Originally Posted by storm5510 View Post
When whoever converted it to a PNG, a lot of data was lost in that instant. It got very fuzzy when I zoomed in. Still, this is a good example of what an image representation can look lilke.
You were supposed to download it, not view the preview. I guess I wasn't clear.


Quote:
Originally Posted by chalsall View Post
Are you guys reproducing work which has already been done? Please see as an example
Hopefully everybody here is familiar with Ulam's spiral already. What is the reason for your question, anyhow? I've already admitted that this is not an original idea.
Jayder is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Funny Pictures and Khan Academy LaurV LaurV 9 2020-04-20 05:56
Projected Pictures. mfgoode Puzzles 18 2007-09-21 08:06
Pretty Progress Pictures Joe O Prime Sierpinski Project 3 2007-06-02 21:28
Avatars and profile pictures... Xyzzy Lounge 3 2005-07-12 23:12
Pretty Pictures Orgasmic Troll Math 45 2005-06-15 05:31

All times are UTC. The time now is 05:02.

Wed Oct 21 05:02:07 UTC 2020 up 41 days, 2:13, 0 users, load averages: 1.87, 1.94, 1.84

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.