Talk:Disarium numbers

From Rosetta Code

A simple optimization is considering the example 13n 120 < n3 < 129. So stop after n=5. Best is probably to construct a table of powers of 1-9 up to 22 with fewer than 22 digits then solve by addition of appropriate combinations.--Nigel Galloway (talk) 18:48, 12 February 2022 (UTC)

I'm thinking about building arrays of 4 consecutive digits in combound with the difference of their power digit sum.

digits 0..3 ex. 1234 , powdgtsum= 1+4+27+256 = 288 delta = 1234-288= 946
digits 4..7 ex. 12340000 , powdgtsum= 1+4+27+256 = 288 delta = 12340000-288= 12339712
digits 8..11 ex. 123400000000 , powdgtsum= 1+4+27+256 = 288 delta = 123400000000-288= 123399999712
and sort them for the difference
starting with 1**5 for the last digit I have only to check for the difference of 1 via binary search in 0..3 Horst (talk) 14:33, 4 January 2023 (UTC)