Live data from Hacker News

A prime number whose binary representation looks like a giraffe

reddit.com

31–40 of 82 posts

Re: A prime number whose binary representation looks like a giraffe

#31

Earlier quoted context omitted.

Isn't the largest gap for any prime sqrt(n) ?

not even close. the average gap is closer to log(n).

The average gap is log(n), but the maximal gap is not well understood.

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

Re: A prime number whose binary representation looks like a giraffe

#32
Here's another challenge: find a number whose binary representation looks like Mickey mouse, and find the index where it occurs in the binary representation of pi. Bonus: that index should have a binary representation that looks like a copyright symbol.

Re: A prime number whose binary representation looks like a giraffe

#33
post #24

Earlier quoted context omitted.

where log(n) is the natural logarithm of n https://en.wikipedia.org/wiki/Prime_number_theorem

Any log base is just a multiple of the natural log. When you talk about asymptotic growth, those factors are irrelevant.

It wasn't clear to me that the problem as framed was about asymptotic growth. I was curious if/when the factors might become relevant, so I started sketching this out...

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!

Re: A prime number whose binary representation looks like a giraffe

#34

Earlier quoted context omitted.

It’s pretty much the same thing - take some arbitrary data, and add some bits so that the result is prime. Not surprising from a mathematical point of view since primes are very common, but it’s a fun thing to see.

> primes are very common 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.

Yes, the primes become more sparse, but because there are countably infinitely many of them, and the natural numbers (of which they are a subset) are merely countably infinite, this counts as "common".

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...

Re: A prime number whose binary representation looks like a giraffe

#35

Earlier quoted context omitted.

It is provably prime; I got Mathematica to generate a certificate for it in about five minutes using `PrimeQCertificate`.

Sometimes its a good idea to use a faster probable prime test when searching, and then use a slower test to verify the result. As has been done here.

Lenstra and Pomerace's variant of the AKS test is O(log(n)^6), and deterministic. So polynomial, and not a huge exponent. Still not as fast as the probabilistic algorithms, but not as slow as pre-AKS methods.

Re: A prime number whose binary representation looks like a giraffe

#36

Earlier quoted context omitted.

Any log base is just a multiple of the natural log. When you talk about asymptotic growth, those factors are irrelevant.

It wasn't clear to me that the problem as framed was about asymptotic growth. I was curious if/when the factors might become relevant, so I started sketching this out... 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…

ln 2⁶⁴ⁿ > 2⁶⁴

64n × ln 2 > 2⁶⁴

n > 2⁵⁸ ∕ (ln 2) ≈ 4.2E+17

Re: A prime number whose binary representation looks like a giraffe

#37
post #36

Earlier quoted context omitted.

It wasn't clear to me that the problem as framed was about asymptotic growth. I was curious if/when the factors might become relevant, so I started sketching this out... 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…

ln 2⁶⁴ⁿ > 2⁶⁴ 64n × ln 2 > 2⁶⁴ n > 2⁵⁸ ∕ (ln 2) ≈ 4.2E+17

Such beautiful superscripts and ≈, but then you used * and / instead of × and ÷…

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+'.

Re: A prime number whose binary representation looks like a giraffe

#38
post #31

Earlier quoted context omitted.

not even close. the average gap is closer to log(n).

The average gap is log(n), but the maximal gap is not well understood. 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

> It is still probably true that for every constant {\displaystyle c>2} c>2, there is a constant {\displaystyle d>0} d>0 such that there is a prime between {\displaystyle x} x and {\displaystyle x+d(\log x)^{c}} {\displaystyle x+d(\log x)^{c}}

That's quite fascinating.

Re: A prime number whose binary representation looks like a giraffe

#39
post #36

Earlier quoted context omitted.

ln 2⁶⁴ⁿ > 2⁶⁴ 64n × ln 2 > 2⁶⁴ n > 2⁵⁸ ∕ (ln 2) ≈ 4.2E+17

Such beautiful superscripts and ≈, but then you used * and / instead of × and ÷… 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+'.

Changed * to × (U+00D7 MULTIPLICATION SIGN) and / to ∕ (U+2215 DIVISION SLASH).

I don't like ÷, and I can't be bothered about whitespace. Sorry!

Re: A prime number whose binary representation looks like a giraffe

#40
post #32

Here's another challenge: find a number whose binary representation looks like Mickey mouse, and find the index where it occurs in the binary representation of pi. Bonus: that index should have a binary representation that looks like a copyright symbol.

We don't have the digits of pi for the second part. We only have 22,459,157,718,361 digits of pi which is only ~45 bits not enough to create the image with bits left over for moving it around in pi.
Post reply on HN