OFFSET
0,1
COMMENTS
Start with a(0) = 7, and then set a(n+1) = a(n)/2 if a(n) is even, otherwise a(n+1) = (a(n)-1)/2 + 2^e for the smallest e such that a(n+1) has no earlier occurrence in the sequence and is a term of A014311. - Antti Karttunen, Apr 17 2026
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..12087
A. Karttunen, Scheme-program for computing this sequence
Eric Weisstein's World of Mathematics, Siteswap
FORMULA
a(0)=7, a(n) = (a(n-1) + 2^A084452(n) - 1)/2.
EXAMPLE
a(0) = 7 by definition.
a(1) = (a(0)-1)/2 + 2^e = 3 + 2^e, but e=0 or 1 cannot be used as 4 and 5 have less than three 1-bits, while e=2 cannot be used because 3+4 = 7 is already present in the sequence, so the next smallest e is 3, thus a(1) = 3 + 2^3 = 11.
a(2) = (a(1)-1)/2 + 2^e = 5 + 2^e, but e=0 cannot be used as 6 has less than three 1-bits, while e=1 cannot be used because 5+2 = 7 is already present in the sequence, so the next smallest e is 3, thus a(2) = 5 + 2^3 = 13.
a(3) = (a(2)-1)/2 + 2^e = 6 + 2^e, but e=0 cannot be used as 6+1 = 7 has already occurred in the sequence, and with e=1..2 the sum has less than three 1-bits, so the next smallest e is 3, thus a(3) = 6 + 2^3 = 14.
a(4) = a(3)/2 = 7. Note that now the previously occurring 7 is allowed, because it is a result of dividing the previous term (that is even) by two.
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jun 02 2003
EXTENSIONS
Example section added by Antti Karttunen, Apr 17 2026
STATUS
approved
