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.

Previous Showing 31-40 of 123 results. Next

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

A358259 Positions of the first n-bit number to appear in Van Eck's sequence (A181391).

Original entry on oeis.org

1, 5, 10, 24, 41, 52, 152, 162, 364, 726, 1150, 2451, 4626, 9847, 18131, 36016, 71709, 143848, 276769, 551730, 1086371, 2158296, 4297353, 8607525, 17159741, 34152001, 68194361, 136211839, 271350906, 541199486, 1084811069, 2165421369, 4331203801, 8643518017, 17303787585
Offset: 1

Views

Author

Michael De Vlieger, Nov 05 2022

Keywords

Comments

Binary version of the concept behind A358180.

Examples

			First terms written in binary, substituting "." for 0 to enhance the pattern of 1's.
   n      a(n)                   a(n)_2
  -------------------------------------
   1        1                         1
   2        5                       1.1
   3       10                      1.1.
   4       24                     11...
   5       41                    1.1..1
   6       52                    11.1..
   7      152                  1..11...
   8      162                  1.1...1.
   9      364                 1.11.11..
  10      726                1.11.1.11.
  11     1150               1...111111.
  12     2451              1..11..1..11
  13     4626             1..1....1..1.
  14     9847            1..11..111.111
  15    18131           1...11.11.1..11
  16    36016          1...11..1.11....
  17    71709         1...11......111.1
  18   143848        1...11...1111.1...
  19   276769       1....111..1..1....1
  20   551730      1....11.1.11..11..1.
  21  1086371     1....1..1..111.1...11
  22  2158296    1.....111.111.11.11...
  23  4297353   1.....11..1..1.1...1..1
  24  8607525  1.....11.1.1.111..1..1.1
  etc.
		

Crossrefs

