Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
9
Task/Amicable-pairs/PascalABC.NET/amicable-pairs.pas
Normal file
9
Task/Amicable-pairs/PascalABC.NET/amicable-pairs.pas
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
function k(n : Integer) := 1.to(n div 2).where(d->n mod d=0).sum;
|
||||
begin
|
||||
1.to(20000).Where(n->n=k(k(n)))
|
||||
.Select(n->
|
||||
begin var m:=k(n);
|
||||
Result:=(min(n,m),max(n,m));
|
||||
end).where(v->v[0]<v[1]).Distinct
|
||||
.Select(v->$'{v[0]}-{v[1]}').Printlines;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue