|
![]() ![]()
![]() ![]() |

Years ago I wrote a post Golden powers are nearly integers. The post was picked up by Hacker News and got a lot of traffic. The post was commenting on a line from Terry Tao: The powers φ, φ2, φ3, … of the golden ratio lie unexpectedly close to integers: for instance, φ11 = 199.005… is […]
The post Golden powers revisited first appeared on John D. Cook.- Facebook✓
- Google+✓
- Instapaper✓
- Tweet✓

Suppose you need to write software to compute the sine function. You were told in a calculus class that this is done using Taylor series—it’s not, but that’s another story—and so you start writing code to implement Taylor series. How many terms do you need? Uh, …, 20? Let’s go with that. from math import […]
The post Naively computing sine first appeared on John D. Cook.- Facebook✓
- Google+✓
- Instapaper✓
- Tweet✓

The Euler-Mascheroni constant is defined as the limit So an obvious way to try to calculate γ would be to evaluate the right-hand side above for large n. This turns out to not be a very good approach. Convergence is slow and rounding error accumulates. A much better approach is to compute It’s not obvious […]
The post Computing the Euler-Mascheroni Constant first appeared on John D. Cook.- Facebook✓
- Google+✓
- Instapaper✓
- Tweet✓

It is possible to express every positive integer as a sum of powers of the golden ratio φ using each power at most once. This means it is possible to create a binary-like number system using φ as the base with coefficients of 0 and 1 in front of each power of φ. This system […]
The post Golden ratio base numbers first appeared on John D. Cook.- Facebook✓
- Google+✓
- Instapaper✓
- Tweet✓

Sometimes a paper comes out that has the seeds of a great idea that could lead to a whole new line of pioneering research. But, instead, nothing much happens, except imitative works that do not push the core idea forward at all. For example the McCulloch Pitts paper from 1943 showed how neural networks could […]
The post Scientific papers: innovation … or imitation? first appeared on John D. Cook.- Facebook✓
- Google+✓
- Instapaper✓
- Tweet✓

I just stumbled across the binomial number system in Exercise 5.38 of Concrete Mathematics. The exercise asks the reader to show that every non-negative integer n can be written as and that the representation is unique if you require 0 ≤ a < b < c. The book calls this the binomial number system. I skimmed a paper […]
The post Binomial number system first appeared on John D. Cook.- Facebook✓
- Google+✓
- Instapaper✓
- Tweet✓

Casting out nines is a well-known way of finding the remainder when a number is divided by 9. You add all the digits of a number n. And if that number is bigger than 9, add all the digits of that number. You keep this up until you get a number less than 9. This […]
The post Additive and multiplicative persistence first appeared on John D. Cook.- Facebook✓
- Google+✓
- Instapaper✓
- Tweet✓

Logarithms give a way to describe large numbers compactly. But sometimes even the logarithm is a huge number, and it would be convenient to take the log again. And maybe again. For example, consider googolplex = 10googol where googol = 10100. (The name googol is older than “Google,” and in fact the former inspired the […]
The post Iterated logarithm first appeared on John D. Cook.- Facebook✓
- Google+✓
- Instapaper✓
- Tweet✓

“The inverse of an approximation is an approximation of the inverse.” This statement is either obvious or really clever. Maybe both. Logs and exponents Let’s start with an example. For moderately small x, That means that near 1 (i.e. near 10 raised to a small number, The inverse of a good approximation is a good […]
The post Approximation of Inverse, Inverse of Approximation first appeared on John D. Cook.- Facebook✓
- Google+✓
- Instapaper✓
- Tweet✓

Fermat’s primality test Fermat's little theorem says that if p is a prime and a is not a multiple of p, then ap−1 = 1 (mod p). The contrapositive of Fermat’s little theorem says if ap−1 ≠ 1 (mod p) then either p is not prime or a is a multiple of p. The contrapositive is used to test whether a number is prime. Pick a number a less […]
The post False witnesses first appeared on John D. Cook.- Facebook✓
- Google+✓
- Instapaper✓
- Tweet✓