## Using the arctan Power Series to Calculate Pi

(Note: this post is an extension on the calculating pi with python post from a couple of years back. Also here’s another way to inefficiently calculate pi with Buffon’s Needles.) We’re currently working with Power series and Taylor series in Calculus. One particularity pretty derivation is going from the series for to the series for […]

## Kaprekar’s constant

A student talked about Kaprekar’s constant (6174) during their my favorite presentation. Really cool. Steps (from wikipedia): Take any four-digit number, using at least two different digits. (Leading zeros are allowed.) Arrange the digits in descending and then in ascending order to get two four-digit numbers, adding leading zeros if necessary. Subtract the smaller number […]

## Two James Tanton Questions

It’s midterm week at school, and James Tanton threw out two interesting questions in two days. I spent a little time programming “solutions” to these problems (not solutions, just verifications for an infinitesimally small portion of the natural numbers). Problem One: Start with a prime, square it, and add 4. Repeat. (eg 3->13->173->…) Must eventually […]

## Bouncing balls python simulation

Linked from the Visualizing Math blog, a cool simulation of bouncing balls with randomized gravity and bouncing coefficients. Forward Slash Reality Check out the video too.

## Fractal Brownian Tree

@fawnpnguyen whoa. Need to try and make this. — Dan Anderson (@dandersod) June 4, 2013 I started off and used VPython to create the fractal, but it was slow and buggy. Here’s a movie of my first attempt. When you click you create a new “seed” for the fractal to start.  So I rewrote it […]

## Calculate Pi with Python

Intro to Computer programming worked at calculating digits of pi today. The actual algorithms aren’t too bad, but getting more than the standard number of digits from a double is a bit trickier. Here’s a program that calculates pi using: Bailey–Borwein–Plouffe formula Bellard’s formula and Chudnovsky algorithm Holy smokes is Chudnovsky algorithm’s fast! Plouff Bellard Chudnovsky Iteration […]

## Reducing Prime

Number theory nugget: 357686312646216567629137 is a prime number which remains prime after removing any number of digits from the left side! — Maths World UK (@MathsWorldUK) March 4, 2013 Otherwise known as left-truncating primes with every suffix prime and no digit are zero. Here is the whole sequence. It was proven that 357686312646216567629137 is the last […]

## Google Blockly

From @joshgiesbrecht , fantastic web app from Google. Blockly is a web-based programming environment that allows you to export the code as Python, Javascript, Dart (anyone outside of google use this??), or XML (wow ugly code). Blockly was just released a couple of days ago so it’s still rough around the edges, but has a nice […]

## Fibonacci and Recursion

To introduce the fibonacci sequence using the recursive series to my Pre-Calc H class (although most of them know it), I came up with something on the fly that worked nicely. To set up the fibonacci sequence, I showed them a recursive program that calcuates the sequence in a very clear (but inefficient) way. This […]

## Dr. Square

Much like the Collatz conjecture, the Dr. Square Puzzle (from the blog mathforlove) is an intriguing problem. With some playing around, we came up with what I think is an excellent (and solvable) puzzle. He dubbed it the Dr Square puzzle, because it involves one of the steps in taking the digital root (dr) and squaring numbers. Here’s how it goes. […]