# Expanding Palindromes

I couldn't find anything about this on the internet and was wondering if there was any information or work done on an idea regarding expanding palindromes? I'm defining expanding palindromes as

A sequence which, when compacted into one number following the original order, continuously creates palindromes as we find the next term in the sequence

An excellent example of what this means would be the ruler function, which would output a sequence like

$$1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,5...$$ Which would then compact to the number $1213121412131215...$

We can see that as we progress through each term in the function, we obtain a new palindrome. At first we get to $$1$$ Which is a palindrome seen when $n=1$ (term number is 1) Then the palindrome breaks up and appears again when we get $$1,2,1$$ Which compacts to $121$, a palindrome. Only to break up again when we get

$$1,2,1,3,1,2,1$$ Which compacts to 1213121, which is a new palindrome seen when $n=7$. We can observe that this property lasts forever and occurs whenever $n=2^k-1$ for a positive integer $k$. Although this just applies to the ruler function

Is there any structured idea about this, anything actually formal or is this a new idea? Are there any known sequences that have similar properties? Any ideas would be greatly appreciated!

More Examples with this property (and people who found it):

$f(n) = c$ where $c$ is a constant (John Lou)

• $f(x) = c$ where c is a constant :) – John Lou May 3 '17 at 1:29
• I don't understand the definition at all...it seems very vague. Can you define an "expanding palindrome" precisely? How does it differ from a palindrome? – lulu May 3 '17 at 1:29
• Do you have any links for the "ruler function?" – John Lou May 3 '17 at 1:29
• A function that generates a sequence of values that always or in some interval has the palindrome property at different values of $n$. We know it is a palindrome after we just put all the outputted terms from the sequence together in the order they come in. I hope that clears up the definition @lulu – Stone May 3 '17 at 2:39
• Formal grammars can easily yield palindromic sequences. If you consider a grammar to be a function, then you are done. If you don't consider a grammar to be a function, you could devise a method to convert a grammar to a function. BTW, if you search for "formal grammar as a function" you get a lot of hits on "functional grammar", but "functional" in this context means "utility", versus "mapping" – Χpẘ May 3 '17 at 17:26

You can create as many "expanding palindromes" as you want. The main idea is if you pick $n$ last consecutive terms $a_1, \ldots, a_n$ in the list $x_1, \ldots, x_l, a_1, \ldots, a_n$, you can add $n$ more terms $a_n, \ldots, a_2,a_1$ to make a palindrome. Keep doing that we get the desired sequence. I particularly don't think there's any interesting property about this type of sequence.