## Hashing the positive integers into graphic art.

Expand Messages
• As part of a project to generate some computer art and to build a video game, it came to pass that I needed a way to convert whole numbers into graphic images.
Message 1 of 6 , Sep 2, 2006
As part of a project to generate some computer art and to build a video game, it came to pass that I needed a way to convert whole numbers into graphic images. I do not mean drawing a picture of numerals, but to generate a graphic picture unique to the number with no numerals or text. It seems obvious that a number's prime factorization would be an important part of any algorithm designed to hash a number into a graphic image. I have settled on a system that I think may be of some interest to the list.

Originally I did a few interesting explorations of the system and wrote up all my results in a rather long paper, but I have shortened the paper to simply describe the algorithm and provide some examples. Most of the short paper are pictures of numbers and I have left out some interesting heuristic calculations, some short curious prime number sequences, and partitionings of the integers motivated by the algorithm which are probably of no interest to anyone. If you like this sort of thing have a look at the longer version. I do think the pictures are cool and I hope you enjoy the idea.

Along the way I think I invented a tres-cool fractal algorithm using prime numbers but my limited computing power kept me from making a really kick-butt graphic image of this prime number fractal picture. That fractal is discussed at the end of both versions.

You can have a look at the idea on a small site I built just for this purpose: https://home.comcast.net/~rwynar/. I will add an applet to generate these images soon, I just have to convert my little java code into applet form.

Of course all comments are welcome.

Roahn

[Non-text portions of this message have been removed]
• ... It s pretty cool. The idea of creating bijections between numbers and multi-dimensional images is one I ve theorised about a lot (I was going to turn DeCSS
Message 2 of 6 , Sep 3, 2006
--- Roahn Wynar <rwynar@...> wrote:
> You can have a look at the idea on a small site I built just for this
> purpose: https://home.comcast.net/~rwynar/. I will add an applet to generate
> these images soon, I just have to convert my little java code into applet
> form.
>
> Of course all comments are welcome.

It's pretty cool. The idea of creating bijections between numbers and
multi-dimensional images is one I've theorised about a lot (I was going
to turn DeCSS into a real (acrylic on canvas) Mondrian-style painting,
for example). I don't suppose you could add an alt-tag to each image on
the web-page, indicating what number it represents could you?

Phil

() ASCII ribbon campaign () Hopeless ribbon campaign
/\ against HTML mail /\ against gratuitous bloodshed

