Thursday, October 05, 2017

Number Sequence Walks in One Image

To show each stage of the pattern these number sequences make I have changed my script here to zoom out each order of magnitude. This means the path up to 100,1000,10000,100000 and 1000000 will all show up as similar sized. Though coloured differently.

Prime Numbers

Champernowne Number is similar but there are some differences.

even Numbers

Odd Numbers

Nearly Primes (numbers that are not divisible by 2,3,5,7,11,13,17,19) are added tot he string to walk. This walk will be all primes and a few numbers that aren't. The graph is more similar to the prime graph (and I got the scaling a bit wrong at the start )but I am still surprised at how different it is.

Tuesday, October 03, 2017

Zooming in on the loop in Smarandache Sequence

What is going on in the loop here at the bottom right that causes the turtle to change direction? In the Ten thousand digits path it is some of the orange and light purple parts below

to draw just this loop part of the image the code is here. Zoomed in the path looks like this

This image contains the 279 primes from 14503 up to 17183

In the 100K image it seems to be the over 2000 primes between 152003 and 178361 that make up this loop part

Sunday, October 01, 2017

Fractal Pattern in the prime numbers

The Smarandache–Wellin number is made by sticking together all the prime numbers.

2 add on 3 add on 5 add on 7... to make 2357111317192329

A reddit user improved my earlier code with generators. That old code is here. And using the generators from this code I got a prime number checker from here.

With 10k steps this looks like

100k steps

and a million steps (digits)

Five million digits

1000 digits from primes

100 digits looks like an album cover

Here every one tenth of the total distance changes the colour so roughly the blue part on the top left is the previous image. These are primes in the base 10 which is probably why the pattern repeats like that.

These seem really similar to each other. The Champernowne constant seems to do something similar, so maybe most sequences of natural numbers stuck together make repeating patterns like this. I tested the even and off numbers and they kind of do.

even numbers 100k digits

odd numbers 100k digits

The code is here so you can play with it, find bugs and recreate the images. Thanks to the help to the reddit user who recreated the images in Mathematica, code here as a sanity check.

Numbers from a sequence in the base ten make a similar pattern that gets ten time bigger each round. Which doesn't sound surprising said like that. Still the pictures look cool I think.

Champernowne constant might form a fractal

Making each digit of Champernowne constant a step in a logo turtle picture seems to form a fractal picture.

10k steps

100k steps

2 million steps

It seems to form this circle with another below and to the left over and over again.

Saturday, September 30, 2017

Making Turtle pictures with Numbers made from Numbers

The post Random Walks with Number Digits looked at pictures made from the digits of numbers. Go through each digit in turn. If it is 0 take a step to the right. If it is one go 36 degrees down from that. If it is 2 72 degrees etc etc. For base ten numbers this makes a picture that looks like brownian motion but with only 10 directions not any possible direction.

In this post I look at numbers made from numbers.

The Copeland–Erdős constant is made by sticking together all the prime numbers into a number 2 then 3 then 5 then 7 then 11 etc.. 0.235711131719232931374143 A033308. One of these turtle logo pictures made from this number has a very odd pattern. With 1.5 million digits from prime numbers this pattern is made. The Copeland–Erdős constant is normal so I would expect the loop to eventually come back around.

Champernowne constant is made with 1 then 2 then 3 then 4 etc.. 0.12345678910111213141516 makes a similar picture but it is much more curvy. 600k digits looks like

Thursday, September 28, 2017

Random Walks with Number Digits

Say you took each digit of a number and used that to decide which direction to take a step. What path would you follow?

Similar to last post I took Pi, e, Sqrt(2) and random numbers. I multiplied each digit by 36. There are 10 digits to go into the 360 degrees you can go. For 0 step right. For 1 36 degrees down from 0. For 2 72 degrees etc.

Here are the pictures with a description of which number made each at the end. If any look different that might be an indication the digits are not that random.


After drawing this I realised it looked like Dragon Curves. Googling Pi pictures and Golden curves revealed this book. so someone had the idea before.

My code for all these pictures is here. The picture is on reddit and people seemed to like it.

And now other numbers

E first 700k

e next million


Using a random number generator, just for comparison

Catalan Constant

These look like pictures of brownian motion which in effect they are.

Wednesday, September 27, 2017

Pi Digits High Low Game

Suppose you take a long number and for each digit if it is bigger then the previous one increase a counter by one. If it is less then the previous number reduce the counter by one. You keep a running total and graph that total. Noting when it passes 0. This total number will go up and down and can get to zero many times. If you play this game with random numbers in a million digits on average the number of times you will have crossed 0 is 1594.4 and the standard deviation of the number of times crossed 0 is 1207.3. Though as the number of times zero is crossed cannot be less then 0 this is a bit odd.
import random

while j < 200:
	i = 0
	while i < 1000000:
		ran= random.randint(0, 10)
		if ran==last:
		elif ran>last:
		if total==0:
If instead of random numbers the digits of pi are used. This is what the path of total counts looks like
file = open("pi1000000.txt", "r") 
#3.14159265358979323846264338327950 pi2.txt
x = []
y = [] 

pi = list(text)
total =0
i = 0

while i < len(pi):
	if pi[i]>pi[i-1]:
	if pi[i]

Pi has a 0 total 657 times. Which is more than 51 out of 200 random million long sequences did in my tests. None of this means anything. Going up or down based on digits in a base ten number but i like these pattern sort of sequences.

E crosses 0 1725 times

sqrt2 crosses 0 1300 times

and with 2 million digits

The python code for visualisation is 
import numpy as np
import matplotlib.pyplot as plt

plt.scatter(x, y, alpha=0.5, color='green')
plt.title('Sqrt 2 High Low Game')

Friday, April 07, 2017

Your child will live in your car parking space

When autonomous cars become mainstream what will happen to our parking spaces? Most experts think car ownership will become rare when autonomous cars exist.

How driverless cars will change car ownership forever

So Who’s Really Going to Own Autonomous Cars? There’s Four Scenarios.

Most of our houses have parking for two cars outside them. What will we do with these existing spaces then?

1. Rent the spaces out to autonomous cars. Some will do this but their ability to be used more of the time and to park themselves densely in unpopulated areas means we might have better use for the space.

2. More garden.

3. New houses. My two car spaces take up 25 square meters. Which is twice the size of this tiny house.

Or 25m squared is half the floor space of my actual house. And of this Ikea house.

These houses are cheap and I doubt people will be too bothered by having one replace the parking spaces behind their house.

People having a small house at the end of their garden might be already happening. For example this article Why An Increasing Number Of Americans Want To Build A Granny Flat. Explains why more people are already building houses beside their current one. Both young adult children and aging parents might find these small houses preferable to the alternatives. With young people increasingly living at home at an older age and seeming to have higher debts for worse job prospects a granny flat becomes more attractive.

It is possible autonomous cars will end up meaning people live in bigger houses further out of the city. But as a way to retrofit current housing car space houses will be popular.

But if all these car parking spaces become free. And you share with your neighbour enough space build a house the same size as yours. There will be some people who try and build new housing there.