Can you prove palindrome property?

Revision en1, by mowo, 2026-02-06 06:36:25

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
Tags palindrome, array, proof, math

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English mowo 2026-02-06 06:36:25 2189 Initial revision (published)