Data update

This commit is contained in:
Ingy döt Net 2025-06-11 20:16:52 -04:00
parent 72eb4943cb
commit 4d5544505c
2347 changed files with 62432 additions and 16731 deletions

View file

@ -1,17 +1,9 @@
BEGIN # generate elements of the Sysiphus Sequence: see OEIS A350877 #
# returns the largest element in a #
OP MAX = ( []INT a )INT:
IF LWB a >UPB a THEN 0
ELSE
INT result := a[ LWB a ];
FOR i FROM LWB a + 1 TO UPB a DO
IF result < a[ i ] THEN result := a[ i ] FI
OD;
result
FI # MAX # ;
PR read "rows.incl.a68" PR # include row (array) utilities #
# sieve the primes #
INT sieve max = 1 000 000 000; ### CHANGE TO E.G.: 100 000 000 FOR ALGOL 68G ###
INT sieve max = 100 000 000; ### 10 000 000 for ALGOL 68 Genie version 3 #
BOOL is odd := TRUE;
[ sieve max ]BOOL sieve; FOR i TO UPB sieve DO sieve[ i ] := is odd; is odd := NOT is odd OD;
sieve[ 1 ] := FALSE;

View file

@ -1,24 +1,20 @@
func isprim num .
if num mod 2 = 0 and num > 2
return 0
.
if num mod 2 = 0 and num > 2 : return 0
i = 3
while i <= sqrt num
if num mod i = 0
return 0
.
if num mod i = 0 : return 0
i += 2
.
return 1
.
prim = 1
proc nextprim . .
proc nextprim .
repeat
prim += 1
until isprim prim = 1
.
.
numfmt 0 4
numfmt 4 0
n = 1
write n
for i = 2 to 100
@ -29,7 +25,5 @@ for i = 2 to 100
n /= 2
.
write n
if i mod 10 = 0
print ""
.
if i mod 10 = 0 : print ""
.

View file

@ -0,0 +1,33 @@
num = 1;
primepi = 1;
res = Table[
If[EvenQ[num],
num /= 2;
,
num += Prime[primepi];
primepi++;
];
num
,
{99}
];
PrependTo[res, 1];
Partition[res, 10] // Grid
Table[
num = 1;
primepi = 1;
Do[
If[EvenQ[num],
num /= 2;
,
num += Prime[primepi];
primepi++;
];
,
{j}
];
{num, Prime[primepi - 1]}
,
{j, {999, 9999, 99999, 999999, 9999999, 99999999}}
]