# Cool Math Stuff

Anyway, in my Saturday morning isolation boredom, I learned (on my own) a couple of neat math oddities I hadn’t already known. I’ll start with a few similar ones I already knew, and end up with something I have proven to myself but that @Ether might have made a math quiz.

Known for years (I love φ):
x = (√5 - 1)/2 = 0.61803398874989484820458683436564…
φ = 1/x = 1.61803398874989484820458683436564…
φ² = 2.61803398874989484820458683436564…

x = √2 - 1 = 0.4142135623730950488016887242097‬…
1/x = 2.4142135623730950488016887242097‬…

Learned today (though it feeds into a tile pattern I used for a bathroom floor about a year before the guy who pulled me into FRC (@gixxy) was born!):
2 * atan(1/3) = atan(3/4)
2 * atan(1/2) = atan(4/3)
atan(1/3) + atan(1/2) = atan(1)

And also learned today. I have proven to myself, but I’d like someone else to explain it. I can’t give “credit” like the old CD, but I will like the first clear statement why the digits in the second case match those in the first.

x = 5 - √8 = 2.1715728752538099023966225515806‬…
x² = 4.715728752538099023966225515806‬…

yup, the same set of digits, one place down.

Also, I invite other cool/weird math stuff in this topic!

1 Like

x² = (5-√8)^2
x² = 25 - 10√8 + 8
x² = 33 - 10√8 --> Eqn 1

x = 5-√8 = 2.1715728…
10x = 21.715728
10x - 17 = 4.715728
10(5-√8) -17 = 4.715728
50 - 10√8 -17 = 4.715728
33 - 10√8 = 4.715728 --> Eqn 2

Combine Eqn 1 & Eqn 2
x² = 4.715728

/Edit: Formatting is awful, but I’m not in the mood to put it into LaTex

2 Likes

That’s the key right there! x² = 10x - 17, so the digits repeat one place up.

It's * ok, you_{re} * a * wond \Sigma rful * human *anywa\gamma!

13 Likes

OK, here’s another one. Write a program (pick your language) to efficiently* generate Pythagorean triples of the form:

a² + (a+1)² = c²

* Efficiently: the program should do more work rendering output in decimal than in calculating the values. My gawk script is significantly fewer than 200 non-comment characters, generates 21 properly ordered triples in well under 0.1 seconds on a 6 year old PC, and terminates when it recognizes it is beyond gawk’s resolution limits. It could go on all day with a while (0=0) if gawk supported arbitrary resolution. It uses two variables, four assignment statements, one while statement, and one printf statement. You don’t have to get that far down, but at least close. Oh, and explain why it works! (The explanation should be longer than the functional parts of the program!)

The first few triples are:
0² + 1² = 1² †
3² + 4² = 5²
20² + 21² = 29²
119² + 120² = 169²
696² + 697² = 985²
4059² + 4060² = 5741²

The last gawk can calculate (and the first one excel chokes on) is:
1235216565974040² + 1235216565974041² = 1746860020068409²

† OK, that one isn’t strictly Pythagorean.

1 Like

I have discovered a truly marvelous proof of this, which this margin is too narrow to contain.

Less seriously, I hope this limerick will be okay for this thread:
I have another one, but apparently I left it in my other pants pocket.

…and apparently the spoiler tags don’t work? And the details tag either?

3 Likes

Okay, it took a while to find instructions, but let’s see if this works:

Click to show or hide

A Dozen, a Gross, and a Score,

Plus three times the square root of four,

Divided by seven,

Plus five times eleven,

Equals nine squared, and not a bit more!

6 Likes
Here's the gawk script to generate Pythagorean triples where the legs differ by one
BEGIN {
p=1
q=0
while ((p*p+q*q)%4==1) {
printf "%d² + %d² = %d²\n",
q%2?p*p-q*q:2*p*q, q%2?2*p*q:p*p-q*q, p*p+q*q;
p=2*p+q;
q=(p-q)/2;
}
}

Here's the explanation