[stolen with permission from Daniel B. Cristofani]

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
• ... Very nice. I wrote a script to draw some of these and see why you chose to work with the largest factor first (though I used a green square instead of a
Message 3 of 6 , Sep 3, 2006
> --- Roahn Wynar <rwynar@...> wrote:
> You can have a look at the idea on a small site I built
> just for this purpose: https://home.comcast.net/~rwynar/.
> I will add an applet to generate these images soon, ...
> > Of course all comments are welcome.

Very nice. I wrote a script to draw some of these
and see why you chose to work with the largest factor
first (though I used a green square instead of a circle
in a square for the third terminating image). I made
some animations, but none very interesting...

There are obviously easier ways of converting
numbers to images, but that one is fun and is much
nice looking!

Chris

A couple quick notes on the longer article (you should
probably ignore these, I'm not as artistic as you...):

You left out 2, and 3 in abstract. Def 2.3 does not need infinity
if it is as stated the index of prime (only), maybe reword the
sentence before the def to apply to all n. Typo n for
p in same def. In (5.2) write 37 not 39. ... In def
(2.4) make don't call 5 a large prime; add ref to 2 as flat,
3 as sharp rather than just imply it defs 2.1, 2.2.
In the intro 10472 is not prime. You refer to the
wrong figure there. Much of the verbiage of the first
few paragraphs should be removed as distracting from
what you achieved (especially the notion of "equal size,"
self deprecation like first sentence of third paragraph...)
Simplify. It is too nice of idea to bury in words.

Overall your artistic nature may have gotten too strong
of hold on you. If I was a referee I'd suggest you simplify
the notation to what you have in figure 2; that is use [n]
as in the image instead of #FKA(n). The sharp, flat and
natural operators may be more readable as function notation
(and perhaps subscripts to indication iteration), but
could be left to save effort.
• For those who are interested, you can now experiment with the Whole Number Hash Applet at https://home.comcast.net/~rwynar/. You can input some pretty big
Message 4 of 6 , Sep 4, 2006
For those who are interested, you can now experiment with the Whole Number Hash Applet at https://home.comcast.net/~rwynar/. You can input some pretty big numbers since the Applet uses BigInteger arithmetic, but be careful, for now the factorization method is pretty lame and if you put in primes over about 7 digits things can take a while. That is pretty embarrassing, considering this list's distinctiveness regarding factoring. I promise to fix this in V1.1 :).

Phil - I have added a Java Applet at https://home.comcast.net/~rwynar/ , which is probably even better than control-click. If you have a truly exotic number you would like converted I would happily give it a go.
Chris - I would enjoy seeing how your script outputs looked. Is there anyway to send a sample on to me? In my algorithm the borders of the atoms get demagnified with the atoms which gives a slightly uneven appearance (that is...the borders at each recursive level are not all consistent.) However this effect is useful for tracking the recursion depth by eye, so I have not bothered to work that issue out. I am wondering if your script naturally handles this.
What sort of animation did you attempt, that sounds interesting. Thanks for your comments on the paper, they are all excellent. I was certainly aware of the verbosity problem, which is why I wrote the short version, which is STILL verbose. I am no fan of pretentious notation, so I will be taking much of your advice.

Roahn

[Non-text portions of this message have been removed]
• ... Oh dear, you seem to have fallen for the write once, run anywhere bu^Wmarketting message that Sun was so proud of. Alas, it don t work here, and yes,
Message 5 of 6 , Sep 4, 2006
--- Roahn Wynar <rwynar@...> wrote:
> For those who are interested, you can now experiment with the Whole Number
> Hash Applet at https://home.comcast.net/~rwynar/.

Oh dear, you seem to have fallen for the "write once, run anywhere"
bu^Wmarketting message that Sun was so proud of. Alas, it don't work here, and
yes, before you ask, my VM came from Sun. (It's alive, it *_VERY_ANNOYINGLY_*
pulls the window to the top of the window-manager's z-stack when my mouse even
glides past the applet, it just doesn't do anything.)

> You can input some pretty
> big numbers since the Applet uses BigInteger arithmetic, but be careful, for
> now the factorization method is pretty lame and if you put in primes over
> about 7 digits things can take a while. That is pretty embarrassing,
> considering this list's distinctiveness regarding factoring. I promise to
> fix this in V1.1 :).

P-1 and Rho are really simple. I recommend just throwing in a quick
implementation of one or the other. If there's a built-in modular expmod for
bignums, then probably P-1 will be most efficient. Otherwise, you really can't
get simpler than a Rho, implementation-wise. (And do the Brent version, as it
has handy stopping points for factor checking.)

Phil

() ASCII ribbon campaign () Hopeless ribbon campaign
/\ against HTML mail /\ against gratuitous bloodshed

[stolen with permission from Daniel B. Cristofani]

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
• ... I d wondered if you did that on purpose. Go to http://www.utm.edu/staff/caldwell/preprints/temp/ 1to30 is just that, 1, 2, 3, ... Then the flat primes p,
Message 6 of 6 , Sep 4, 2006
> Chris - I would enjoy seeing how your script outputs looked.
> Is there anyway to send a sample on to me? In my algorithm
> the borders of the atoms get demagnified with the atoms which
> gives a slightly uneven appearance (that is...the borders at
> each recursive level are not all consistent.) However this
> effect is useful for tracking the recursion depth by eye, so
> I have not bothered to work that issue out. I am wondering
> if your script naturally handles this.

I'd wondered if you did that on purpose. Go to

http://www.utm.edu/staff/caldwell/preprints/temp/

1to30 is just that, 1, 2, 3, ...

Then the flat primes p, pq, pqr, ... to 307

Then the same for the sharp.