Suppose you want to know how many palindromes are in the set of integers from 1 to N. Can you provide a formula for this? Otherwise, can you give an algorithm, as efficient as possible, to find the answer? And, are there special values of N for which there is a simple formula?
for even k the formula is:
or, 2 * V(n) - 2
for odd k the formula is:
or, (11/10) * V(10*n) - 2
Edited on June 17, 2024, 12:31 pm