Primitive* Pythagorean triples are of the form:

• (p² - q²)² + (2pq)² = (p² + q²)²

Where p and q are mutually prime positive integers, not both odd. OBTW, It is trivial to prove the equality, and that all terms are integers if p and q are positive integers. It is easy to see that p and q must be mutually prime in order to get a primitive* Pythagorean triple; the calculated values would all have the square of the common factor of p and q as a factor. They cannot both be even, because they would have a common factor of 2. They cannot also both be odd, as all numbers in the triple would then be even (share a factor of 2) as odd*odd = odd and odd ± odd = even.

We need to find p & q where |(p² - q²) - 2pq| == 1, or alternately, p² - q² ≈ 2pq, a quadratic in p. That is, p ≈ (2q ± √(4q² + 4q²)) /2 ≈ (1 ± √2)q.
Ratios p/q near √2 are derived p’= p+2q, q’= p+q. Ratios near 1+√2 should be p’=2p+q, q’=p.
OK, will this work? Is it exactly one? Let’s prove this by induction.

• Initial case: p=1, q=0: p² - 2pq - q² = 1 - 0 - 0 = 1.
• Induction: Given p² - 2pq - q² = ±1, show next one is as well.
• p’² - 2p’q’- q’²
= (2p+q)² - 2(2p+q)p - p²
= 4p² + 4pq + q² - 4p² - 2pq - p²
= -p² + 2pq + q²
= - (p² - 2pq - q²) = ∓1.

Termination: By the nature of the formulas, one of p and q must be odd and the other even. Therefore, the sum of their squares is always 1 mod 4. This fails when we hit the resolution limit.

* That is, the greatest common factor of the three numbers is one.

Here’s one I discovered today. I am well acquainted with the formula for triangle numbers, and had previously worked out the formula for tetrahedral numbers. It was only today that I realized those formulas are just special cases of a general formula for triangular cases in an arbitrary number of dimensions. As soon as I saw the pattern, I very quickly convinced myself it was true.
The first two formulas are:

• Triangle(n) = n*(n+1)/2
• Tetrahedron(n) = n*(n+1)*(n+2)/6.
What I realized today was the more general formula for a k-dimensional triangle of edge length n:
• T(k,n) = (n+k-1)!/((n-1)! k!) = choose(n+k-1, k), where choose(a,b) is the number of order independent possibilities of choosing b items from a set of a items, commonly denoted more like (ᵃᵦ), where the a and b are directly over and below each other. This is a very common operation in statistics calculations.

OBTW, the definition of T(k,n) would be 1 for k=0 and any value of n, and Σ(i=0,n,T(k-1,n-i)) for k>0.

Does anyone else see why the general formula is true?

The k=2 column can be interpreted as numbers of close-packed tangent identical circles drawn in a plane, with n circles on each edge. The k=3 column can be seen as numbers of close-stacked tangent cannonballs in space on a flat base, again with n cannonballs on each edge of the stack.

How would you interpret columns k=4, 5, … ?

For anyone who hasn’t seen this:

3 Likes

The numbers look familiar, but I can’t quite place them.

The cannonball piles I started doing with the Stronghold game pieces. I’d leave them that way at competitions at night, and if they are scattered in the morning, I knew someone was playing with the Field!

They are found on the diagonals of Pascal’s Triangle.

2 Likes

Wasn’t there a joke about one of these formulas (probably xkcd) about teasing a math student on “how close” this was to perfect and it’s probably in error. I’m probably mangling the joke badly.

The Greatest Equations of All Time: (James Clerk Maxwell, circa 1862)

And the plaque to prove it.

3 Likes
5 Likes

Yup, that’s the one!

1 Like

The error is less than one part in three billion. Literally close enough for government work.

1 Like

https://en.wikipedia.org/wiki/Mathematical_coincidence is a great list.

A couple of fun ones:

2 \pi + e \approxeq 9
\pi ^ 4 + \pi ^ 5 \approxeq e ^ 6