OFFSET
1,2
COMMENTS
A036989(a(n)) = 1. - Reinhard Zumkeller, Jul 31 2013
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
H. Niederreiter and M. Vielhaber, Tree complexity and a doubly exponential gap between structured and random sequences, J. Complexity, 12 (1996), 187-198.
FORMULA
a(n) = 2*A095775(n). - Robert G. Wilson v
MATHEMATICA
fQ[n_] := Block[{od = ev = k = 0, id = Reverse@IntegerDigits[n, 2], lmt = Floor@Log[2, n] + 1}, While[k < lmt && od < ev + 1, If[OddQ@id[[k + 1]], od++, ev++ ]; k++ ]; If[k == lmt && od < ev + 1, True, False]]; Select[ Range[0, 204, 2], fQ@# &] (* Robert G. Wilson v, Jan 11 2007 *)
(* b = A036989 *) b[0] = 1; b[n_?EvenQ] := b[n] = Max[b[n/2]-1, 1]; b[n_] := b[n] = b[(n-1)/2]+1; Select[Range[0, 300, 2], b[#] == 1 &] (* Jean-François Alcover, Nov 05 2013, after Reinhard Zumkeller *)
PROG
(Haskell)
a036990 n = a036990_list !! (n-1)
a036990_list = filter ((== 1) . a036989) [0..]
-- Reinhard Zumkeller, Jul 31 2013
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
EXTENSIONS
More terms from Erich Friedman.
STATUS
approved