Concatenating two consecutive integers
183 and 184
we get a six-digit number
183184, equalling
square of 428.List similar pairs, below
500,000 (final product).
How about the same task with a pair of a consecutve numbers
in a decreasing order?
Please provide a similar list (same constraints).
I started by modifying my equation from the ascending case into: (10^D + 1) * N - 1 = S^2. Taking this equation mod P yielded S^2 + 1 = 0 mod P. But this is a harder equation to crack.
First, if P is of the form 4k+3 then there are no solutions (eg: P=11=4*2+3). This then means if 10^D+1 has any prime factors of the form p=4k+3 then there will be no solutions for that length D.
This explains the gaps in Charlie's program output. Solutions went from D=2 to D=4 to D=6 because if D is odd then 10^D+1 has 11 as a factor, which negates the possibility of any solutions.
Now, if P is a prime of the form 4k+1 then S^2 + 1 = 0 mod P will have exactly two values of S as solutions, and those two values will sum to P. So if I could come up with a good way to find those values then I'd be able to continue similar to my earlier solution.
But one more thing, Jer noted the subset 91, 9901, 999001. This can be explained by taking the equation mod 10^D+1 with D being even. Let D=2H. Then S^2 + 1 = 0 mod 100^H+1 has one easy to find solution, namely S=10^H. However, this is a degenerate solution for our puzzle.
But since these solutions come in pairs, we get S'=100^H-10^H+1 as the other solution. Now its pretty easy to see that 100^H-10^H+1 is the generating function for 91, 9901, 999001.... So we can at least say there is at least one solution for every value of H, aka every even value of D.