|
|
A335292
|
|
To calculate a(n), iterate the function f(x) = x * ceiling(a(n-1) / 2) + 1 on the value x = 1 until the result has not appeared in the sequence previously. Take a(1) = 1.
|
|
1
|
|
|
1, 2, 3, 7, 5, 4, 15, 9, 6, 13, 8, 21, 12, 43, 23, 157, 80, 41, 22, 133, 68, 35, 19, 11, 259, 131, 67, 1191, 597, 300, 151, 77, 40, 421, 212, 107, 55, 29, 16, 73, 38, 20, 111, 57, 30, 241, 122, 62, 32, 17, 10, 31, 273, 138, 70, 36, 343, 173, 88, 45, 24, 1885
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
By definition, this sequence never repeats its values.
|
|
LINKS
|
|
|
EXAMPLE
|
a(6) = 4. Therefore, ceiling(a(6) / 2) is equal to 2, and a(7) should be 1 * 2 + 1 = 3. However, since 3 can already be found in the sequence (coincidentally, at position n = 3), one must iterate the function again to get a(7) = 3 * 2 + 1 = 7. But 7 is also already in the sequence (at position n = 4), so the function must be iterated once more to find that a(7) is indeed equal to 7 * 2 + 1 = 15.
|
|
PROG
|
(Python 3)
from math import ceil
sequence = [1]
terms = 1000
for n in range(2, terms + 1):
nextnum = 1
while nextnum in sequence:
nextnum = nextnum * ceil(sequence[-1] / 2) + 1
sequence.append(nextnum)
print(sequence)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|