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.

Showing 1-2 of 2 results.

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.

Original entry on oeis.org

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, 42, 84, 43, 128, 44, 129, 46, 144, 47, 192, 48, 193, 50, 196, 51, 200, 52, 201, 54, 256, 55, 264, 64, 265, 66, 268, 67, 272, 68, 273, 70, 280, 71, 288, 72, 289, 74, 292, 75, 304
Offset: 0

Views

Author

N. J. A. Sloane, E. M. Rains

Keywords

Comments

a(A051147(n)) = 2^n; A209229(a(A244747(n))) = 1. - Reinhard Zumkeller, Jul 06 2014

Examples

			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).
		

Crossrefs

Programs

  • Haskell
    import Data.Bits ((.|.))
    a051145 n = a051145_list !! n
    a051145_list = 0 : 1 : f 1 1 where
       f x b = y : f y z where
         (y, z) = head [(y, z) | y <- [1..],
                                 let z = x .|. y :: Integer, z > b]
    -- Reinhard Zumkeller, Oct 25 2012
  • Mathematica
    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 *)

Formula

a(n) = ((a(n-1) OR a(n-2)) + 1) AND NOT a(n-1). - Charlie Neder, Oct 12 2018

Extensions

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

A051147 Smallest m such that A051145(m) = 2^n.

Original entry on oeis.org

1, 2, 3, 5, 9, 12, 17, 29, 45, 81, 105, 177, 245, 323, 569, 893, 1277, 2121, 3221, 4853, 7697, 11015, 15333, 25841, 40157, 59213, 84239, 135107, 184679, 265277, 445029, 606509, 830411, 1394489, 1973405, 2683997, 4176989, 6710687, 9906153, 15114275, 22269021
Offset: 0

Views

Author

N. J. A. Sloane, E. M. Rains

Keywords

Crossrefs

Cf. A000079, A051145, subsequence of A244747.

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a051147 = fromJust . (`elemIndex` a051145_list) . (2 ^)
    -- Reinhard Zumkeller, Jul 05 2014
  • Mathematica
    Block[{a, b, s}, 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); s = Array[a, 2^10, 0]; Array[FirstPosition[s, 2^#][[1]] - 1 &, Floor@ Log2@ Max@ s + 1, 0]] (* Michael De Vlieger, Aug 25 2021, after Jean-François Alcover at A051145 *)

Formula

A051145(a(n)) = 2^n. - Reinhard Zumkeller, Jul 05 2014

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Oct 03 2000
a(21)-a(23) from Reinhard Zumkeller, Jul 05 2014
Definition corrected by Reinhard Zumkeller, Jul 05 2014
a(24)-a(30) from Charlie Neder, Oct 12 2018
More terms from Sean A. Irvine, Aug 25 2021
Showing 1-2 of 2 results.