About

This is an experiment that was created out of curiosity. The purpose is to see how computer generated sequences take form given certain restrictions. It's inspired by the great On-Line Encyclopedia of Integer Sequences database but with the intention to be entirely machine generated.

Helping out

If you have a sequence that is not in the database but should be because it can be machine generated. I will never add a single sequence, but if you have found an underlying generative form that interesting I will try to add it. This will capture multiple sequences on the same form. E.g. when the recursive form it automatically resulted in large amounts of new sequences.

Contact

If you have any feedback or questions, please don't hesitate to contact me. You can contact me at jon AT jonkagstrom DOT com or via twitter

Examples

Here are a few examples on different generated sequences.

Square numbers

0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576
This common sequence is generated either directly by n*n or recursively by n+a(n-1), a(0)=0.

Prime gaps

1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4
Gaps between consecutive primes, generated by p(n)-p(n-1), n≥1.

Golden Ratio

2, 1.5, 1.6666666667, 1.6, 1.625, 1.6153846154, 1.619047619, 1.6176470588, 1.6181818182, 1.6179775281, 1.6180555556, 1.6180257511, 1.6180371353, 1.6180327869, 1.6180344478, 1.6180338134, 1.6180340557, 1.6180339632, 1.6180339985, 1.618033985, 1.6180339902, 1.6180339882, 1.618033989, 1.6180339887, 1.6180339888
Decimal sequences may converge into interesting constants, the generated program (a(n-1)+1)/a(n-1), a(0)=2 converges into the golden ratio, ~1.618033988.

Euler e

1, 2, 2.5, 2.6666666667, 2.7083333333, 2.7166666667, 2.7180555556, 2.7182539683, 2.7182787698, 2.7182815256, 2.7182818011, 2.7182818262, 2.7182818283, 2.7182818284, 2.7182818285, 2.7182818285, 2.7182818285, 2.7182818285, 2.7182818285, 2.7182818285, 2.7182818285, 2.7182818285, 2.7182818285, 2.7182818285, 2.7182818285
Here is another famous constant e (2.7182818285...) generated by a(n-1)+(a(n-1)-a(n-2))/n, a(0)=1, a(1)=2

Euler Zeta, s=1

2, 3, 3.75, 4.375, 4.8125, 5.2135416667, 5.5393880208, 5.8471317998, 6.1129105179, 6.3312287507, 6.5422697091, 6.7239994232, 6.8920994088, 7.0561970138, 7.209592601, 7.3482386126, 7.4749323818, 7.5995145881, 7.7146587486, 7.8248681593, 7.9335468837, 8.0352590232, 8.1332499869, 8.2256732822, 8.3113573789
This sequence is probably the reason I built this site. A while back I was playing with the Sieve of Eratosthenes. By counting how often each term strike out following composite numbers this sequence appeared. 3 strikes out every second, 5 every third, 7 every 3.75, 11 every 4.375 and so on. I had no idea that this was Euler Zeta with exponent 1 at the time. I asked a friend who is very good at maths to figure out the formula, and after a while he came back with the answer. Somewhere here I figured that a program should be able to give me answers, so I don't have to ask my friend all the time :) This formula is closely related to the Riemann hypothesis. The generated code is a(n)=a(n-1)/(1-1/p(n)), a(0)=2.

Recursive Waves

Finally a sequence I ran into by chance when I was adding charts to the site. I've no idea what it means or if it has any value. But it looks pretty funky. (n-a(n-1))/(a(n-2)+a(n-2)), a(0)=1, a(1)=2

Algorithm

The algorithm generates stack machines that are executed with different input (0≤n<N). The output of each execution form a sequence that is stored. Duplicated sequences are detected, so that different stack machines can generate the same sequence. The simplest stack machine per function class is chosen. I'm not a mathematician so I have kind of made up a definition for each function type (constant, n, prime, recursive and prime-recursive). What more types could I add?

Future

I don't know where to take this project, here are some ideas.

Disclaimer

Most of the code was written on my spare time over with a baby in one arm and my laptop in the other. There are at least a few bugs in there. Also I'm aware that some sequence properties may be false. They are derived from a limited sequence. E.g. it will mark a sequence as monotonic if it appears to be in the first terms. You should think of it as 'so far monotonic'.

Updates

Operators & functions

Sequences are generated from combinations the following operators and functions

Constant

1
2
3
4
5
6
7
8
9
10
Pi (3.141...)

Variable

n

Arithmetic

+
*
-
/
-
%

Power

^
ln
exp
sqrt

Prime

p(n)=nth prime
τ(n)=number of divisors of n
ϕ(n)=Euler's totient function
μ(n)=Möbius function
Ω(n)=max factorization terms
λ(n)=Liouville's function
Λ(n)=Von Mangoldt's function
gcd(a,b)=greatest common divisor

Recursive

a(n-1)
a(n-2)
a(n-3)

Trigonometric

sin
cos
tan

Combinatorics

!
C(n,k)=binomial coefficient

Special

floor
abs
ceil
round