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

A300653 Square array T(n, k) (n >= 1, k >= 1) read by antidiagonals upwards: T(n, k) is the k-th positive number whose binary representation appears as a substring in the binary representation of 1/n (ignoring the radix point and adding trailing zeros if necessary in case of a terminating expansion).

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 1, 2, 4, 8, 1, 2, 5, 8, 16, 1, 2, 4, 10, 16, 32, 1, 2, 3, 8, 21, 32, 64, 1, 2, 5, 4, 16, 42, 64, 128, 1, 2, 4, 10, 6, 32, 85, 128, 256, 1, 2, 4, 9, 21, 9, 64, 170, 256, 512, 1, 2, 3, 8, 18, 42, 12, 128, 341, 512, 1024, 1, 2, 3, 4, 16, 36, 85
Offset: 1

Views

Author

Rémy Sigrist, Mar 10 2018

Keywords

Examples

			Square array begins:
  n\k|    1    2    3    4    5    6    7    8    9   10
  ---+--------------------------------------------------
    1|    1    2    4    8   16   32   64  128  256  512  -->  A000079
    2|    1    2    4    8   16   32   64  128  256  512
    3|    1    2    5   10   21   42   85  170  341  682  -->  A000975
    4|    1    2    4    8   16   32   64  128  256  512
    5|    1    2    3    4    6    9   12   19   25   38
    6|    1    2    5   10   21   42   85  170  341  682
    7|    1    2    4    9   18   36   73  146  292  585  -->  A033138
    8|    1    2    4    8   16   32   64  128  256  512
    9|    1    2    3    4    6    7    8   12   14   17
   10|    1    2    3    4    6    9   12   19   25   38
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, 1) = 1.
T(n, 2) = 2.
T(n, 3) > 3 iff n belongs to A300630.
T(2*n, k) = T(n, k).
T(1, k) = A000079(k-1).
T(3, k) = A000975(k).
T(7, k) = A033138(k).
T(n, k) = k iff 1 <= k <= A300654(n).
T(n, k) = n for some k iff n belongs to A000079 or to A153055.

A300654 a(n) is the greatest k such that, for i = 1..k, the binary representation of i appears as a substring in the binary representation of 1/n (ignoring the radix point and adding trailing zeros if necessary in case of a terminating expansion).

Original entry on oeis.org

2, 2, 2, 2, 4, 2, 2, 2, 4, 4, 8, 2, 9, 2, 2, 2, 4, 4, 16, 4, 4, 8, 6, 2, 8, 9, 11, 2, 20, 2, 2, 2, 4, 4, 8, 4, 32, 16, 6, 4, 4, 4, 8, 8, 6, 6, 12, 2, 12, 8, 2, 9, 33, 11, 10, 2, 8, 20, 37, 2, 41, 2, 2, 2, 4, 4, 64, 4, 14, 8, 14, 4, 4, 32, 11, 16, 17, 6, 22, 4
Offset: 1

Views

Author

Rémy Sigrist, Mar 10 2018

Keywords

Comments

Equivalently, a(n) is the greatest k such that A300653(n, k) = k.
This sequence has similarities with A144016: here we consider the binary expansion of 1/n, there the binary expansion of n.

Examples

			For n = 19:
- the binary expansion of 1/19 is 0.0000(110101111001010000) (with repeating digits in parentheses),
- the first occurrence of the binary representation of k for k = 1..16 is:
  k   bin(k)  bin(1/19) with bin(k) in parentheses
  --  ------  ------------------------------------
   1      1   0.0000(1)101...
   2     10   0.00001(10)101...
   3     11   0.0000(11)010...
   4    100   0.000011010111(100)101...
   5    101   0.00001(101)011...
   6    110   0.0000(110)101...
   7    111   0.000011010(111)100...
   8   1000   0.00001101011110010(1000)011...
   9   1001   0.000011010111(1001)010...
  10   1010   0.00001(1010)111...
  11   1011   0.0000110(1011)110...
  12   1100   0.00001101011(1100)101...
  13   1101   0.0000(1101)011...
  14   1110   0.0000110101(1110)010...
  15   1111   0.000011010(1111)001...
  16  10000   0.00001101011110010(10000)110...
