Home
somos-py
is a Somos sequence generator for Python.
If you don't know about Somos sequences, they are a series of mathematical sequences generated by a recurrence equation. Like the well-known Fibonacci sequence, the next term is defined by some previous terms. You can read ↓ below for more information.
Check out the latest version!
This project is released under the MIT license. This means you can use, modify, and distribute projects that use this code for free, as long as the original copyright notice and license are included.
You can read more about the MIT license, and what it means if you use this code, here.
You can find documentation on my site pigeon.uk.to/somos-py
or over at somos.readthedocs.io
!
Somos sequences
For more information, see Wikipedia → Somos sequence.
Somos sequences are a series of mathematical sequences generated by a recurrence equation, like the Fibonacci numbers.
They were first described by Michael Somos in September 1989 as Problem 1470 in Crux Mathematicorum Volume 15, Issue 7 and then later in his paper "Step into the Elliptic Realm" in January 2000.
Definition
For an integer \(k\) larger than 1, the Somos-\(k\) sequence is defined by the equation:
when \(k\) is odd; or
when \(k\) is even, with the initial values \(a_{i}=1\) for \(i < k\).
Sequence values
For \(k = 2\) or \(3\), the generated sequence is all \(1\)s.
For \(k > 3\), the first \(k\) terms are all \(1\).
For \(k < 7\), all terms are integers. For \(k > 8\), terms will eventually become fractions. The terms at which Somos-\(k\) becomes non-integral are (starting at Somos-\(8\)): 17, 19, 20, 22, 24, 27, 28, 30, 33, 34, 36, 39, ... (sequence A030127 in the OEIS).
Below are the first 20 terms of Somos sequences 4 to 10.
- Somos-4 (A006720)
- 1, 1, 1, 1, 2, 3, 7, 23, 59, 314, 1529, 8209, 83313, 620297, 7869898, 126742987, 1687054711, 47301104551, 1123424582771, 32606721084786, ...
- Somos-5 (A006721)
- 1, 1, 1, 1, 1, 2, 3, 5, 11, 37, 83, 274, 1217, 6161, 22833, 165713, 1249441, 9434290, 68570323, 1013908933, ...
- Somos-6 (A006722)
- 1, 1, 1, 1, 1, 1, 3, 5, 9, 23, 75, 421, 1103, 5047, 41783, 281527, 2534423, 14161887, 232663909, 3988834875, ...
- Somos-7 (A006723)
- 1, 1, 1, 1, 1, 1, 1, 3, 5, 9, 17, 41, 137, 769, 1925, 7203, 34081, 227321, 1737001, 14736001, ...
- Somos-8
- 1, 1, 1, 1, 1, 1, 1, 1, 4, 7, 13, 25, 61, 187, 775, 5827, 14815, 420514/7, 28670773/91, 6905822101/2275, ...
- Somos-9
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 7, 13, 25, 49, 115, 355, 1483, 11137, 27937, 755098/7, ...
- Somos-10
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 9, 17, 33, 65, 149, 413, 1473, 7073, 64785, ...
In popular culture
Somos sequences were discussed by Dr Harini Desiraju, a fellow at the University of Sydney, in a Numberphile video from May 2022.
The Troublemaker Number - Numberphile on YouTube
Uses
None, really. This is just a small implementation of a bit of number theory. It's purely recreational. :)
If you do happen to find a use for this, please let me know!
External links
- Crux Mathematicorum Volume 15, Issue 7 at cms.math.ca
- Somos sequences at Wikipedia
- Somos sequences at MathWorld
- The Somos Sequence Site at uml.edu, by James Propp
- The Troublemaker Number - Numberphile on YouTube
Created: November 27, 2023