Talk:Disarium numbers: Difference between revisions

From Rosetta Code
Content added Content deleted
(Created page with "A simple optimization is considering the example 13n 120 < n<sup>3</sup> < 129. So stop after n=5. Best is probably to construct a table of powers of 1-9 up to 22 with fewer t...")
 
mNo edit summary
 
Line 1: Line 1:
A simple optimization is considering the example 13n 120 < n<sup>3</sup> < 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.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 18:48, 12 February 2022 (UTC)
A simple optimization is considering the example 13n 120 < n<sup>3</sup> < 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.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk: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.<BR>
digits 0..3 ex. 1234 , powdgtsum= 1+4+27+256 = 288 delta = 1234-288= 946<BR>
digits 4..7 ex. 12340000 , powdgtsum= 1+4+27+256 = 288 delta = 12340000-288= 12339712<BR>
digits 8..11 ex. 123400000000 , powdgtsum= 1+4+27+256 = 288 delta = 123400000000-288= 123399999712<BR>
and sort them for the difference<br>
starting with 1**5 for the last digit I have only to check for the difference of 1 via binary search in 0..3
[[User:Horst|Horst]] ([[User talk:Horst|talk]]) 14:33, 4 January 2023 (UTC)

Latest revision as of 14:34, 4 January 2023

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)