5
$\begingroup$

How many digits of $\sqrt{2}$ are known to date, in base 10 and in base 2? I am trying to produce the largest sequence known to date, and would like to sense if I can do it either alone or with hiring someone. I should have no problems producing 1 trillion, but almost sure I can't produce 1 quadrillion in any reasonable amount of time.

The goal is for marketing purposes and not to impress the mathematical community, but instead to attract clients to buy services that I offer. I'd like to also know about the digits of $\pi$, since producing a longer list (albeit for $\sqrt{2}$ or the golden ratio) would have a stronger impact.

Update on 5/4/2023

I am aware of what is in Wikipedia on this subject, and about the integer square root and how to compute it efficiently (for instance using the gmpy2 library). I develop PRNGs based on digits of millions of quadratic irrationals using new fast formulas, starting at arbitrary large locations, see here. If I claim that I can do better than what is in Wikipedia because I don't know the most recent computations, I could be accused of false advertising when stating that I have the longest sequence.

I want to avoid this, thus my question. The target customers will understand the random character of these digits, especially if offering a competition featuring 50k previous digits of one of these numbers starting at some location, and offer a large award (that I know no one will win) for correctly predicting the next 20k digits (with participants not knowing which starting location and which quadratic irrational I use).

I've made quite a bit of research on this topic, for instance - among others - proving that the digits of $\sqrt{2}$ and $\sqrt{3}$ are uncorrelated. The definition of correlation is in the comments.

$\endgroup$
11
  • 2
    $\begingroup$ Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on MathOverflow Meta, or in MathOverflow Chat. Comments continuing discussion may be removed. $\endgroup$
    – David Roberts
    Commented May 4, 2023 at 22:53
  • 7
    $\begingroup$ @VincentGranville: Personal insults like that are way out of line. You’re rapidly entering crank territory here, and if I were you I’d step back and think about what you’re trying to accomplish. $\endgroup$ Commented May 4, 2023 at 22:54
  • 2
    $\begingroup$ @Vincent understood, thanks for clarifying. :-) I hope we can all walk away from this feeling like adults and happy with our interactions. $\endgroup$
    – David Roberts
    Commented May 4, 2023 at 22:55
  • 7
    $\begingroup$ Regarding your proposed application you must know that you can buy a chip that generates several million truly random bits per second (i.e. outcomes of quantum measurements) and then use these to reinitialise a fast PRNG every nanosecond to get numbers that are faster and more random than anything you'll ever be able to produce. $\endgroup$ Commented May 5, 2023 at 16:43
  • 3
    $\begingroup$ @VincentGranville OK, so you're betting that you have an algorithm to spit out digits of $\sqrt{2}$ (or similar) that's at least 1000 times faster than anything out there and you're testing waters before putting up the cash. I do kind of admire the confidence but you should keep your check book ready ;-) $\endgroup$ Commented May 5, 2023 at 17:38

3 Answers 3

17
$\begingroup$

In one sense, all of the base-2 digits (or, I guess, "bits") of $\sqrt{2}$ are known because we have a closed-form formula, according to the OEIS: $$\begin{align} a(n) &= \frac{1}{2} - \frac{2\arctan(\cot(2^{-\frac{3}{2}+n}\pi))}{\pi} + \frac{\arctan(\cot(2^{-\frac{1}{2}+n}\cdot\pi))}{\pi} \\[10pt] &= \left\lfloor 2^{-\frac{1}{2}+n}\right\rfloor -2\left\lfloor 2^{-\frac{3}{2}+n}\right\rfloor \end{align}$$

ETA:

According to Wikipedia, the record number of digits for $\sqrt{2}$ as of this writing is $10^{13}+1000$. Further, this website purports to contain information regarding world records for the computation of various constants. I am unsure of how credible that site is but it came up in the citations on the Wikipedia page.

$\endgroup$
11
  • 14
    $\begingroup$ Great, I was not aware of this. Then, can you tell me, out of curiosity, what is its binary digit in position $2^{10^{10}}$? Thank you. $\endgroup$ Commented May 4, 2023 at 3:02
  • 15
    $\begingroup$ Touché⠀⠀⠀⠀⠀⠀⠀⠀⠀ $\endgroup$
    – mhum
    Commented May 4, 2023 at 4:00
  • 5
    $\begingroup$ This is why this is an interesting question. In a sense, also all the digits of $\pi$ are known, since we can write down a formula that computes them. However this is clearly not satisfactory. Just having a formula then doesn't mean the digits are "known." But then in what sense are all the digits of $1/7$ "known"? Are they really? I think that we say we "know" the digits of $1/7$ because we think we know all that can possibly be said about them. They repeat infinitely in the same pattern, and that's the end of the story. But just having a formula clearly isn't enough, ... $\endgroup$
    – R.P.
    Commented May 4, 2023 at 7:43
  • 39
    $\begingroup$ Here's another formula for the $n$th digit: $a(n) = \lfloor 10^n \cdot \sqrt{2} \rfloor \bmod 10$. Moreover, this formula has an easy generalization to the digits of $\pi$ and many others! $\endgroup$ Commented May 4, 2023 at 10:05
  • 23
    $\begingroup$ I personally know all the digits of $\sqrt2$, $\pi$, and many other constants. I'm not always so clear on their order, though. $\endgroup$
    – LSpice
    Commented May 4, 2023 at 18:19