- the binary representation of 17 (10001) is missing,
- hence a(19) = 16.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(2*n) = a(n).
a(n) = 2 iff n belongs to A300630.

A300655 a(n) is the length of the longest contiguous block of ones in the binary expansion of 1/n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 3, 2, 3, 1, 3, 1, 1, 1, 4, 3, 4, 2, 2, 3, 2, 1, 4, 3, 4, 1, 4, 1, 1, 1, 5, 4, 3, 3, 5, 4, 2, 2, 5, 2, 5, 3, 2, 2, 3, 1, 4, 4, 1, 3, 5, 4, 4, 1, 5, 4, 5, 1, 5, 1, 1, 1, 6, 5, 6, 4, 3, 3, 3, 3, 3, 5, 3, 4, 4, 2, 4, 2, 6, 5, 6, 2, 2, 5, 4
Offset: 1

Views

Author

Rémy Sigrist, Mar 10 2018

Keywords

Comments

This sequence has similarities with A038374: here we consider the binary expansion of 1/n, there the binary expansion of n.

Examples

			The first terms, alongside the binary representation of 1/n, are:
  n   a(n)  bin(1/n) with repeating digits in parentheses
  --  ----  ---------------------------------------------
   1     1  1.(0)
   2     1  0.1(0)
   3     1  0.(01)
   4     1  0.01(0)
   5     2  0.(0011)
   6     1  0.0(01)
   7     1  0.(001)
   8     1  0.001(0)
   9     3  0.(000111)
  10     2  0.0(0011)
  11     3  0.(0001011101)
  12     1  0.00(01)
  13     3  0.(000100111011)
  14     1  0.0(001)
  15     1  0.(0001)
  16     1  0.0001(0)
  17     4  0.(00001111)
  18     3  0.0(000111)
  19     4  0.(000011010111100101)
  20     2  0.00(0011)
		

Crossrefs

Programs

  • PARI
    a(n) = my (w=1, s=Set(), f=1/max(n,2)); while (!setsearch(s,f), while (floor(f*2^(w+1))==2^(w+1)-1, w++); s=setunion(s,Set(f)); f=frac(f*2)); return (w)

Formula

a(2*n) = a(n).
a(2^k + 1) = k for any k > 0.
a(n) = 1 iff n belongs to A300630.

A300669 Positive numbers k with two consecutive ones in the binary representation of 1/k.

Original entry on oeis.org

5, 9, 10, 11, 13, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 29, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 52, 53, 54, 55, 57, 58, 59, 61, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89
Offset: 1

Views

Author

Rémy Sigrist, Mar 11 2018

Keywords

Comments

Equivalently, these are the numbers k such that A300655(k) > 1.
Equivalently, these are the numbers k such that A300653(k, 3) = 3.
If n belongs to this sequence then 2*n belongs to this sequence.
This sequence has similarities with A004780; here 1/k has two consecutive ones in binary, there k has two consecutive ones in binary.
See A300630 for the complementary sequence.

Examples

			The first terms, alongside the binary representation of 1/a(n), are:
  n    a(n)    bin(1/a(n)) with repeating digits in parentheses
  --   ----    ------------------------------------------------
   1      5    0.(0011)
   2      9    0.(0001110)
   3     10    0.0(0011)
   4     11    0.(0001011101)
   5     13    0.0(00100111011)
   6     17    0.(00001111)
   7     18    0.0(000111)
   8     19    0.(000011010111100101)
   9     20    0.00(0011)
  10     21    0.(000011)
		

Crossrefs

Cf. A004780, A300653, A300655, A300630 (complement).

Programs

  • PARI
    is(n) = my (f=1/max(2, n), s=Set()); while (!setsearch(s, f), if (floor(f*4)==3, return (1), s=setunion(s, Set(f)); f=frac(f*2))); return (0)

A359887 Square array A(n, k), n, k > 0, read by antidiagonals; A(n, k) is the numerator of the unique rational q such that for any m, floor(2^m/n) AND floor(2^m/k) = floor(q*2^m) (where AND denotes the bitwise AND operator); see A359888 for the denominators.

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 5, 0, 57, 1, 57, 0, 5, 0, 0, 0, 0, 1, 0, 1, 8, 8, 1, 0, 1, 0, 0, 0, 0, 85, 0, 37, 1, 1, 1, 37, 0, 85, 0, 0
Offset: 1

Views

Author

Rémy Sigrist, Jan 17 2023

Keywords

Comments

A(n, k)/A359888(n, k) can be interpreted as (1/n) AND (1/k) (assuming that inverses of powers of 2 have terminating binary expansions).

Examples

			Square array A(n, k) begins:
  n\k | 1  2   3  4    5  6     7  8       9   10      11  12
  ----+------------------------------------------------------
    1 | 1  0   0  0    0  0     0  0       0    0       0   0
    2 | 0  1   0  0    0  0     0  0       0    0       0   0
    3 | 0  0   1  1    1  0     1  0       5    1      85   1
    4 | 0  0   1  1    0  0     0  0       0    0       0   0
    5 | 0  0   1  0    1  2    57  1      37    1     837   1
    6 | 0  0   0  0    2  1     8  1       2    1       8   0
    7 | 0  0   1  0   57  8     1  1       1    1    1195   1
    8 | 0  0   0  0    1  1     1  1       0    0       0   0
    9 | 0  0   5  0   37  2     1  0       1   11  256687   5
   10 | 0  0   1  0    1  1     1  0      11    1     749   1
   11 | 0  0  85  0  837  8  1195  0  256687  749       1  85
   12 | 0  0   1  0    1  0     1  0       5    1      85   1
		

Crossrefs

Cf. A300630, A306231, A359806, A359888 (denominators).

Programs

  • PARI
    See Links section.

Formula

A(n, k) = A(k, n).
A(n, n) = 1.
A(n, 2*n) = 0 iff n belongs to A300630.
A(A306231(n), A306231(n+1)) = 0.
A(n, A359806(n)) = 0.

A359888 Square array A(n, k), n, k > 0, read by antidiagonals; A(n, k) is the denominator of the unique rational q such that for any m, floor(2^m/n) AND floor(2^m/k) = floor(q*2^m) (where AND denotes the bitwise AND operator); see A359887 for the numerators.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 4, 4, 1, 1, 1, 1, 15, 4, 15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 63, 1, 5, 1, 63, 1, 1, 1, 1, 1, 1, 15, 15, 1, 1, 1, 1, 1, 1, 63, 1, 455, 6, 455, 1, 63, 1, 1, 1, 1, 15, 1, 8, 63, 63, 8, 1, 15, 1, 1, 1, 1, 1023, 1, 585, 8, 7, 8, 585, 1, 1023, 1, 1
Offset: 1

Views

Author

Rémy Sigrist, Jan 17 2023

Keywords

Comments

A359887(n, k)/A(n, k) can be interpreted as (1/n) AND (1/k) (assuming that inverses of powers of 2 have terminating binary expansions).

Examples

			Square array A(n, k) begins:
  n\k | 1  2     3  4      5     6      7  8        9     10
  ----+-----------------------------------------------------
    1 | 1  1     1  1      1     1      1  1        1      1
    2 | 1  2     1  1      1     1      1  1        1      1
    3 | 1  1     3  4     15     1     63  1       63     15
    4 | 1  1     4  4      1     1      1  1        1      1
    5 | 1  1    15  1      5    15    455  8      585     15
    6 | 1  1     1  1     15     6     63  8       63     30
    7 | 1  1    63  1    455    63      7  8       63    455
    8 | 1  1     1  1      8     8      8  8        1      1
    9 | 1  1    63  1    585    63     63  1        9    117
   10 | 1  1    15  1     15    30    455  1      117     10
   11 | 1  1  1023  1  11275  1023  76461  1  3243933  11275
   12 | 1  1    12  1     15     1     63  1       63     15
		

Crossrefs

Cf. A300630, A306231, A359806, A359887 (numerators).

Programs

  • PARI
    See Links section.

Formula

A(n, k) = A(k, n).
A(n, n) = n.
Showing 1-6 of 6 results.