Programs

  • Mathematica
    nn = 2^20; q[] = False; q[0] = True; a[] = 0; c[_] = -1; c[0] = 2; m = 1; {1}~Join~Rest@ Reap[Do[j = c[m]; k = m; c[m] = n; m = 0; If[j > 0, m = n - j]; If[! q[#], Sow[n]; q[#] = True] & @ IntegerLength[k, 2], {n, 3, nn}] ][[-1, -1]]
  • Python
    from itertools import count
    def A358259(n):
        b, bdict, k = 0, {0:(1,)},1< 1 else 0
        for m in count(2):
            if b >= k:
                return m-1
            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

A171912 Van Eck sequence (cf. A181391) starting with 2.

Original entry on oeis.org

2, 0, 0, 1, 0, 2, 5, 0, 3, 0, 2, 5, 5, 1, 10, 0, 6, 0, 2, 8, 0, 3, 13, 0, 3, 3, 1, 13, 5, 16, 0, 7, 0, 2, 15, 0, 3, 11, 0, 3, 3, 1, 15, 8, 24, 0, 7, 15, 5, 20, 0, 5, 3, 12, 0, 4, 0, 2, 24, 14, 0, 4, 6, 46, 0, 4, 4, 1, 26, 0, 5, 19, 0, 3, 21, 0, 3, 3, 1, 11, 42, 0, 6, 20, 34, 0, 4, 20, 4
Offset: 1

Views

Author

N. J. A. Sloane, Oct 22 2010

Keywords

Comments

A van Eck sequence is defined recursively by a(n+1) = min { k > 0 | a(n-k) = a(n) } or 0 if this set is empty. - M. F. Hasler, Jun 12 2019

Crossrefs

Cf. A181391, A171911, ..., A171918 (same but starting with 0, 1, ..., 8).

Programs

  • Mathematica
    t = {2};
    Do[
    d = Quiet[Check[Position[t, Last[t]][[-2]][[1]], 0]];
    If[d == 0, x = 0, x = Length[t] - d];
    AppendTo[t, x], 100]
    t  (* Horst H. Manninger, Aug 30 2020 *)
  • PARI
    A171912_vec(N, a=2, i=Map())={vector(N, n, a=if(n>1, iferr(n-mapget(i, a), E, 0)+mapput(i, a, n), a))} \\ M. F. Hasler, Jun 11 2019
    
  • Python
    from itertools import count, islice
    def A171912gen(): # generator of terms
        b, bdict = 2, {2:(1,)}
        for n in count(2):
            yield b
            if len(l := bdict[b]) > 1:
                b = n-1-l[-2]
            else:
                b = 0
            if b in bdict:
                bdict[b] = (bdict[b][-1],n)
            else:
                bdict[b] = (n,)
    A171912_list = list(islice(A171912gen(),20)) # Chai Wah Wu, Dec 21 2021

Extensions

Name edited and cross-references added by M. F. Hasler, Jun 12 2019

A171913 Van Eck sequence (cf. A181391) starting with a(1) = 3.

Original entry on oeis.org

3, 0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 0, 5, 3, 20, 0, 4, 6, 9, 0, 4, 4, 1, 20, 9, 6, 8, 0, 8, 2, 22, 0, 4, 11, 0, 3, 22, 6, 12, 0, 5, 28, 0, 3, 8, 16, 0, 4, 15, 0, 3, 7, 0, 3, 3, 1, 33, 0, 5, 18, 0, 3, 7, 11, 30, 0, 5, 8, 23, 0, 4, 23, 3, 11, 10, 0, 6, 39, 0, 3, 7, 18, 22
Offset: 1

Views

Author

N. J. A. Sloane, Oct 22 2010

Keywords

Comments

A van Eck sequence is defined recursively by a(n+1) = min { k > 0 | a(n-k) = a(n) } or 0 if this set is empty, i.e., a(n) does not appear earlier in the sequence. - M. F. Hasler, Jun 12 2019

Crossrefs

Cf. A181391, A171911, ..., A171918 (same but starting with 0, 1, ..., 8).

Programs

  • Mathematica
    t = {3};
    Do[
    d = Quiet[Check[Position[t, Last[t]][[-2]][[1]], 0]];
    If[d == 0, x = 0, x = Length[t] - d];
    AppendTo[t, x], 100]
    t  (* Horst H. Manninger, Sep 08 2020 *)
  • PARI
    A171913_vec(N, a=3, i=Map())={vector(N, n, a=if(n>1, iferr(n-mapget(i, a), E, 0)+mapput(i, a, n), a))} \\ M. F. Hasler, Jun 15 2019
    
  • Python
    from itertools import count, islice
    def A171913gen(): # generator of terms
        b, bdict = 3, {3:(1,)}
        for n in count(2):
            yield b
            if len(l := bdict[b]) > 1:
                b = n-1-l[-2]
            else:
                b = 0
            if b in bdict:
                bdict[b] = (bdict[b][-1],n)
            else:
                bdict[b] = (n,)
    A171913_list = list(islice(A171913gen(),20)) # Chai Wah Wu, Dec 21 2021

Formula

a(n+1) = A181391(n) up to the first occurrence of a(1) = 3 in A181391. - M. F. Hasler, Jun 15 2019

Extensions

Name edited and cross-references added by M. F. Hasler, Jun 15 2019

A171914 Van Eck sequence (cf. A181391) starting with a(1) = 4.

Original entry on oeis.org

4, 0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 17, 0, 6, 5, 5, 1, 14, 0, 6, 6, 1, 5, 7, 0, 6, 5, 4, 17, 17, 1, 9, 0, 8, 0, 2, 28, 0, 3, 0, 2, 5, 15, 0, 4, 17, 16, 0, 4, 4, 1, 20, 0, 5, 12, 0, 3, 18, 0, 3, 3, 1, 11, 0, 5, 11, 3, 6, 42, 0, 6, 3, 5, 8, 40, 0, 6, 6, 1, 17, 34, 0, 6
Offset: 1

Views

Author

N. J. A. Sloane, Oct 22 2010

Keywords

Comments

A van Eck sequence is defined recursively by a(n+1) = min { k > 0 | a(n-k) = a(n) } or 0 if this set is empty, i.e., a(n) does not appear earlier in the sequence. - M. F. Hasler, Jun 15 2019

Crossrefs

Cf. A181391, A171911, ..., A171918 (same but starting with 0, 1, ..., 8).

Programs

  • PARI
    A171914_vec(N, a=4, i=Map())={vector(N, n, a=if(n>1, iferr(n-mapget(i, a), E, 0)+mapput(i, a, n), a))} \\ M. F. Hasler, Jun 15 2019
    
  • Python
    from itertools import count, islice
    def A171914gen(): # generator of terms
        b, bdict = 4, {4:(1,)}
        for n in count(2):
            yield b
            if len(l := bdict[b]) > 1:
                b = n-1-l[-2]
            else:
                b = 0
            if b in bdict:
                bdict[b] = (bdict[b][-1],n)
            else:
                bdict[b] = (n,)
    A171914_list = list(islice(A171914gen(),20)) # Chai Wah Wu, Dec 21 2021

Formula

a(n+1) = A181391(n) up to the first occurrence of a(1) = 4 in A181391. - M. F. Hasler, Jun 15 2019

Extensions

Name edited and cross-references added by M. F. Hasler, Jun 15 2019

A171916 Van Eck's sequence (cf. A181391) starting with a(1) = 6.

Original entry on oeis.org

6, 0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 10, 0, 6, 3, 0, 3, 2, 9, 0, 4, 0, 2, 5, 0, 3, 9, 8, 0, 4, 9, 4, 2, 10, 22, 0, 7, 0, 2, 6, 26, 0, 4, 11, 0, 3, 20, 0, 3, 3, 1, 41, 0, 5, 30, 0, 3, 7, 21, 0, 4, 18, 0, 3, 7, 7, 1, 16, 0, 6, 30, 16, 4, 12, 0, 6, 6, 1, 11, 35, 0, 6, 5, 29, 0, 4, 13, 0, 3, 25, 0
Offset: 1

Views

Author

N. J. A. Sloane, Oct 22 2010

Keywords

Comments

Van Eck's sequence is defined by a(n+1) = min { k > 0 | a(n-k) = a(n) } or 0 if this set is empty, i.e., a(n) does not appear earlier in the sequence. - M. F. Hasler, Jun 15 2019

Crossrefs

Cf. A181391, A171911, ..., A171918 (same but starting with 0, 1, ..., 8).

Programs

  • PARI
    A171916_vec(N, a=6, i=Map())={vector(N, n, a=if(n>1, iferr(n-mapget(i, a), E, 0)+mapput(i, a, n), a))} \\ M. F. Hasler, Jun 15 2019
    
  • Python
    from itertools import count, islice
    def A171916gen(): # generator of terms
        b, bdict = 6, {6:(1,)}
        for n in count(2):
            yield b
            if len(l := bdict[b]) > 1:
                b = n-1-l[-2]
            else:
                b = 0
            if b in bdict:
                bdict[b] = (bdict[b][-1],n)
            else:
                bdict[b] = (n,)
    A171916_list = list(islice(A171916gen(),20)) # Chai Wah Wu, Dec 21 2021

Extensions

Name edited and cross-references added by M. F. Hasler, Jun 15 2019

A171952 Positions of 2's in A181391.

Original entry on oeis.org

5, 7, 8, 14, 23, 40, 71, 79, 302, 460, 466, 468, 469, 714, 720, 722, 723, 934, 1018, 1157, 1456, 1641, 1660, 1675, 1708, 1727, 1844, 2157, 2356, 2470, 2583, 2589, 2591, 2592, 2744, 2829, 3116, 3381, 3388, 3390, 3391, 3568, 3623, 3655, 3696
Offset: 1

Views

Author

N. J. A. Sloane, Oct 29 2010

Keywords

Crossrefs

A171953 Positions of 3's in A181391.

Original entry on oeis.org

20, 22, 28, 33, 38, 46, 49, 50, 61, 68, 70, 76, 78, 86, 94, 103, 201, 204, 205, 217, 230, 256, 259, 260, 281, 327, 369, 391, 394, 395, 403, 422, 492, 550, 575, 583, 672, 675, 676, 740, 804, 815, 843, 1103, 1165, 1488, 1491, 1492, 1543, 1668
Offset: 1

Views

Author

N. J. A. Sloane, Oct 29 2010

Keywords

Crossrefs

A171954 Positions of 4's in A181391.

Original entry on oeis.org

17, 26, 58, 65, 107, 120, 127, 131, 132, 140, 144, 145, 154, 158, 159, 166, 185, 189, 190, 214, 220, 234, 238, 239, 248, 267, 290, 299, 301, 323, 326, 336, 340, 341, 350, 359, 373, 382, 434, 438, 439, 446, 452, 458, 464, 477, 481, 482, 496
Offset: 1

Views

Author

N. J. A. Sloane, Oct 29 2010

Keywords

Crossrefs

A171955 Positions of 5's in A181391.

Original entry on oeis.org

12, 16, 19, 34, 37, 39, 54, 91, 112, 123, 136, 175, 253, 286, 295, 318, 322, 355, 378, 386, 408, 413, 414, 526, 543, 555, 572, 620, 669, 737, 759, 768, 818, 865, 874, 895, 900, 901, 926, 942, 947, 948, 956, 1043, 1086, 1148, 1170, 1175, 1176
Offset: 1

Views

Author

N. J. A. Sloane, Oct 29 2010

Keywords

Crossrefs

Previous Showing 31-40 of 123 results. Next