For the purposes of this challenge, let's define a cyclic number as an integer that passes the basic part of Midy's Theorem, but not necessarily the extended theorem. This means:
the digits in the second half of the
repeating decimal period are[integer is] the 9s complement of the corresponding digits in its first half
In other words,
142857 is a cyclic number because
142 + 857 = 999 and
13358664 is a cylic number because
1335 + 8664 = 9999.
Given an even-digit integer n > 10, determine whether n is a cyclic number by our definition. If it is, return something truthy. If it's not, return the closest cyclic number to n.
> 18 True > 133249 132867
This is code golf, so shortest code wins.