17
$\begingroup$

My (very limited) understanding of the paper

Polynomial Factorization and Nonrandomness of Bits of Algebraic and Some Transcendental Numbers

is that bit strings of algebraic numbers are not "cryptographically secure". The authors (Kannan, Lenstra and Lovász) write as the first sentence of the abstract:

We show that the binary expansions of algebraic numbers do not form secure pseudorandom sequences

Edit: Here is a bit of their first paragraph:

We show that if a complex number $a$ satisfies an irreducible polynomial $h(X)$ of degree $d$ with integral coefficients in absolute value at most $H$, then given $O(d^2 + d \cdot \log H)$ bits of the binary expansion of the real and complex parts of $a$, we can find $h(X)$ in deterministic polynomial time (and then compute in polynomial time any further bits of $a$).

So in your case $a = 2^n \sqrt{q} - p$ solves the polynomial equation

$$(X + p)^2 - 2^{2n}q = X^2 + 2pX + (p^2 - 2^{2n}q) = 0.$$

This has degree $d = 2$. Both $p$ and $2^{2n}$ have bit-size $O(n)$. If $q$ also has bit-size $O(n)$, and if you provide $O(d^2 + d \log H) = O(4 + 2 n) = O(n)$ bits, then their attack applies.


I'll end with the canonical (and very flashy but perhaps slightly unfair!) quote from von Neumann, found in his paper Various techniques used in connection with random digits:

Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin. For, as has been pointed out several times, there is no such thing as a random number --- there are only methods to produce random numbers, and a strict arithmetic procedure of course is not such a method.

$\endgroup$
6
  • 1
    $\begingroup$ 1984 paper: dl.acm.org/doi/pdf/10.1145/800057.808681 $\endgroup$
    – jeq
    Commented May 4, 2023 at 22:08
  • 1
    $\begingroup$ If my understanding is correct after a quick reading, in this context it means that if you known enough digits of a quadratic irrational $p + \sqrt{q}$ then you can retrieve $q$ easily, albeit the time depends on how large $q$ is. That makes perfect sense and sounds obvious to me. However here we are talking about $q$ that can be very large, compounded by the fact that it's not the digit starting at position 1 but an arbitrary starting location, say $10^{12}$. The same is true with congruential PRNGs if you use small moduli. $\endgroup$ Commented May 4, 2023 at 22:26
  • 6
    $\begingroup$ Yes, congruential PRNG are the epitome of cryptographically insecure. And? $\endgroup$ Commented May 5, 2023 at 5:38
  • 2
    $\begingroup$ @jeq, re, the AMS's version of the paper seems to be the one being cited, and I find the scan easier to read (literally, in the sense that the characters are more legible). $\endgroup$
    – LSpice
    Commented May 5, 2023 at 6:46
  • 1
    $\begingroup$ @LSpice. Yes, agreed: the 1984 one has no abstract. The 1988 version says "This paper is the final journal version of [the 1984 version], which contains essentially the entire contents of this paper." $\endgroup$
    – jeq
    Commented May 5, 2023 at 14:55
5
$\begingroup$

This is a comment about your proposed application to PRNGs. If you're trying to "sell" a PRNG, then most customers will want to know if your method is faster and more secure than some standard cryptographic RNG, such as one based on the Advanced Encryption Standard. While I obviously don't know the details of your proposed method, I suspect that it will not be faster or more secure than the Advanced Encryption Standard. In any case, that's the sort of "baseline" that you should be using for comparison, if PRNGs really are your main "product."

$\endgroup$
4
  • $\begingroup$ The full version uses millions of quadratic irrationals (properly chosen) and a large number of digits for each of them, starting at an arbitrary and different (large) location for each one. So it's like having millions of seeds, and each one can be chosen based on the time the algorithm is run. Formula is very fast and not that much different in complexity than standards PRNG. Indeed congruential PRNG, in some sense, can be viewed as an approximation of my method, using rational rather than irrational numbers. $\endgroup$ Commented May 5, 2023 at 17:03
  • $\begingroup$ [Continued] I also plan to use it potentially for a new business of my own. A synthetic stock exchange (each quadratic irrational playing the role of a stock in the stock market) or an online lottery where the winning numbers can be computed beforehand with a public algorithm that I share. So more like a math competition to find the winning numbers, but with a public algo that would take hundreds of years to find them. Legal aspects of this business is a can of worms in itself of the same complexity as the math problem itself, but MO is not the right platform (I think) to discuss legalities. $\endgroup$ Commented May 5, 2023 at 17:09
  • 2
    $\begingroup$ @VincentGranville Millions of seeds is typically considered to be inadequate nowadays. One typically wants at least $2^{128}$ seeds or preferably $2^{256}$ seeds. $\endgroup$ Commented May 5, 2023 at 18:05
  • $\begingroup$ Millions of seeds is in the testing version right now. It can be increased but for my purposes, a much smaller number is actually good enough. Also think about the millions of people using Mersenne twister these days (the Python rand function). They could use my system instead, more random and fast enough that I have no problems dealing with trillions of digits in very heavy simulations that need perfect randomness and replicability, more than most businesses need. And in the end, probably sold at a fraction of the cost of competitors, and free for most people (consumers, programmers). $\endgroup$ Commented May 5, 2023 at 18:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .