login
Sequence b(n) mentioned in A051145.
2

%I #12 Jul 13 2013 12:02:16

%S 1,3,6,7,11,12,13,15,22,23,31,56,57,59,62,63,99,100,101,103,110,111,

%T 119,120,121,123,126,127,171,172,173,175,190,191,239,240,241,243,246,

%U 247,251,252,253,255,310,311,319,328,329,331,334,335,339,340,341,343

%N Sequence b(n) mentioned in A051145.

%H Reinhard Zumkeller, <a href="/A051146/b051146.txt">Table of n, a(n) for n = 1..10000</a>

%t (* a5 = A051145 *) a5[0] = 0; a5[1] = 1; a5[n_] := a5[n] = (b = 0; While[b++; BitOr[b, a5[n-1]] <= BitOr[a5[n-2], a5[n-1]]]; b); a[n_] := BitOr[a5[n], a5[n+1]]; Table[a[n], {n, 0, 55}] (* _Jean-François Alcover_, Jan 09 2013 *)

%o (Haskell)

%o import Data.Bits ((.|.))

%o a051146 n = a051146_list !! (n-1)

%o a051146_list = zipWith (.|.) a051145_list $ tail a051145_list

%o -- _Reinhard Zumkeller_, Oct 25 2012

%K nonn,easy,nice

%O 1,2

%A _N. J. A. Sloane_, E. M. Rains

%E More terms from Larry Reeves (larryr(AT)acm.org), Oct 03 2000