Blog Archives

Number theory determinant and SymPy

Let σ(n) be the sum of the positive divisors of n and let gcd(a, b) be the greatest common divisor of a and b. Form an n by n matrix M whose (i, j) entry is σ(gcd(i, j)). Then the

Tagged with: , ,
Posted in Math, Python

A prime-generating formula and SymPy

Mills’ constant is a number θ such that the integer part of θ raised to a power of 3 is always a prime. We’ll see if we can verify this computationally with SymPy. from sympy import floor, isprime from sympy.mpmath

Tagged with: , ,
Posted in Python

Fermat’s proof of his last theorem

Fermat famously claimed to have a proof of his last theorem that he didn’t have room to write down. Mathematicians have speculated ever since what this proof must have been, though everyone is convinced the proof must have been wrong.

Tagged with: ,
Posted in Math

Prime-generating fractions

I posted a couple prime-generating fractions on Google+ this weekend and said that I’d post an explanation later. Here it goes. The decimal expansion of 18966017 / 997002999 is .019 023 029 037 047 059 073 089 107 127 149

Tagged with: ,
Posted in Math

Gelfand’s question

Gelfands’s question asks whether there is a positive integer n such that the first digits of jn base 10 are all the same for j = 2, 3, 4, …, 9. (Thanks to @republicofmath for pointing out this problem.) This

Tagged with: ,
Posted in Math

Synchronizing cicadas with Python

Suppose you want to know when your great-grandmother was born. You can’t find the year recorded anywhere. But you did discover an undated letter from her father that mentions her birth and one curious detail:  the 13-year and 17-year cicadas

Tagged with: ,
Posted in Math, Python

Searching for Perrin pseudoprimes

A week ago I wrote about Perrin numbers, numbers Pn defined by a recurrence relation similar to Fibonacci numbers. If n is prime, Pn mod n = 0, and the converse is nearly always true. That is, if  Pn mod

Tagged with:
Posted in Math

Almost if and only if

The Perrin numbers have a definition analogous to Fibonacci numbers. Define P0 = 3, P1 = 0, and P2 = 2. Then for n > 2, define Pn+3 = Pn+1 + Pn+0. The Concrete Tetrahedron says It appears that n

Tagged with:
Posted in Math

Finding 2013 in pi

My youngest daughter asked me this morning whether you can find the number 2013 in the digits of pi. I said it must be possible, then wrote the following Python code to find where 2013 first appears. from mpmath import

Tagged with: ,
Posted in Python

Equivalent form of the Riemann hypothesis

The famous Riemann hypothesis is equivalent to the following not-so-famous conjecture: For every N ≥ 100, | log( lcm(1, 2, …, N) ) – N | ≤ 2 log(N) √N. Here “lcm” stands for “least common multiple” and “log” means

Tagged with: ,
Posted in Math

Digits in powers of 2

Does the base 10 expansion of 2^n always contain the digit 7 if n is large enough? As of 1994, this was an open question (page 196 here). I don’t know whether this has since been resolved. The following Python

Tagged with: ,
Posted in Math, Python

Open question turned into exercise

G. H. Hardy tells the following story about visiting his colleague Ramanujan. I remember once going to see him when he was ill at Putney. I had ridden in taxi cab number 1729 and remarked that the number seemed to

Tagged with: ,
Posted in Math

ABC vs FLT

There’s been a lot of buzz lately about Shinichi Mochizuki’s proposed proof of the ABC conjecture, a conjecture in number theory named after the variables used to state it. Rather than explaining the conjecture here, I recommend a blog post

Tagged with:
Posted in Math

Sociable numbers

A number is called perfect if it is the sum of its proper divisors, i.e. all divisors less than itself. For example, 28 is perfect because 1 + 2 + 4 + 7 + 14 = 28. Amicable numbers are

Tagged with:
Posted in Uncategorized

When do binomial coefficients have integer roots?

Binomial coefficients are hardly ever powers. That is, there are strong restrictions on when the equation has integer solutions for l ≥ 2. There are infinitely many solutions for k = 1 or 2. If k = 3 and l

Tagged with:
Posted in Math