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.

User: Kishore Rajesh

Kishore Rajesh's wiki page.

Kishore Rajesh has authored 2 sequences.

A362368 Number of binary strings of length n which are losing configurations in the palindrome game.

Original entry on oeis.org

0, 0, 2, 0, 4, 0, 18, 4, 56, 12, 156, 80, 568, 424, 1856, 2080, 6548, 8524, 22430, 33840, 80672, 132704, 292428, 510892, 1079282, 1955388, 3990564, 7453012, 14928434, 28406028, 56125298, 108156096, 212297776
Offset: 0

Author

Kishore Rajesh, Apr 17 2023

Keywords

Comments

The palindrome game is a game where players take turns removing a nonempty palindrome from a binary string. The player who crosses off the last palindrome wins. The nonempty palindrome can be removed from anywhere in the current string.

Examples

			For n = 2, 10 and 01 are losing strings since the first player has to cross out either the first or second character, leaving the second player with a string of length 1, which is always a palindrome. 00 and 11 are not losing strings since the first player can cross out the entire string and win.
For n = 4, the four losing positions are 0011, 0101, 1010, 1100.
For n = 5, 00101 is winning since the first player may put the second in a losing position by removing 010 from the center or by removing either of the first two 0's.
		

Programs

  • Python
    from functools import lru_cache
    from itertools import product
    def ispal(s): return s == s[::-1]
    def m(s): yield from (s[:i]+s[j:] for i in range(len(s)) for j in range(i+1, len(s)+1) if ispal(s[i:j]))
    @lru_cache(maxsize=None)
    def L(s): return all(not L(t) for t in m(s))
    def a(n): return 2*sum(1 for p in product("01", repeat=n-1) if L("0"+"".join(p))) if n else 0
    print([a(n) for n in range(16)]) # Michael S. Branicky, May 23 2023

Extensions

a(21)-a(29) from Michael S. Branicky, May 23 2023
a(30)-a(31) from Michael S. Branicky, May 26 2023
a(32) from Michael S. Branicky, May 30 2023

A361697 The least y-value of the lower left corner of an n X n box with x-value n such that no edge of the box overlaps with a previous box, given that the first box has its lower left corner at (1,1).

Original entry on oeis.org

1, 2, 3, 4, 2, 6, 3, 8, 4, 7, 9, 12, 1, 11, 3, 16, 2, 13, 4, 17, 5, 20, 6, 24, 8, 14, 1, 25, 7, 21, 3, 32, 10, 22, 9, 31, 2, 23, 11, 37, 4, 26, 12, 42, 13, 29, 5, 48, 16, 33, 6, 40, 17, 28, 8, 53, 14, 36, 1, 51, 15, 35, 3, 64, 7, 46, 18, 56, 10, 44, 9, 67
Offset: 1

Author

Kishore Rajesh, Mar 20 2023

Keywords

Comments

The sequence is defined by the following method: Draw a 1 X 1 box with lower left corner at (1,1) on the coordinate grid. Then, for all integers n greater than 1, a(n) is the smallest positive integer value such that an n X n box with lower left coordinate (n, a(n)) has no edges that overlap with other boxes.
A029744 appears to be the terms for which a(n)=n in this sequence.

Examples

			The following shows the positioning of the first 5 boxes:
            __ __ __ __
           |   __ __ __|__ __
         __|__|__      |     |
        |  |  |  |     |     |
      __|__|__|__|__ __|     |
     |  |__|__|__|           |
   __|__ __|  |__ __ __ __ __|
  |__|
		

Crossrefs

Cf. A289523 (analogous sequence with circles), A361742 (variant allowing overlapping edges).

Programs

  • PARI
    See Links section.