I might have misunderstood what you are going for, but I would not use any loops. Here is a list of
$10^5$ integers.
data = RandomInteger[9, 10^5];
Sliding window of segments of 9 elements:
nines = Partition[data, 9, 1];
You got 12 9-palindromes out of
$10^5$ integers:
{
{2, 0, 7, 5, 0, 5, 7, 0, 2},
{6, 1, 5, 0, 0, 0, 5, 1, 6},
{9, 4, 4, 1, 6, 1, 4, 4, 9},
{9, 4, 7, 5, 1, 5, 7, 4, 9},
{0, 6, 9, 0, 8, 0, 9, 6, 0},
{6, 1, 4, 7, 5, 7, 4, 1, 6},
{3, 0, 6, 0, 0, 0, 6, 0, 3},
{4, 9, 4, 6, 6, 6, 4, 9, 4},
{7, 5, 9, 5, 6, 5, 9, 5, 7},
{0, 5, 7, 7, 7, 7, 7, 5, 0},
{9, 0, 1, 4, 0, 4, 1, 0, 9},
{4, 2, 0, 5, 1, 5, 0, 2, 4}
}
This is the index at what number polindromes start:
index = Flatten[Position[nines, #] & /@ polys]
{8720, 9304, 19630, 23868, 33381, 34247, 48155, 53876, 72100, 76200, 81983, 89946}
And this is the way to check it:
data[[# ;; # + 9]] & /@ index