Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,16 +1,16 @@
scope /* show members of the van der Corput sequence in various bases
translated from the C sample
*/
* translated from the C sample
*/
# returns the numerator and denominator of the nth member of the van der Corput sequence
# in the specified base
local procedure vc( nth :: number, base :: number )
local proc vc( nth :: number, base :: number )
local p, q, n := 0, 1, nth;
while n <> 0 do
p *:= base
p +:= n mod base
q *:= base
p *:= base;
p +:= n mod base;
q *:= base;
n \:= base
od;
@ -18,15 +18,15 @@ scope /* show members of the van der Corput sequence in various bases
local num, denom := p, q;
q := numtheory.gcd( p, q );
return num \ q, denom \ q
end
end;
# task
for b from 2 to 5 do
printf( "base %d:", b );
for i from 0 to 9 do
local n, d := vc( i, b );
if n <> 0 then printf( " %d/%d", n, d ) else printf( " 0" ) fi;
end
if n <> 0 then printf( " %d/%d", n, d ) else printf( " 0" ) fi
od;
io.write( "\n" )
od
end
epocs