32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
int N, ArithCnt, CompCnt, Div, DivCnt, Sum, Quot;
|
|
[Format(4, 0);
|
|
N:= 1; ArithCnt:= 0; CompCnt:= 0;
|
|
repeat Div:= 1; DivCnt:= 0; Sum:= 0;
|
|
loop [Quot:= N/Div;
|
|
if Quot < Div then quit;
|
|
if Quot = Div and rem(0) = 0 then \N is a square
|
|
[Sum:= Sum+Quot; DivCnt:= DivCnt+1; quit];
|
|
if rem(0) = 0 then
|
|
[Sum:= Sum + Div + Quot;
|
|
DivCnt:= DivCnt+2;
|
|
];
|
|
Div:= Div+1;
|
|
];
|
|
if rem(Sum/DivCnt) = 0 then \N is arithmetic
|
|
[ArithCnt:= ArithCnt+1;
|
|
if ArithCnt <= 100 then
|
|
[RlOut(0, float(N));
|
|
if rem(ArithCnt/20) = 0 then CrLf(0);
|
|
];
|
|
if DivCnt > 2 then CompCnt:= CompCnt+1;
|
|
case ArithCnt of 1000, 10_000, 100_000, 1_000_000:
|
|
[CrLf(0);
|
|
IntOut(0, N); ChOut(0, 9\tab\);
|
|
IntOut(0, CompCnt);
|
|
]
|
|
other;
|
|
];
|
|
N:= N+1;
|
|
until ArithCnt >= 1_000_000;
|
|
]
|