A prime number whose binary representation looks like a giraffe
reddit.com
reddit.com
0000000000000000000000000000000000000000000000000001000101101001
So the idea is that you produce any 63x64 binary image then you find a number up to 2^64 so that added to the number represented by the first image gives a prime. It's not exactly amazing, but clever enough.
Several other methods can work... Primes are not rare at all - average prime gaps are fairly small in that domain...
The 63x64 binary canvas is made of integers on the order of 2^4032. (Please forgive my approximation notation.)
ln(2^4032) ~= 2795
log_10(2^4032) ~= 1214
So, the difference between natural log (for this canvas size) and log base 10 is only one binary digit (min 11, max 12). The "noise" you need to introduce to the image will definitely keep to the bottom right corner.So, I'm curious how tall the phone-width image needs to be before the required noise exceeds 64 bits (aka a single row). And the answer is... Too tall to be calculated quickly with my brute force method of "try bigger numbers until you get too impatient to wait for your desktop to calculate the natural log".
I'm sure if I spent enough time drawing the parameters out, I'd eventually agree that there's no representation of this problem where those factors ever become relevant.
BUT.
If the problem we were calculating involved log base 1.0001 instead of the natural log, those factors would become relevant at much smaller canvas sizes. I would love to hear an intuitive explanation of logarithms that would convince me to not bother making calculations like this in the future!
64n × ln 2 > 2⁶⁴
n > 2⁵⁸ ∕ (ln 2) ≈ 4.2E+17
I like to also put plenty of THIN SPACE ( ) in to give it space to breathe, e.g. 2 ⁶⁴ ⁿ and 64 n instead of 2⁶⁴ⁿ and 64n. I make my thin spaces with Compose+Space+'.
I don't like ÷, and I can't be bothered about whitespace. Sorry!
That looks nice and gets rid of the confusion over number like "1,234" and "1.234". In the US, the former is the integer 1234 and the later is the rational number 1234/1000. In Germany or France, these would be the other way around. In SI, "1.234" and "1,234" would both be 1234/1000, and the integer 1234 would be "1 234" with the space there being a thin space.
Unfortunately, HN does not support THIN SPACE as far as I can tell.
Reddit is a little better. You can enter it in a comment and it will be correctly saved with the comment and it will display correctly in the browser. As long as you don't need to make any edits to your comment afterwards, it is fine.
If you edit the comment thin spaces are converted to regular spaces when it loads the editing widget, so unless you go through and put all the thin spaces back you will lose them when you save.
I’m not at all fond of the thin space digit grouping practice; to my Australian eyes it tends to look fairly terrible in most places, like bad kerning.
Your comment also shows another catastrophic weakness of using a regular thin space for digit grouping without additional magic: you need a non-breaking thin space, but there isn’t one. On my comments page, your comment shows the 1 on one line, and the 234 on the next.
I love my YYYY-MM-DD dates (I use it everywhere where the date format isn’t prescribed, and thus get the occasional odd look on forms and such from people aren’t used to that form of date—so you can see I’m not afraid of deviating from local conventions to prefer superior or sometimes merely international ones), but I hate and consequently don’t use thin space digit grouping in general.
You earlier comment shows up with thin spaces on Chrome for me, but not on Safari or Firefox.
I know Firefox handles thin spaces, because it handles this Reddit comment just fine: https://www.reddit.com/r/Physics/comments/67g28i/because_gra...
I'm going to paste the examples from there here and see what happens:
1234567 (U+200B, ZERO WIDTH SPACE)
1 234 567 (U+200A, HAIR SPACE)
1 234 567 (U+202F, NARROW NO-BREAK SPACE)
1 234 567 (U+2009, THIN SPACE)
1 234 567 (U+2006, SIX-PER-EM SPACE)
1 234 567 (U+2008, PUNCTUATION SPACE)
1 234 567 (U+2005, FOUR-PER-EM SPACE)
1 234 567 (U+2004, THREE-PER-EM SPACE)
1 234 567 (U+0020, SPACE)
1 234 567 (U+2000, EN QUAD)
1 234 567 (U+2002, EN SPACE)
1 234 567 (U+2007, FIGURE SPACE)
1 234 567 (U+2003, EM SPACE)
1 234 567 (U+2001, EM QUAD)
Edit: they displayed with the various different space sizes in Chrome, and with fixed space sizes in Firefox (1 regular space for all except 200B and 202F which showed up with no space).
Unlike Reddit, editing does not lose information.
Also displays right in Edge, and in Firefox on Windows. So it looks like it is just Firefox Mac and Safari that are not handling the various space sizes for me.
Given chrismorgan's comment about breaking, it seems that NARROW NO-BREAK SPACE would be a better choice for digit grouping, right?
As far as the display problem on Firefox and Safari on Mac goes, I've done some experimenting. It looks like it is a font thing. HN has "font-family:Verdana, Geneva, sans-serif;" as part of the style sheet.
I made a minimal test page with just the different space examples, and an internal style sheet that just set the font-family for the body, and it shows the problem. Changing it to "Arial, sans-serif" makes it work.
I've never looked seriously into fonts for browsers, so have no idea what is going on at this point. If there is a problem with the Mac versions of Verdana and/or Geneva, then why is it only affecting Firefox and Safari, and not Chrome, on my Mac?
If anyone else wants to try to figure this out, here is the test page I've been using:
<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<title>space test</title>
<style>
body { font-family:Verdana, Geneva, sans-serif; }
xbody { font-family:sans-serif;}
xbody { font-family:Arial, sans-serif;}
</style>
</head>
<body>
<p>
1​234​567 (U+200B, ZERO WIDTH SPACE)<br/>
1 234 567 (U+200A, HAIR SPACE)<br/>
1 234 567 (U+202F, NARROW NO-BREAK SPACE<br/>
1 234 567 (U+2009, THIN SPACE)<br/>
1 234 567 (U+2006, SIX-PER-EM SPACE)<br/>
1 234 567 (U+2008, PUNCTUATION SPACE)<br/>
1 234 567 (U+2005, FOUR-PER-EM SPACE)<br/>
1 234 567 (U+2004, THREE-PER-EM SPACE)<br/>
1 234 567 (U+0020, SPACE)<br/>
1 234 567 (U+2000, EN QUAD)<br/>
1 234 567 (U+2002, EN SPACE)<br/>
1 234 567 (U+2007, FIGURE SPACE)<br/>
1 234 567 (U+2003, EM SPACE)<br/>
1 234 567 (U+2001, EM QUAD) </p>
</p>
</body>It’s also common for web fonts especially to possess glyphs for some of the fancier spaces, but as duplicates of SPACE, i.e. the wrong size.
Face it: fonts (to a degree the technology, but mostly the actual fonts) are generally pretty bad.
ln(2^n) = n * ln(2)
log_10(2^n) = n * log_10(2)
Which, substituting x for 2^n, gives log_10(x) = ln(x) * (log_10(2) / ln(2))
you can do replace 2 by any positive number here. So, the value of log_10(x) / ln(x)
is independent of x. A bit of thinking will show it to be equal to ln(10)
And indeed, 1214 * ln(10) ~= 2795,338The subthread started when someone thought it was necessary to point out that the log everyone was talking about was the natural log.
Independent of what the actual problem is, say someone tells you that something is log(n). It is a safe assumption that they mean ln(n), but if you are are speaking out loud, that is still pronounced "log n".
What I'm looking for is better intuitions on F/ln(n) versus F/log_x(n) for some completely arbitrary function F. The intuitions for x > e are very different than the intuitions for x < e. (This is just the nature of exponents. Maybe there is no further intuition for me to develop here, other than to just practice more.)
The prime number theorem is of this stronger form, and it is in fact only the natural logarithm that makes the usual statement true. It is considerably more difficult to prove this asymptotic result (first proven 1896) than to get "within a multiplicative constant" as in big-O notation (first proven 1848--50).
According to https://en.wikipedia.org/wiki/Cram%C3%A9r%27s_conjecture, current results are
Unconditional: n^0.525
Conditional on RH: log(n)*sqrt(n)
Conjecturally: log(n)^2
That's quite fascinating.
Note that if the picture is prime, then the last line must always contain noise... the last digit must be a 1!
I also feel like it's slightly cheating that the first line doesn't contain noise, or a leading 1 digit... the number doesn't naturally fit into 64x64 bits because of all the leading zeroes.
There are 25 primes in [1, 100]. There are 16 in [1001, 1100]. There are 6 in [1000001, 1000100].
I'm imaging something like this, but with a giraffe instead: https://6d4be195623157e28848-7697ece4918e0a73861de0eb37d0896...
(Sorry for unreadable CDN link)
111010101111001000110101111111001001000010000
000000000000000000000000000000000000000000001
000000000000000001110111111100000000000000001
100000000000011110000000000011010000000000001
000000000011100000000000000000011100000000000
100000000100000000000000000000000011000000001
100000011000000000000000000000000000100000001
100000110000000001000000001000000000011000001
100000100000000001000000001000000000001100000
000001000000000001000000001000000000000100001
100010000000000001000000001000000000000010000
000010000000000001000000001000000000000010001
000010000000000001000000001000000000000010000
000010000000000000000000000000000000000010000
100010000001100000000000000000001100000010001
000001000000110000000000000000011000000100000
000000100000011000000000000000110000001100001
100000110000001111000000000111100000011000000
000000011000000001111111111100000000100000000
100000000100000000000000000000000011000000001
000000000011100000000000000000011100000000000
100000000000011110000000000011010000000000000
100000000000000001110111111100000000000000000
100000000000000000000000000000000000000000001
111011110010001011101100010110111111110011001
As a number, it's 418286130038247526051590581692998429049634527936177232676862400134230223310124567196900044669909574838414882468188159808593146618824409867113710174334769625185535031892647808338085451521099179358299885075661065903947563499117521951858387121272237585876050870984471996640946451287415573046990997289875221396633775785411121263373993999302553.
This took 487 random border attempts to find, which seems pretty small!Note that efficient primality tests are probabilistic, so there's a small chance this isn't actually prime. I expect it's the same with the giraffe one in the link.
Edit: Here's the code (improved a bit over what made the picture above): https://gitlab.com/snippets/1694391
100000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000
000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000111
110000000000000000000000000000000000000000000000000000000000111111000000000000000000000000000000
000000000000000000000000000011111110000000000000000000000000000000000000000000000000000000011111
111000000000000000000000000000000000000000000000000000000001000011110000000000000000000000000000
000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000000
011110000000000000000000000000000000000000000000000000000000000000111100000000000000000000000000
000000000000000000000000000000000011110000000000000000000000000000000000000000000000000000000000
000111100000000000000000000000000000000000000000000000000000000000011111000000000000000000000000
000000000000000000000000000000000000111110000000000000000000000000000000000000000000000000000000
000011111100000000000000000000000000000000000000000000000000000000000111111100000000000000000000
000000000000000000000000000000000000011111111100000000000000000000000000000000000000000000000000
000000111111111100000000000000000000000000000000000000000000000000000011111111111000000000000000
000000000000000000000000000000000000000111111111111000000000000000000000000000000000000000000000
000000001111111111111100000000000000000000000000000000000000000000000000111111111111111100000000
000000000000000000000000000000000000000011111111111111111000000000000000000000000000000000000000
000000001111111111111111110000000000000000000000000000000000000000000000111111111111111111000000
000000000000000000000000000000000000000011111111111111111110000000000000000000000000000000000000
000000001111111111111111111000000000000000000000000000000000000000000000011111111111111111100000
000000000000000000000000000000000000000001111111111111111110000000000000000000000000000000000000
000000000111100001111111110000000000000000000000000000000000000000000000011110000011111111000000
000000000000000000000000000000000000000001111000000111111100000000000000000000000000000000000000
000000001111100000011111110000000000000000000000000000000000000000000000110110000000110111000000
000000000000000000000000000000000000000011011000000011101110000000000000000000000000000000000000
000000011001100000001110111000000000000000000000000000000000000000000001100110000000111001110000
000000000000000000000000000000000000000110011000000011100110000000000000000000000000000000000000
000000011001100000001100011000000000000000000000000000000000000000000000110010000000100001100000
000000000000000000000000000000000000000001001000000110000110000000000000000000000000000000000000
000000000011100000010000011000000000000000000000000000000000000000000000001110000011000001100000
000000000000000000000000000000000000000000011000011000000110000000000000000000000000000000000000
000000000001100001100000011000000000000000000000000000000000000000000000000111001100000001100000
000000000000000000000000000000000000000000011100110000000110000000000000000000000000000000000000
000000000001010011000000010000000000000000000000000000000000000000000000001100000000000011000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000001000101101001This particular one only looks like a giraffe when it's interpreted as a 1bpp big-endian bitmap, but you could probably do the same with a colour (24bpp, in whatever order you wish) photo.
Here's another fun idea: write a short program that checks if a file is a prime number. Now you can get into the principles of CRCs, RS, and other error-correction codes...
What do you mean? I tried googling but failed.
https://www.wolframalpha.com/input/?i=22,459,157,718,361+to+...
So to find the number of bits you can support for an algorithm like this, taking the log of the number of digits of pi we know gives you a rough estimate.
That gives a roughly 7x7 grid to draw © in which is pretty limited and might be the minimum viable for a clean ©. (and that's been a touch generous by allowing 0 padding on the front of the number)
https://www.reddit.com/r/dataisbeautiful/comments/79hads/wal...
See also Zachary Abel's Prime Portraits article [3].
[1]: https://news.ycombinator.com/item?id=15208317
[2]: https://www.youtube.com/watch?v=fQQ8IiTWHhg
[3]: http://archive.bridgesmathart.org/2016/bridges2016-359.pdf
[0]: http://mathworld.wolfram.com/TuppersSelf-ReferentialFormula....
I would also like to conjecture that there is infinitely many primes that look like a giraffe in binary, so it's nothing that unusual.
Still, given my username I should add something ...
So if the size was prime x prime then the fact that the number of bits is a semi-prime tells you the size of the image, even if all you have is a stream of digits. Then the "noise" at the end will tell you what the least significant bits are, and hence you get an image without very much ambiguity.
Just thought I'd mention that.
Isn't it thought that they get more and more rare the further you go away from zero in the positive direction?
By the way I just realized why no negative numbers are prime and that's because -1 is a factor in all of them. Quite obvious but I just never thought about it before.
In number theory we define primes as a subset of the natural numbers, which excludes negative integers. But when you move on to abstract algebra, the definition of a prime element in a commutative ring is an element p, such that p|ab implies p|a or p|b. Using this definition, we can conclude that the prime elements in the ring of integers are both the positive and negative primes.
Our intuitions about this stuff are not very helpful in mathematics. For example, _most_ numbers are normal in any base (if you wrote them out as a decimal fraction they'd have an evenly distributed amount of all the different digits, forever) and we can prove this is true of the set of real numbers - but even though we know it's true, we don't have any definite examples of such numbers, the closest are we think Pi might be normal but we can't prove it, and we know Chaitin's constants are normal for sure, but by definition there's no way to write one of those down...
Either way, this is really cool.
It's still way cool, but how much cooler woulc it have been if a mathematician had stumbled upon this by accident...
https://news.ycombinator.com/user?id=RiderOfGiraffes
There shouldn't be two answers for that equation. That is just too weird of a coincidence.