Anonymous user
Euler's sum of powers conjecture: Difference between revisions
Euler's sum of powers conjecture (view source)
Revision as of 04:40, 18 September 2021
, 2 years ago→{{header|QL SuperBASIC}}: more concise initialisation
(→{{header|QL SuperBASIC}}: more concise initialisation) |
|||
Line 3,167:
=={{header|QL SuperBASIC}}==
This program enhances a modular brute-force search posted on fidonet in the 1980s via number theoretical enhancements as used by
the program listed under ZX Spectrum Basic--but without the early exit in the control framework so as to be backward-compatible
with the lack of floating point in Sinclair ZX80 BASIC (whereby the latter is truly 'zeroeth' generation). So that it will run on a
ZX80 (with a 16K RAM pack & some MODification) & complete the task sooner than than that for an unexpanded Spectrum, it relies
entirely on integer functions, their upper limit being 2^15- 1 in ZX80 BASIC as well. Thus, the "slide rule" calculation of each
percentage on the Spectrum is replaced by that of least significant digits across "abaci" of relatively prime bases Pi. Given that
each Pi is to be <= 2^7 for said limit's sake, it will take at least six prime numbers or powers thereof to serve as bases of such
a mixed-base number system, since it is necessary that ΠPi > 249^5 for unambiguous representation. The difference between
successive bases is successive powers of 2, so that one can more easily convert (esp. via assembly, as just shifts & subtractions
will be needed) between base 2^7 & mixed-base representations as character strings. In disproving Euler's conjecture, the program
demonstrates that using 60 bits of integer precision in 1966 was 2-fold overkill, or even more so in terms of overhead cost
vis-a-vis contemporaneous computers less sophisticated than a CDC 6600.
<lang qbasic>
1 CLS
Line 3,175 ⟶ 3,187:
5 LET t%=48
6 FOR m=0 TO 6: READ n%(m)
9
10 FOR m=1 TO 6
11 LET i%(j,m)=j MOD n%(m)
|