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

A272680 Smallest square that begins with n (in binary).

Original entry on oeis.org

0, 1, 4, 25, 4, 81, 25, 121, 16, 9, 81, 361, 25, 441, 225, 121, 16, 1089, 36, 625, 81, 169, 361, 1521, 49, 25, 841, 441, 225, 3721, 121, 2025, 64, 529, 1089, 4489, 36, 2401, 1225, 625, 81, 5329, 169, 2809, 11449, 361, 5929, 1521, 6241, 49, 100, 6561, 841, 6889
Offset: 0

Views

Author

N. J. A. Sloane, May 22 2016

Keywords

Examples

			a(10)=81, because 81 = 9^2 = 1010001_2 begins with 1010 = 10_2.
		

References

  • Allan C. Wechsler, posting to math-fun mailing list May 22 2016.

Crossrefs

Programs

  • Python
    from gmpy2 import isqrt
    def A272680(n):
        if n == 0:
            return 0
        else:
            d, nd = 1, n
            while True:
                x = (isqrt(nd-1)+1)**2
                if x < nd+d:
                    return int(x)
                d *= 2
                nd *= 2 # Chai Wah Wu, May 22 2016

Extensions

More terms from Chai Wah Wu, May 22 2016

A272681 Smallest binary square that begins with the binary expansion of n.

Original entry on oeis.org

0, 1, 100, 11001, 100, 1010001, 11001, 1111001, 10000, 1001, 1010001, 101101001, 11001, 110111001, 11100001, 1111001, 10000, 10001000001, 100100, 1001110001, 1010001, 10101001, 101101001, 10111110001, 110001, 11001, 1101001001, 110111001, 11100001, 111010001001
Offset: 0

Views

Author

N. J. A. Sloane, May 22 2016

Keywords

Examples

			a(10)=1010001 = 81_10, because 1010001_2 begins with 1010 = 10_2.
		

References

  • Allan C. Wechsler, posting to math-fun mailing list May 22 2016.

Crossrefs

Programs

  • Python
    from gmpy2 import isqrt
    def A272681(n):
        if n == 0:
            return 0
        else:
            d, nd = 1, n
            while True:
                x = (isqrt(nd-1)+1)**2
                if x < nd+d:
                    return int(bin(x)[2:])
                d *= 2
                nd *= 2 # Chai Wah Wu, May 22 2016

Extensions

More terms from Chai Wah Wu, May 22 2016

A319268 Lexicographically earliest sequence of distinct positive terms such that for any n > 0, the binary representation of n^2 starts with the binary representation of a(n).

Original entry on oeis.org

1, 2, 4, 8, 3, 9, 6, 16, 5, 12, 7, 18, 10, 24, 14, 32, 36, 20, 11, 25, 13, 15, 33, 72, 19, 21, 22, 49, 26, 28, 30, 64, 17, 144, 38, 40, 42, 45, 23, 50, 52, 27, 57, 60, 31, 66, 34, 288, 37, 39, 81, 84, 43, 91, 47, 98, 101, 105, 54, 56, 29, 120, 62, 128, 132, 68
Offset: 1

Views

Author

Rémy Sigrist, Sep 16 2018

Keywords

Comments

This sequence is a permutation of the natural numbers with inverse A319499.
We can build a variant of this sequence for any base b > 1.
We can build a variant of this sequence for any strictly increasing sequence of nonnegative integers.

Examples

			The first terms, alongside the binary representation of n^2 with a(n) in parentheses, are:
  n   a(n)  bin(n^2)
  --  ----  --------
   1     1          (1)
   2     2        (10)0
   3     4       (100)1
   4     8      (1000)0
   5     3      (11)001
   6     9     (1001)00
   7     6     (110)001
   8    16    (10000)00
   9     5    (101)0001
  10    12    (1100)100
  11     7    (111)1001
  12    18   (10010)000
  13    10   (1010)1001
  14    24   (11000)100
  15    14   (1110)0001
  16    32  (100000)000
  17    36  (100100)001
  18    20  (10100)0100
  19    11  (1011)01001
  20    25  (11001)0000
		

Crossrefs

Programs

  • Mathematica
    a = {1}; Do[r = IntegerDigits[n^2, 2]; AppendTo[a, Min@Complement[Table[FromDigits[Take[r, k], 2], {k, Length@r}],a]], {n, 2, 66}]; a (* Ivan Neretin, Oct 24 2018 *)
  • PARI
    See Links section.

A296616 Lexicographically earliest sequence of distinct positive terms such that, for any n > 0, the binary expansion of a(n) * a(n + 1) starts with the binary expansion of n.

Original entry on oeis.org

1, 2, 4, 3, 6, 7, 14, 8, 16, 9, 18, 5, 10, 11, 21, 12, 22, 13, 23, 27, 24, 28, 26, 29, 53, 31, 54, 32, 56, 17, 57, 35, 15, 36, 61, 37, 63, 19, 64, 39, 33, 20, 34, 41, 69, 42, 71, 43, 72, 44, 73, 45, 74, 46, 38, 47, 77, 48, 78, 49, 79, 25, 40, 51, 81, 52, 82
Offset: 1

Views

Author

Rémy Sigrist, Dec 17 2017

Keywords

Comments

It is likely that this sequence is a permutation of the natural numbers.
The lines visible in the scatterplot of the first terms seems to corresponds to set of indices n where the function f(n) = Sum_{k=1..n-1} (-1)^k * (A029837(1+a(k)*a(k+1)) - A029837(1+k)) has the same value; those lines can be partitioned into two groups, depending on the parity of n (see Links section).
This sequence has connections with A272679: here the binary expansion of a(n)*a(n+1) starts with that of n, there the binary expansion of a(n)^2 starts with that of n.

Examples

			The first terms, alongside the binary representations of n and a(n) * a(n + 1), are:
  n     a(n)    bin(n)    bin(a(n)*a(n+1))
  --    ----    ------    ----------------
   1       1         1            10
   2       2        10          1000
   3       4        11          1100
   4       3       100         10010
   5       6       101        101010
   6       7       110       1100010
   7      14       111       1110000
   8       8      1000      10000000
   9      16      1001      10010000
  10       9      1010      10100010
  11      18      1011       1011010
  12       5      1100        110010
  13      10      1101       1101110
  14      11      1110      11100111
  15      21      1111      11111100
  16      12     10000     100001000
  17      22     10001     100011110
  18      13     10010     100101011
  19      23     10011    1001101101
  20      27     10100    1010001000
		

Crossrefs

Showing 1-4 of 4 results.