---
title: 'Two James Tanton Questions'
url: 'https://blog.recursiveprocess.com/2014/01/28/two-james-tanton-questions'
markdown: 'https://blog.recursiveprocess.com/2014/01/28/two-james-tanton-questions.md'
date: '2014-01-28'
description: '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 …'
taxonomy:
  category:
    - blog
---

# Two James Tanton Questions

### [Two James Tanton Questions](https://blog.recursiveprocess.com/2014/01/28/two-james-tanton-questions)

   January 28, 2014, 12:00 am  

It’s midterm week at school, and [James](https://twitter.com/jamestanton/) [Tanton](http://www.jamestanton.com/) 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 reach a non-prime?
> 
> — James Tanton (@jamestanton) [January 27, 2014](https://twitter.com/jamestanton/statuses/427759506773528576)

[Here’s my processing.org code for this problem.](https://dl.dropboxusercontent.com/u/3646828/prime_sequences.pde) And here’s the output of the code, each time the sequence gets longer, it prints out the new “max” sequence length. [![2014-01-28_08h29_27](https://blog.recursiveprocess.com/wp-content/uploads/2014/01/2014-01-28_08h29_27.jpg)](https://blog.recursiveprocess.com/wp-content/uploads/2014/01/2014-01-28_08h29_27.jpg)

I didn’t use any of processing.org’s graphics but I had the prime function optimized, so it was quick work.

## Problem Two:

> Start with a whole number, square it, and add 4. Repeat. (eg 2->8->68->4628->…) Must every starting nmbr eventually hit a multiple of 13?
> 
> — James Tanton (@jamestanton) [January 28, 2014](https://twitter.com/jamestanton/statuses/428128455646269440)

[Here’s the python code for the “solution”.](https://dl.dropboxusercontent.com/u/3646828/jamestanton2.py) And here’s the last six lines of the output of the code. [![2014-01-28_08h31_32](https://blog.recursiveprocess.com/wp-content/uploads/2014/01/2014-01-28_08h31_32.jpg)](https://blog.recursiveprocess.com/wp-content/uploads/2014/01/2014-01-28_08h31_32.jpg) I checked all numbers under 1,000,000, and all the sequences were finite (they stopped at a multiple of 13). The starting number whose sequence ended in the largest multiple of 13 was 964,665, and the multiple of 13 had 384 digits (BIG NUMBER! There are only ~10^80 particles in the *entire universe*). Fun stuff.

\[Edit: 1/28/2014 9:08am\] Ok, ok. James asked for a proof for the second problem. Here you go 🙂 [![2014-01-28 09-05-38](https://blog.recursiveprocess.com/wp-content/uploads/2014/01/2014-01-28-09-05-38.jpg)](https://blog.recursiveprocess.com/wp-content/uploads/2014/01/2014-01-28-09-05-38.jpg)

 [ Next Post](https://blog.recursiveprocess.com/2014/02/05/brian-greenes-take-on-teachers) [Previous Post ](https://blog.recursiveprocess.com/2014/01/16/prime-matrix-processing)

#### SimpleSearch

Bootstrap Theme for [Grav](http://getgrav.org)

---

## Navigation

- Parent: [A Recursive Process](https://blog.recursiveprocess.com/index.md)
- Previous: [Brian Greene’s take on teachers.](https://blog.recursiveprocess.com/2014/02/05/brian-greenes-take-on-teachers.md)
- Next: [Prime Matrix – Processing](https://blog.recursiveprocess.com/2014/01/16/prime-matrix-processing.md)
