https://github.com/ramarav/silverman
Silverman's Sequence or Golomb Sequence
https://github.com/ramarav/silverman
python python-script python2 python27
Last synced: 19 days ago
JSON representation
Silverman's Sequence or Golomb Sequence
- Host: GitHub
- URL: https://github.com/ramarav/silverman
- Owner: ramarav
- License: gpl-3.0
- Created: 2020-05-05T22:53:26.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-05T23:04:52.000Z (almost 6 years ago)
- Last Synced: 2025-10-13T16:49:12.708Z (5 months ago)
- Topics: python, python-script, python2, python27
- Language: Python
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Silverman's Sequence or Golomb Sequence
"In mathematics, the Golomb sequence, named after Solomon W. Golomb (but also called Silverman's sequence), is a non-decreasing integer sequence where an is the number of times that n occurs in the sequence, starting with a1 = 1, and with the property that for n > 1 each an is the unique integer which makes it possible to satisfy the condition. For example, a1 = 1 says that 1 only occurs once in the sequence, so a2 cannot be 1 too, but it can be, and therefore must be, 2. The first few values are
1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12 (sequence A001462 in OEIS).
a1 = 1
Therefore 1 occurs exactly one time in this sequence.
a2 > 1
a2 = 2
2 occurs exactly 2 times in this sequence.
a3 = 2
3 occurs exactly 2 times in this sequence.
a4 = a5 = 3
4 occurs exactly 3 times in this sequence.
5 occurs exactly 3 times in this sequence.
a6 = a7 = a8 = 4
a9 = a10 = a11 = 5
etc."
Let us see a python code to implement the same.