cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A051145 a(0)=0, a(1)=1, a(n) = smallest number such that sequence b(n) = a(n) OR a(n+1) is strictly monotonically increasing.

This page as a plain text file.
%I A051145 #28 Aug 12 2024 01:27:34
%S A051145 0,1,2,4,3,8,4,9,6,16,7,24,32,25,34,28,35,64,36,65,38,72,39,80,40,81,
%T A051145 42,84,43,128,44,129,46,144,47,192,48,193,50,196,51,200,52,201,54,256,
%U A051145 55,264,64,265,66,268,67,272,68,273,70,280,71,288,72,289,74,292,75,304
%N A051145 a(0)=0, a(1)=1, a(n) = smallest number such that sequence b(n) = a(n) OR a(n+1) is strictly monotonically increasing.
%C A051145 a(A051147(n)) = 2^n; A209229(a(A244747(n))) = 1. - _Reinhard Zumkeller_, Jul 06 2014
%H A051145 Reinhard Zumkeller, <a href="/A051145/b051145.txt">Table of n, a(n) for n = 0..10000</a>
%F A051145 a(n) = ((a(n-1) OR a(n-2)) + 1) AND NOT a(n-1). - _Charlie Neder_, Oct 12 2018
%e A051145 To find a(6): we have a(4)=3=11, a(5)=8=1000, 3 OR 8 = 1011 = 11, smallest number which when OR-ed with 8 gives a number bigger than 11 is 4, since then 4=100 OR 8=1000 = 1100=12; so a(6)=4, b(6)=12 (cf. A051146).
%t A051145 a[0] = 0; a[1] = 1; a[n_] := a[n] = (b = 0; While[b++; BitOr[b, a[n-1]] <= BitOr[a[n-2], a[n-1]]]; b); Table[a[n], {n, 0, 65}] (* _Jean-François Alcover_, Oct 07 2011 *)
%o A051145 (Haskell)
%o A051145 import Data.Bits ((.|.))
%o A051145 a051145 n = a051145_list !! n
%o A051145 a051145_list = 0 : 1 : f 1 1 where
%o A051145    f x b = y : f y z where
%o A051145      (y, z) = head [(y, z) | y <- [1..],
%o A051145                              let z = x .|. y :: Integer, z > b]
%o A051145 -- _Reinhard Zumkeller_, Oct 25 2012
%Y A051145 Cf. A051146, A051147, A057923-A057931, A209229, A244747.
%K A051145 nonn,easy,nice
%O A051145 0,3
%A A051145 _N. J. A. Sloane_, E. M. Rains
%E A051145 More terms from Larry Reeves (larryr(AT)acm.org), Oct 03 2000