28 lines
599 B
Plaintext
28 lines
599 B
Plaintext
int N, X;
|
|
real M, Thresh, MC;
|
|
[Text(0, "First 20 magic constants:^M^J");
|
|
for N:= 3 to 20+3-1 do
|
|
[IntOut(0, (N*N*N+N)/2); ChOut(0, ^ )];
|
|
CrLf(0);
|
|
Text(0, "1000th magic constant: ");
|
|
N:= 1000+3-1;
|
|
IntOut(0, (N*N*N+N)/2);
|
|
CrLf(0);
|
|
Text(0, "Smallest order magic square with a constant greater than:^M^J");
|
|
Thresh:= 10.;
|
|
M:= 3.;
|
|
Format(1, 0);
|
|
for X:= 1 to 10 do
|
|
[repeat MC:= (M*M*M+M)/2.;
|
|
M:= M+1.;
|
|
until MC > Thresh;
|
|
Text(0, "10^^");
|
|
if X < 10 then ChOut(0, ^0);
|
|
IntOut(0, X);
|
|
Text(0, ": ");
|
|
RlOut(0, M-1.);
|
|
CrLf(0);
|
|
Thresh:= Thresh*10.;
|
|
];
|
|
]
|