OFFSET
1,3
COMMENTS
Distinct elements of A270362. - Jeffrey Shallit, Mar 16 2016.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..646
Ali Keramatipour and Jeffrey Shallit, Record-Setters in the Stern Sequence, arXiv:2205.06223 [math.CO], 2022.
FORMULA
a(n) = fusc(A212288(n)).
MATHEMATICA
Union@ FoldList[Max, Nest[Append[#1, If[OddQ[#2], #1[[(#2 + 1)/2]], #1[[#2/2]] + #1[[(#2 + 2)/2]] ]] & @@ {#, Length@ # + 1} &, {0, 1}, 10^4]] (* Michael De Vlieger, Jul 10 2019 *)
PROG
(PARI) fusc(n)=my(a=1, b=0); while(n, if(n%2, b+=a, a+=b); n>>=1); b
r=-1; for(n=0, 1e5, t=fusc(n); if(t>r, r=t; print1(t", ")))
(Python)
from itertools import count, islice
from functools import reduce
def A212289_gen(): # generator of terms
yield (c:= 0)
for n in count(1):
m = sum(reduce(lambda x, y:(x[0], x[0]+x[1]) if int(y) else (x[0]+x[1], x[1]), bin(n)[-1:2:-1], (1, 0)))
if m>c: yield (c:=m)
CROSSREFS
KEYWORD
nonn
AUTHOR
Charles R Greathouse IV, Jun 13 2012
EXTENSIONS
a(1)=0 prepended in terms, b-file and programs by Georg Fischer, Jun 24 2020
STATUS
approved