Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,43 @@
|
|||
int N, A(1+30);
|
||||
|
||||
func Used; int M; \Return 'true' if M is in array A
|
||||
int I;
|
||||
[for I:= 1 to N-1 do
|
||||
if M = A(I) then return true;
|
||||
return false;
|
||||
];
|
||||
|
||||
func MinFactor; int Num; \Return minimum unused factor
|
||||
int Fac, Val, Min;
|
||||
[Fac:= 2;
|
||||
Min:= -1>>1;
|
||||
repeat if rem(Num/Fac) = 0 then \found a factor
|
||||
[Val:= Fac;
|
||||
loop [if Used(Val) then Val:= Val+Fac
|
||||
else [if Val<Min then Min:= Val;
|
||||
quit;
|
||||
];
|
||||
];
|
||||
Num:= Num/Fac;
|
||||
]
|
||||
else Fac:= Fac+1;
|
||||
until Fac > Num;
|
||||
return Min;
|
||||
];
|
||||
|
||||
proc EKG; int M; \Calculate and show EKG sequence
|
||||
[A(1):= 1; A(2):= M;
|
||||
for N:= 3 to 30 do
|
||||
A(N):= MinFactor(A(N-1));
|
||||
Format(2, 0);
|
||||
Text(0, "EKG("); RlOut(0, float(M)); Text(0, "):");
|
||||
Format(3, 0);
|
||||
for N:= 1 to 30 do
|
||||
RlOut(0, float(A(N)));
|
||||
CrLf(0);
|
||||
];
|
||||
|
||||
int Tbl, I;
|
||||
[Tbl:= [2, 5, 7, 9, 10];
|
||||
for I:= 0 to 4 do EKG(Tbl(I));
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue