Блог пользователя mowo

Автор mowo, история, 7 месяцев назад, По-английски

Hello, I had this observation while solving a problem, I can tell it is true but I cannot figure out how to concretely prove it. Maybe one of you with better mathematics than me can come up with a proof.

Here is the situation: You are given array of n positive integers. For 1<k<n, can you prove that:

  • If k is even, then all subarrays of length k are palindromic IFF the entire array is just a single number repeated
  • If k is odd, then all subarrays of length k are palindromic IFF the entire array is either a single number repeated, or two numbers alternating

In the picture I have illustrated the structure for n=9, and k=7 and 8. I draw an arc between two positions if by some palindromic subarray we know these two positions must have equal numbers. You can tell the assertion is true from the pictures.

I tried to prove it myself, and I think there are some tricky issues that you might run into/need to work out:

See Issues

Полный текст и комментарии »

  • Проголосовать: нравится
  • +28
  • Проголосовать: не нравится