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-1 of 1 results.

A358258 First n-bit number to appear in Van Eck's sequence (A181391).

Original entry on oeis.org

0, 2, 6, 9, 17, 42, 92, 131, 307, 650, 1024, 2238, 4164, 8226, 17384, 33197, 67167, 133549, 269119, 525974, 1055175, 2111641, 4213053, 8444257, 16783217, 33601813, 67405064, 134239260, 268711604, 538400994, 1076155844, 2152693259, 4299075300, 8594396933, 17203509931
Offset: 1

Views

Author

Michael De Vlieger, Nov 05 2022

Keywords

Comments

Binary version of A358168.

Examples

			First terms written in binary, substituting "." for 0 to enhance the pattern of 1's.
   n      a(n)                   a(n)_2
  -------------------------------------
   1        0                         .
   2        2                        1.
   3        6                       11.
   4        9                      1..1
   5       17                     1...1
   6       42                    1.1.1.
   7       92                   1.111..
   8      131                  1.....11
   9      307                 1..11..11
  10      650                1.1...1.1.
  11     1024               1..........
  12     2238              1...1.11111.
  13     4164             1.....1...1..
  14     8226            1.......1...1.
  15    17384           1....11111.1...
  16    33197          1......11.1.11.1
  17    67167         1.....11..1.11111
  18   133549        1.....1..11.1.11.1
  19   269119       1.....11.11..111111
  20   525974      1........11.1..1.11.
  21  1055175     1.......11..111...111
  22  2111641    1.......111...1..11..1
  23  4213053   1.......1..1..1..1111.1
  24  8444257  1.......11.11..1.11....1
		

Crossrefs

Programs

  • Mathematica
    nn = 2^20; q[] = False; q[0] = True; a[] = 0; c[_] = -1; c[0] = 2; m = 1; {0}~Join~Rest@ Reap[Do[j = c[m]; k = m; c[m] = n; m = 0; If[j > 0, m = n - j]; If[! q[#], Sow[k]; q[#] = True] & @ IntegerLength[k, 2], {n, 3, nn}] ][[-1, -1]]
  • Python
    from itertools import count
    def A358258(n):
        b, bdict, k = 0, {0:(1,)},1< 1 else 0
        for m in count(2):
            if b >= k:
                return b
            if len(l := bdict[b]) > 1:
                b = m-1-l[-2]
                if b in bdict:
                    bdict[b] = (bdict[b][-1],m)
                else:
                    bdict[b] = (m,)
            else:
                b = 0
                bdict[0] = (bdict[0][-1],m) # Chai Wah Wu, Nov 06 2022

Extensions

a(30)-a(34) from Chai Wah Wu, Nov 06 2022
a(35) from Martin Ehrenstein, Nov 07 2022
Showing 1-1 of 1 results.