QBasic

Primzahlgenerator

Primzahlgenerator für Microsofts QBasic-Interprter. Ist auch in der Lage, nur bestimmte Primzahlen innerhalb eines Zahlenbereichs zu ermitteln.

10 DEFDBL A-Z
www = 0
i = 0
sss = 0
sst = 0
ssu = 0
ooo = 0
oop = 0
ooq = 0
C = 0
B = 0
CLS
KEY(1) ON
ON KEY(1) GOSUB 100
KEY 15, CHR$(0) + CHR$(1)
ON KEY(15) GOSUB 100
KEY(15) ON
PRINT "Primzahlenermittlung"
20 PRINT "Geben Sie den Anfangswert ein! Max. 9007199254740991"
INPUT A
IF A > 9007199254740991# THEN CLS
IF A > 9007199254740991# THEN PRINT "Anfangswert zu groá!"
IF A > 9007199254740991# THEN 20
IF A < 0 THEN CLS
IF A < 0 THEN PRINT "Negativer Anfangswert unzul„ssig!"
IF A < 0 THEN 20
IF A < 2 THEN CLS
IF A < 2 AND A >= 0 THEN PRINT "Anfangswert muss mindestens 2 sein!"
IF A < 2 AND A >= 0 THEN 20
30 PRINT "Geben Sie den Endwert ein! Max. 9007199254740991"
INPUT E
IF E > 9007199254740991# THEN CLS
IF E > 9007199254740991# THEN PRINT "Endwert zu groá!"
IF E > 9007199254740991# THEN 20
IF E < A THEN CLS
IF E < A THEN PRINT "Endwert muss grӇer als Anfangswert sein!"
IF E < A THEN 20
IF A > 2 AND E > 2 AND INT(A) / 2 = INT(A / 2) AND INT(E) / 2 = INT(E / 2) THEN 350
350 IF INT(E) = 2 AND INT(A) = 2 THEN 330
IF INT(A) = 2 THEN 320
37 PRINT
PRINT "Sind Sie sicher das Sie aus"; INT(E) - INT(A) + 1; "Zahlen die Primzahlen berechnen wollen!"
PRINT "(J,N oder A[Abbrechen])"
z$ = INPUT$(1)
IF z$ = "J" THEN 40
IF z$ = "j" THEN 40
IF z$ = "N" THEN 10
IF z$ = "n" THEN 10
IF z$ = "A" THEN END
IF z$ = "a" THEN END
IF z$ <> "A,a,J,j,N,n" THEN CLS
IF z$ <> "A,a,J,j,N,n" THEN 37
40 IF A > 2 AND INT(A) / 2 = INT(A / 2) THEN A = A + 1
IF A > 3 AND (A + 3) / 6 = INT((A + 3) / 6) THEN A = A + 2
B = TIMER
PRINT
PRINT "Sie k”nnen die Berechnung jederzeit mit ESC Abbrechen!"
PRINT
310 FOR N = INT(A) TO E STEP 2
IF N < 25 THEN 1
S = N / 5
IF INT(S) = S THEN 2
S = N / 7
IF INT(S) = S THEN 2
S = N / 11
IF INT(S) = S THEN 2
S = N / 13
IF INT(S) = S THEN 2
S = N / 17
IF INT(S) = S THEN 2
S = N / 19
IF INT(S) = S THEN 2
S = N / 23
IF INT(S) = S THEN 2
IF N < 841 THEN 1
S = N / 29
IF INT(S) = S THEN 2
S = N / 31
IF INT(S) = S THEN 2
IF N < 1369 THEN 1
S = N / 37
IF INT(S) = S THEN 2
S = N / 41
IF INT(S) = S THEN 2
S = N / 43
IF INT(S) = S THEN 2
S = N / 47
IF INT(S) = S THEN 2
S = N / 53
IF INT(S) = S THEN 2
IF N < 3481 THEN 1
S = N / 59
IF INT(S) = S THEN 2
S = N / 61
IF INT(S) = S THEN 2
S = N / 67
IF INT(S) = S THEN 2
S = N / 71
IF INT(S) = S THEN 2
IF N < 5329 THEN 1
S = N / 73
IF INT(S) = S THEN 2
S = N / 79
IF INT(S) = S THEN 2
S = N / 83
IF INT(S) = S THEN 2
S = N / 89
IF INT(S) = S THEN 2
IF N < 9409 THEN 1
S = N / 97
IF INT(S) = S THEN 2
S = N / 101
IF INT(S) = S THEN 2
S = N / 103
IF INT(S) = S THEN 2
S = N / 107
IF INT(S) = S THEN 2
IF N < 11881 THEN 1
S = N / 109
IF INT(S) = S THEN 2
S = N / 113
IF INT(S) = S THEN 2
S = N / 127
IF INT(S) = S THEN 2
S = N / 131
IF INT(S) = S THEN 2
IF N < 18769 THEN 1
S = N / 137
IF INT(S) = S THEN 2
S = N / 139
IF INT(S) = S THEN 2
S = N / 149
IF INT(S) = S THEN 2
S = N / 151
IF INT(S) = S THEN 2
IF N < 24649 THEN 1
S = N / 157
IF INT(S) = S THEN 2
S = N / 163
IF INT(S) = S THEN 2
S = N / 167
IF INT(S) = S THEN 2
S = N / 173
IF INT(S) = S THEN 2
IF N < 32041 THEN 1
S = N / 179
IF INT(S) = S THEN 2
S = N / 181
IF INT(S) = S THEN 2
S = N / 191
IF INT(S) = S THEN 2
S = N / 193
IF INT(S) = S THEN 2
IF N < 38809 THEN 1
S = N / 197
IF INT(S) = S THEN 2
S = N / 199
IF INT(S) = S THEN 2
S = N / 211
IF INT(S) = S THEN 2
S = N / 223
IF INT(S) = S THEN 2
IF N < 51529 THEN 1
S = N / 227
IF INT(S) = S THEN 2
S = N / 229
IF INT(S) = S THEN 2
S = N / 233
IF INT(S) = S THEN 2
S = N / 239
IF INT(S) = S THEN 2
IF N < 58081 THEN 1
S = N / 241
IF INT(S) = S THEN 2
S = N / 251
IF INT(S) = S THEN 2
S = N / 257
IF INT(S) = S THEN 2
S = N / 263
IF INT(S) = S THEN 2
IF N < 72361 THEN 1
S = N / 269
IF INT(S) = S THEN 2
S = N / 271
IF INT(S) = S THEN 2
S = N / 277
IF INT(S) = S THEN 2
S = N / 281
IF INT(S) = S THEN 2
IF N < 80089 THEN 1
S = N / 283
IF INT(S) = S THEN 2
S = N / 293
IF INT(S) = S THEN 2
S = N / 307
IF INT(S) = S THEN 2
S = N / 311
IF INT(S) = S THEN 2
IF N < 97969 THEN 1
S = N / 313
IF INT(S) = S THEN 2
S = N / 317
IF INT(S) = S THEN 2
S = N / 331
IF INT(S) = S THEN 2
S = N / 337
IF INT(S) = S THEN 2
IF N < 120409 THEN 1
S = N / 347
IF INT(S) = S THEN 2
S = N / 349
IF INT(S) = S THEN 2
S = N / 353
IF INT(S) = S THEN 2
S = N / 359
IF INT(S) = S THEN 2
IF N < 134689 THEN 1
S = N / 367
IF INT(S) = S THEN 2
S = N / 373
IF INT(S) = S THEN 2
S = N / 379
IF INT(S) = S THEN 2
S = N / 383
IF INT(S) = S THEN 2
IF N < 151321 THEN 1
S = N / 389
IF INT(S) = S THEN 2
S = N / 397
IF INT(S) = S THEN 2
S = N / 401
IF INT(S) = S THEN 2
S = N / 409
IF INT(S) = S THEN 2
IF N < 175561 THEN 1
S = N / 419
IF INT(S) = S THEN 2
S = N / 421
IF INT(S) = S THEN 2
S = N / 431
IF INT(S) = S THEN 2
S = N / 433
IF INT(S) = S THEN 2
IF N < 192721 THEN 1
S = N / 439
IF INT(S) = S THEN 2
S = N / 443
IF INT(S) = S THEN 2
S = N / 449
IF INT(S) = S THEN 2
S = N / 457
IF INT(S) = S THEN 2
IF N < 212521 THEN 1
S = N / 461
IF INT(S) = S THEN 2
S = N / 463
IF INT(S) = S THEN 2
S = N / 467
IF INT(S) = S THEN 2
S = N / 479
IF INT(S) = S THEN 2
IF N < 237169 THEN 1
S = N / 487
IF INT(S) = S THEN 2
S = N / 491
IF INT(S) = S THEN 2
S = N / 499
IF INT(S) = S THEN 2
S = N / 503
IF INT(S) = S THEN 2
IF N < 259081 THEN 1
S = N / 509
IF INT(S) = S THEN 2
S = N / 521
IF INT(S) = S THEN 2
S = N / 523
IF INT(S) = S THEN 2
S = N / 541
IF INT(S) = S THEN 2
IF N < 299209 THEN 1
S = N / 547
IF INT(S) = S THEN 2
S = N / 557
IF INT(S) = S THEN 2
S = N / 563
IF INT(S) = S THEN 2
S = N / 569
IF INT(S) = S THEN 2
IF N < 326041 THEN 1
S = N / 571
IF INT(S) = S THEN 2
S = N / 577
IF INT(S) = S THEN 2
S = N / 587
IF INT(S) = S THEN 2
S = N / 593
IF INT(S) = S THEN 2
IF N < 358801 THEN 1
S = N / 599
IF INT(S) = S THEN 2
S = N / 601
IF INT(S) = S THEN 2
S = N / 607
IF INT(S) = S THEN 2
S = N / 613
IF INT(S) = S THEN 2
IF N < 380689 THEN 1
S = N / 617
IF INT(S) = S THEN 2
S = N / 619
IF INT(S) = S THEN 2
S = N / 631
IF INT(S) = S THEN 2
S = N / 641
IF INT(S) = S THEN 2
IF N < 413449 THEN 1
S = N / 643
IF INT(S) = S THEN 2
S = N / 647
IF INT(S) = S THEN 2
S = N / 653
IF INT(S) = S THEN 2
S = N / 659
IF INT(S) = S THEN 2
IF N < 436921 THEN 1
S = N / 661
IF INT(S) = S THEN 2
S = N / 673
IF INT(S) = S THEN 2
S = N / 677
IF INT(S) = S THEN 2
S = N / 683
IF INT(S) = S THEN 2
IF N < 477481 THEN 1
S = N / 691
IF INT(S) = S THEN 2
S = N / 701
IF INT(S) = S THEN 2
S = N / 709
IF INT(S) = S THEN 2
S = N / 719
IF INT(S) = S THEN 2
IF N < 528529 THEN 1
S = N / 727
IF INT(S) = S THEN 2
S = N / 733
IF INT(S) = S THEN 2
S = N / 739
IF INT(S) = S THEN 2
S = N / 743
IF INT(S) = S THEN 2
IF N < 564001 THEN 1
S = N / 751
IF INT(S) = S THEN 2
S = N / 757
IF INT(S) = S THEN 2
S = N / 761
IF INT(S) = S THEN 2
S = N / 769
IF INT(S) = S THEN 2
IF N < 597529 THEN 1
S = N / 773
IF INT(S) = S THEN 2
S = N / 787
IF INT(S) = S THEN 2
S = N / 797
IF INT(S) = S THEN 2
S = N / 809
IF INT(S) = S THEN 2
IF N < 657721 THEN 1
S = N / 811
IF INT(S) = S THEN 2
S = N / 821
IF INT(S) = S THEN 2
S = N / 823
IF INT(S) = S THEN 2
S = N / 827
IF INT(S) = S THEN 2
IF N < 687241 THEN 1
S = N / 829
IF INT(S) = S THEN 2
S = N / 839
IF INT(S) = S THEN 2
S = N / 853
IF INT(S) = S THEN 2
S = N / 857
IF INT(S) = S THEN 2
IF N < 737881 THEN 1
S = N / 859
IF INT(S) = S THEN 2
S = N / 863
IF INT(S) = S THEN 2
S = N / 877
IF INT(S) = S THEN 2
S = N / 881
IF INT(S) = S THEN 2
IF N < 779689 THEN 1
S = N / 883
IF INT(S) = S THEN 2
S = N / 887
IF INT(S) = S THEN 2
S = N / 907
IF INT(S) = S THEN 2
S = N / 911
IF INT(S) = S THEN 2
IF N < 844561 THEN 1
S = N / 919
IF INT(S) = S THEN 2
S = N / 929
IF INT(S) = S THEN 2
S = N / 937
IF INT(S) = S THEN 2
S = N / 941
IF INT(S) = S THEN 2
IF N < 896809 THEN 1
S = N / 947
IF INT(S) = S THEN 2
S = N / 953
IF INT(S) = S THEN 2
S = N / 967
IF INT(S) = S THEN 2
S = N / 971
IF INT(S) = S THEN 2
IF N < 954529 THEN 1
S = N / 977
IF INT(S) = S THEN 2
S = N / 983
IF INT(S) = S THEN 2
S = N / 991
IF INT(S) = S THEN 2
S = N / 997
IF INT(S) = S THEN 2
IF N < 1018081 THEN 1
S = N / 1009
IF INT(S) = S THEN 2
S = N / 1013
IF INT(S) = S THEN 2
S = N / 1019
IF INT(S) = S THEN 2
S = N / 1021
IF INT(S) = S THEN 2
IF N < 1062961 THEN 1
S = N / 1031
IF INT(S) = S THEN 2
S = N / 1033
IF INT(S) = S THEN 2
S = N / 1039
IF INT(S) = S THEN 2
S = N / 1049
IF INT(S) = S THEN 2
IF N < 1104601 THEN 1
S = N / 1051
IF INT(S) = S THEN 2
S = N / 1061
IF INT(S) = S THEN 2
S = N / 1063
IF INT(S) = S THEN 2
S = N / 1069
IF INT(S) = S THEN 2
IF N < 1181569 THEN 1
S = N / 1087
IF INT(S) = S THEN 2
S = N / 1091
IF INT(S) = S THEN 2
S = N / 1093
IF INT(S) = S THEN 2
S = N / 1097
IF INT(S) = S THEN 2
IF N < 1216609 THEN 1
S = N / 1103
IF INT(S) = S THEN 2
S = N / 1109
IF INT(S) = S THEN 2
S = N / 1117
IF INT(S) = S THEN 2
S = N / 1123
IF INT(S) = S THEN 2
IF N < 1274641 THEN 1
S = N / 1129
IF INT(S) = S THEN 2
S = N / 1151
IF INT(S) = S THEN 2
S = N / 1153
IF INT(S) = S THEN 2
S = N / 1163
IF INT(S) = S THEN 2
IF N < 1371241 THEN 1
S = N / 1171
IF INT(S) = S THEN 2
S = N / 1181
IF INT(S) = S THEN 2
S = N / 1187
IF INT(S) = S THEN 2
S = N / 1193
IF INT(S) = S THEN 2
IF N < 1442401 THEN 1
S = N / 1201
IF INT(S) = S THEN 2
S = N / 1213
IF INT(S) = S THEN 2
S = N / 1217
IF INT(S) = S THEN 2
S = N / 1223
IF INT(S) = S THEN 2
IF N < 1510441 THEN 1
S = N / 1229
IF INT(S) = S THEN 2
S = N / 1231
IF INT(S) = S THEN 2
S = N / 1237
IF INT(S) = S THEN 2
S = N / 1249
IF INT(S) = S THEN 2
IF N < 1585081 THEN 1
S = N / 1259
IF INT(S) = S THEN 2
S = N / 1277
IF INT(S) = S THEN 2
S = N / 1279
IF INT(S) = S THEN 2
S = N / 1283
IF INT(S) = S THEN 2
IF N < 1661521 THEN 1
S = N / 1289
IF INT(S) = S THEN 2
S = N / 1291
IF INT(S) = S THEN 2
S = N / 1297
IF INT(S) = S THEN 2
S = N / 1301
IF INT(S) = S THEN 2
IF N < 1697809 THEN 1
S = N / 1303
IF INT(S) = S THEN 2
S = N / 1307
IF INT(S) = S THEN 2
S = N / 1319
IF INT(S) = S THEN 2
S = N / 1321
IF INT(S) = S THEN 2
IF N < 1760929 THEN 1
S = N / 1327
IF INT(S) = S THEN 2
S = N / 1361
IF INT(S) = S THEN 2
S = N / 1367
IF INT(S) = S THEN 2
S = N / 1373
IF INT(S) = S THEN 2
IF N < 1907161 THEN 1
S = N / 1381
IF INT(S) = S THEN 2
S = N / 1399
IF INT(S) = S THEN 2
S = N / 1409
IF INT(S) = S THEN 2
S = N / 1423
IF INT(S) = S THEN 2
IF N < 2036329 THEN 1
S = N / 1427
IF INT(S) = S THEN 2
S = N / 1429
IF INT(S) = S THEN 2
S = N / 1433
IF INT(S) = S THEN 2
S = N / 1439
IF INT(S) = S THEN 2
IF N < 2093809 THEN 1
S = N / 1447
IF INT(S) = S THEN 2
S = N / 1451
IF INT(S) = S THEN 2
S = N / 1453
IF INT(S) = S THEN 2
S = N / 1459
IF INT(S) = S THEN 2
IF N < 2163841 THEN 1
S = N / 1471
IF INT(S) = S THEN 2
S = N / 1481
IF INT(S) = S THEN 2
S = N / 1483
IF INT(S) = S THEN 2
S = N / 1487
IF INT(S) = S THEN 2
IF N < 2217121 THEN 1
S = N / 1489
IF INT(S) = S THEN 2
S = N / 1493
IF INT(S) = S THEN 2
S = N / 1499
IF INT(S) = S THEN 2
S = N / 1511
IF INT(S) = S THEN 2
IF N < 2319529 THEN 1
S = N / 1523
IF INT(S) = S THEN 2
S = N / 1531
IF INT(S) = S THEN 2
S = N / 1543
IF INT(S) = S THEN 2
S = N / 1549
IF INT(S) = S THEN 2
IF N < 2411809 THEN 1
S = N / 1553
IF INT(S) = S THEN 2
S = N / 1559
IF INT(S) = S THEN 2
S = N / 1567
IF INT(S) = S THEN 2
S = N / 1571
IF INT(S) = S THEN 2
IF N < 2493241 THEN 1
S = N / 1579
IF INT(S) = S THEN 2
S = N / 1583
IF INT(S) = S THEN 2
S = N / 1597
IF INT(S) = S THEN 2
S = N / 1601
IF INT(S) = S THEN 2
IF N < 2582449 THEN 1
S = N / 1607
IF INT(S) = S THEN 2
S = N / 1609
IF INT(S) = S THEN 2
S = N / 1613
IF INT(S) = S THEN 2
S = N / 1619
IF INT(S) = S THEN 2
IF N < 2627641 THEN 1
S = N / 1621
IF INT(S) = S THEN 2
S = N / 1627
IF INT(S) = S THEN 2
S = N / 1637
IF INT(S) = S THEN 2
S = N / 1657
IF INT(S) = S THEN 2
IF N < 2765569 THEN 1
S = N / 1663
IF INT(S) = S THEN 2
S = N / 1667
IF INT(S) = S THEN 2
S = N / 1669
IF INT(S) = S THEN 2
S = N / 1693
IF INT(S) = S THEN 2
IF N < 2879809 THEN 1
S = N / 1697
IF INT(S) = S THEN 2
S = N / 1699
IF INT(S) = S THEN 2
S = N / 1709
IF INT(S) = S THEN 2
S = N / 1721
IF INT(S) = S THEN 2
IF N < 2968729 THEN 1
S = N / 1723
IF INT(S) = S THEN 2
S = N / 1733
IF INT(S) = S THEN 2
S = N / 1741
IF INT(S) = S THEN 2
S = N / 1747
IF INT(S) = S THEN 2
IF N < 3073009 THEN 1
S = N / 1753
IF INT(S) = S THEN 2
S = N / 1759
IF INT(S) = S THEN 2
S = N / 1777
IF INT(S) = S THEN 2
S = N / 1783
IF INT(S) = S THEN 2
IF N < 3193369 THEN 1
S = N / 1787
IF INT(S) = S THEN 2
S = N / 1789
IF INT(S) = S THEN 2
S = N / 1801
IF INT(S) = S THEN 2
S = N / 1811
IF INT(S) = S THEN 2
IF N < 3323329 THEN 1
S = N / 1823
IF INT(S) = S THEN 2
S = N / 1831
IF INT(S) = S THEN 2
S = N / 1847
IF INT(S) = S THEN 2
S = N / 1861
IF INT(S) = S THEN 2
IF N < 3485689 THEN 1
S = N / 1867
IF INT(S) = S THEN 2
S = N / 1871
IF INT(S) = S THEN 2
S = N / 1873
IF INT(S) = S THEN 2
S = N / 1877
IF INT(S) = S THEN 2
IF N < 3530641 THEN 1
S = N / 1879
IF INT(S) = S THEN 2
S = N / 1889
IF INT(S) = S THEN 2
S = N / 1901
IF INT(S) = S THEN 2
S = N / 1907
IF INT(S) = S THEN 2
S = N / 1913
IF INT(S) = S THEN 2
IF N < 3728761 THEN 1
S = N / 1931
IF INT(S) = S THEN 2
S = N / 1933
IF INT(S) = S THEN 2
S = N / 1949
IF INT(S) = S THEN 2
S = N / 1951
IF INT(S) = S THEN 2
IF N < 3892729 THEN 1
S = N / 1973
IF INT(S) = S THEN 2
S = N / 1979
IF INT(S) = S THEN 2
S = N / 1987
IF INT(S) = S THEN 2
S = N / 1993
IF INT(S) = S THEN 2
IF N < 3988009 THEN 1
S = N / 1997
IF INT(S) = S THEN 2
S = N / 1999
IF INT(S) = S THEN 2
S = N / 2003
IF INT(S) = S THEN 2
S = N / 2011
IF INT(S) = S THEN 2
IF N < 4068289 THEN 1
S = N / 2017
IF INT(S) = S THEN 2
S = N / 2027
IF INT(S) = S THEN 2
S = N / 2029
IF INT(S) = S THEN 2
S = N / 2039
IF INT(S) = S THEN 2
IF N < 4214809 THEN 1
S = N / 2053
IF INT(S) = S THEN 2
S = N / 2063
IF INT(S) = S THEN 2
S = N / 2069
IF INT(S) = S THEN 2
S = N / 2081
IF INT(S) = S THEN 2
IF N < 4338889 THEN 1
S = N / 2083
IF INT(S) = S THEN 2
S = N / 2087
IF INT(S) = S THEN 2
S = N / 2089
IF INT(S) = S THEN 2
S = N / 2099
IF INT(S) = S THEN 2
IF N < 4456321 THEN 1
S = N / 2111
IF INT(S) = S THEN 2
S = N / 2113
IF INT(S) = S THEN 2
S = N / 2129
IF INT(S) = S THEN 2
S = N / 2131
IF INT(S) = S THEN 2
IF N < 4566769 THEN 1
S = N / 2137
IF INT(S) = S THEN 2
S = N / 2141
IF INT(S) = S THEN 2
S = N / 2143
IF INT(S) = S THEN 2
S = N / 2153
IF INT(S) = S THEN 2
IF N < 4669921 THEN 1
S = N / 2161
IF INT(S) = S THEN 2
S = N / 2179
IF INT(S) = S THEN 2
S = N / 2203
IF INT(S) = S THEN 2
S = N / 2207
IF INT(S) = S THEN 2
IF N < 4897369 THEN 1
S = N / 2213
IF INT(S) = S THEN 2
S = N / 2221
IF INT(S) = S THEN 2
S = N / 2237
IF INT(S) = S THEN 2
S = N / 2239
IF INT(S) = S THEN 2
IF N < 5031049 THEN 1
S = N / 2243
IF INT(S) = S THEN 2
S = N / 2251
IF INT(S) = S THEN 2
S = N / 2267
IF INT(S) = S THEN 2
S = N / 2269
IF INT(S) = S THEN 2
IF N < 5166529 THEN 1
S = N / 2273
IF INT(S) = S THEN 2
S = N / 2281
IF INT(S) = S THEN 2
S = N / 2287
IF INT(S) = S THEN 2
S = N / 2293
IF INT(S) = S THEN 2
IF N < 5276209 THEN 1
S = N / 2297
IF INT(S) = S THEN 2
S = N / 2309
IF INT(S) = S THEN 2
S = N / 2311
IF INT(S) = S THEN 2
S = N / 2333
IF INT(S) = S THEN 2
IF N < 5470921 THEN 1
S = N / 2339
IF INT(S) = S THEN 2
S = N / 2341
IF INT(S) = S THEN 2
S = N / 2347
IF INT(S) = S THEN 2
S = N / 2351
IF INT(S) = S THEN 2
IF N < 5555449 THEN 1
S = N / 2357
IF INT(S) = S THEN 2
S = N / 2371
IF INT(S) = S THEN 2
S = N / 2377
IF INT(S) = S THEN 2
S = N / 2381
IF INT(S) = S THEN 2
IF N < 5678689 THEN 1
S = N / 2383
IF INT(S) = S THEN 2
S = N / 2389
IF INT(S) = S THEN 2
S = N / 2393
IF INT(S) = S THEN 2
S = N / 2399
IF INT(S) = S THEN 2
IF N < 5812921 THEN 1
S = N / 2411
IF INT(S) = S THEN 2
S = N / 2417
IF INT(S) = S THEN 2
S = N / 2423
IF INT(S) = S THEN 2
S = N / 2437
IF INT(S) = S THEN 2
IF N < 5958481 THEN 1
S = N / 2441
IF INT(S) = S THEN 2
S = N / 2447
IF INT(S) = S THEN 2
S = N / 2459
IF INT(S) = S THEN 2
S = N / 2467
IF INT(S) = S THEN 2
IF N < 6115729 THEN 1
S = N / 2473
IF INT(S) = S THEN 2
S = N / 2477
IF INT(S) = S THEN 2
S = N / 2503
IF INT(S) = S THEN 2
S = N / 2521
IF INT(S) = S THEN 2
IF N < 6405961 THEN 1
S = N / 2531
IF INT(S) = S THEN 2
S = N / 2539
IF INT(S) = S THEN 2
S = N / 2543
IF INT(S) = S THEN 2
S = N / 2549
IF INT(S) = S THEN 2
IF N < 6507601 THEN 1
S = N / 2551
IF INT(S) = S THEN 2
S = N / 2557
IF INT(S) = S THEN 2
S = N / 2579
IF INT(S) = S THEN 2
S = N / 2591
IF INT(S) = S THEN 2
IF N < 6723649 THEN 1
S = N / 2593
IF INT(S) = S THEN 2
S = N / 2609
IF INT(S) = S THEN 2
S = N / 2617
IF INT(S) = S THEN 2
S = N / 2621
IF INT(S) = S THEN 2
IF N < 6932689 THEN 1
S = N / 2633
IF INT(S) = S THEN 2
S = N / 2647
IF INT(S) = S THEN 2
S = N / 2657
IF INT(S) = S THEN 2
S = N / 2659
IF INT(S) = S THEN 2
IF N < 7091569 THEN 1
S = N / 2663
IF INT(S) = S THEN 2
S = N / 2671
IF INT(S) = S THEN 2
S = N / 2677
IF INT(S) = S THEN 2
S = N / 2683
IF INT(S) = S THEN 2
IF N < 7219969 THEN 1
S = N / 2687
IF INT(S) = S THEN 2
S = N / 2689
IF INT(S) = S THEN 2
S = N / 2693
IF INT(S) = S THEN 2
S = N / 2699
IF INT(S) = S THEN 2
IF N < 7327849 THEN 1
S = N / 2707
IF INT(S) = S THEN 2
S = N / 2711
IF INT(S) = S THEN 2
S = N / 2713
IF INT(S) = S THEN 2
S = N / 2719
IF INT(S) = S THEN 2
IF N < 7447441 THEN 1
S = N / 2729
IF INT(S) = S THEN 2
S = N / 2731
IF INT(S) = S THEN 2
S = N / 2741
IF INT(S) = S THEN 2
S = N / 2749
IF INT(S) = S THEN 2
IF N < 7579009 THEN 1
S = N / 2753
IF INT(S) = S THEN 2
S = N / 2767
IF INT(S) = S THEN 2
S = N / 2777
IF INT(S) = S THEN 2
S = N / 2789
IF INT(S) = S THEN 2
IF N < 7789681 THEN 1
S = N / 2791
IF INT(S) = S THEN 2
S = N / 2797
IF INT(S) = S THEN 2
S = N / 2801
IF INT(S) = S THEN 2
S = N / 2803
IF INT(S) = S THEN 2
IF N < 7946761 THEN 1
S = N / 2819
IF INT(S) = S THEN 2
S = N / 2833
IF INT(S) = S THEN 2
S = N / 2837
IF INT(S) = S THEN 2
S = N / 2843
IF INT(S) = S THEN 2
IF N < 8128201 THEN 1
S = N / 2851
IF INT(S) = S THEN 2
S = N / 2857
IF INT(S) = S THEN 2
S = N / 2861
IF INT(S) = S THEN 2
S = N / 2879
IF INT(S) = S THEN 2
IF N < 8334769 THEN 1
S = N / 2887
IF INT(S) = S THEN 2
S = N / 2897
IF INT(S) = S THEN 2
S = N / 2903
IF INT(S) = S THEN 2
S = N / 2909
IF INT(S) = S THEN 2
IF N < 8508889 THEN 1
S = N / 2917
IF INT(S) = S THEN 2
S = N / 2927
IF INT(S) = S THEN 2
S = N / 2939
IF INT(S) = S THEN 2
S = N / 2953
IF INT(S) = S THEN 2
IF N < 8743849 THEN 1
S = N / 2957
IF INT(S) = S THEN 2
S = N / 2963
IF INT(S) = S THEN 2
S = N / 2969
IF INT(S) = S THEN 2
S = N / 2971
IF INT(S) = S THEN 2
IF N < 8994001 THEN 1
S = N / 2999
IF INT(S) = S THEN 2
S = N / 3001
IF INT(S) = S THEN 2
S = N / 3011
IF INT(S) = S THEN 2
S = N / 3019
IF INT(S) = S THEN 2
IF N < 9138529 THEN 1
S = N / 3023
IF INT(S) = S THEN 2
S = N / 3037
IF INT(S) = S THEN 2
S = N / 3041
IF INT(S) = S THEN 2
S = N / 3049
IF INT(S) = S THEN 2
IF N < 9369721 THEN 1
S = N / 3061
IF INT(S) = S THEN 2
S = N / 3067
IF INT(S) = S THEN 2
S = N / 3079
IF INT(S) = S THEN 2
S = N / 3083
IF INT(S) = S THEN 2
IF N < 9541921 THEN 1
S = N / 3089
IF INT(S) = S THEN 2
S = N / 3109
IF INT(S) = S THEN 2
S = N / 3119
IF INT(S) = S THEN 2
S = N / 3121
IF INT(S) = S THEN 2
S = N / 3137
IF INT(S) = S THEN 2
IF N < 10004569 THEN 1
S = N / 3163
IF INT(S) = S THEN 2
S = N / 3167
IF INT(S) = S THEN 2
S = N / 3169
IF INT(S) = S THEN 2
S = N / 3181
IF INT(S) = S THEN 2
IF N < 10156969 THEN 1
S = N / 3187
IF INT(S) = S THEN 2
S = N / 3191
IF INT(S) = S THEN 2
S = N / 3203
IF INT(S) = S THEN 2
S = N / 3209
IF INT(S) = S THEN 2
IF N < 10349089 THEN 1
S = N / 3217
IF INT(S) = S THEN 2
S = N / 3221
IF INT(S) = S THEN 2
S = N / 3229
IF INT(S) = S THEN 2
S = N / 3251
IF INT(S) = S THEN 2
IF N < 10582009 THEN 1
S = N / 3253
IF INT(S) = S THEN 2
S = N / 3257
IF INT(S) = S THEN 2
S = N / 3259
IF INT(S) = S THEN 2
S = N / 3271
IF INT(S) = S THEN 2
IF N < 10883401 THEN 1
S = N / 3299
IF INT(S) = S THEN 2
S = N / 3301
IF INT(S) = S THEN 2
S = N / 3307
IF INT(S) = S THEN 2
S = N / 3313
IF INT(S) = S THEN 2
IF N < 11015761 THEN 1
S = N / 3319
IF INT(S) = S THEN 2
S = N / 3323
IF INT(S) = S THEN 2
S = N / 3329
IF INT(S) = S THEN 2
S = N / 3331
IF INT(S) = S THEN 2
IF N < 11175649 THEN 1
S = N / 3343
IF INT(S) = S THEN 2
S = N / 3347
IF INT(S) = S THEN 2
S = N / 3359
IF INT(S) = S THEN 2
S = N / 3361
IF INT(S) = S THEN 2
IF N < 11363641 THEN 1
S = N / 3371
IF INT(S) = S THEN 2
S = N / 3373
IF INT(S) = S THEN 2
S = N / 3389
IF INT(S) = S THEN 2
S = N / 3391
IF INT(S) = S THEN 2
IF N < 11607649 THEN 1
S = N / 3407
IF INT(S) = S THEN 2
S = N / 3413
IF INT(S) = S THEN 2
S = N / 3433
IF INT(S) = S THEN 2
S = N / 3449
IF INT(S) = S THEN 2
IF N < 11950849 THEN 1
S = N / 3457
IF INT(S) = S THEN 2
S = N / 3461
IF INT(S) = S THEN 2
S = N / 3463
IF INT(S) = S THEN 2
S = N / 3467
IF INT(S) = S THEN 2
IF N < 12033961 THEN 1
S = N / 3469
IF INT(S) = S THEN 2
S = N / 3491
IF INT(S) = S THEN 2
S = N / 3499
IF INT(S) = S THEN 2
S = N / 3511
IF INT(S) = S THEN 2
IF N < 12369289 THEN 1
S = N / 3517
IF INT(S) = S THEN 2
S = N / 3527
IF INT(S) = S THEN 2
S = N / 3529
IF INT(S) = S THEN 2
S = N / 3533
IF INT(S) = S THEN 2
IF N < 12524521 THEN 1
S = N / 3539
IF INT(S) = S THEN 2
S = N / 3541
IF INT(S) = S THEN 2
S = N / 3547
IF INT(S) = S THEN 2
S = N / 3557
IF INT(S) = S THEN 2
IF N < 12666481 THEN 1
S = N / 3559
IF INT(S) = S THEN 2
S = N / 3571
IF INT(S) = S THEN 2
S = N / 3581
IF INT(S) = S THEN 2
S = N / 3583
IF INT(S) = S THEN 2
IF N < 12909649 THEN 1
S = N / 3593
IF INT(S) = S THEN 2
S = N / 3607
IF INT(S) = S THEN 2
S = N / 3613
IF INT(S) = S THEN 2
S = N / 3617
IF INT(S) = S THEN 2
IF N < 13126129 THEN 1
S = N / 3623
IF INT(S) = S THEN 2
S = N / 3631
IF INT(S) = S THEN 2
S = N / 3637
IF INT(S) = S THEN 2
S = N / 3643
IF INT(S) = S THEN 2
IF N < 13388281 THEN 1
S = N / 3659
IF INT(S) = S THEN 2
S = N / 3671
IF INT(S) = S THEN 2
S = N / 3673
IF INT(S) = S THEN 2
S = N / 3677
IF INT(S) = S THEN 2
IF N < 13623481 THEN 1
S = N / 3691
IF INT(S) = S THEN 2
S = N / 3697
IF INT(S) = S THEN 2
S = N / 3701
IF INT(S) = S THEN 2
S = N / 3709
IF INT(S) = S THEN 2
IF N < 13830961 THEN 1
S = N / 3719
IF INT(S) = S THEN 2
S = N / 3727
IF INT(S) = S THEN 2
S = N / 3733
IF INT(S) = S THEN 2
S = N / 3739
IF INT(S) = S THEN 2
IF N < 14145121 THEN 1
S = N / 3761
IF INT(S) = S THEN 2
S = N / 3767
IF INT(S) = S THEN 2
S = N / 3769
IF INT(S) = S THEN 2
S = N / 3779
IF INT(S) = S THEN 2
IF N < 14386849 THEN 1
S = N / 3793
IF INT(S) = S THEN 2
S = N / 3797
IF INT(S) = S THEN 2
S = N / 3803
IF INT(S) = S THEN 2
S = N / 3821
IF INT(S) = S THEN 2
IF N < 14615329 THEN 1
S = N / 3823
IF INT(S) = S THEN 2
S = N / 3833
IF INT(S) = S THEN 2
S = N / 3847
IF INT(S) = S THEN 2
S = N / 3851
IF INT(S) = S THEN 2
IF N < 14845609 THEN 1
S = N / 3853
IF INT(S) = S THEN 2
S = N / 3863
IF INT(S) = S THEN 2
S = N / 3877
IF INT(S) = S THEN 2
S = N / 3881
IF INT(S) = S THEN 2
IF N < 15124321 THEN 1
S = N / 3889
IF INT(S) = S THEN 2
S = N / 3907
IF INT(S) = S THEN 2
S = N / 3911
IF INT(S) = S THEN 2
S = N / 3917
IF INT(S) = S THEN 2
IF N < 15358561 THEN 1
S = N / 3919
IF INT(S) = S THEN 2
S = N / 3923
IF INT(S) = S THEN 2
S = N / 3929
IF INT(S) = S THEN 2
S = N / 3931
IF INT(S) = S THEN 2
IF N < 15547249 THEN 1
S = N / 3943
IF INT(S) = S THEN 2
S = N / 3947
IF INT(S) = S THEN 2
S = N / 3967
IF INT(S) = S THEN 2
S = N / 3989
IF INT(S) = S THEN 2
IF N < 16008001 THEN 1
S = N / 4001
IF INT(S) = S THEN 2
S = N / 4003
IF INT(S) = S THEN 2
S = N / 4007
IF INT(S) = S THEN 2
S = N / 4013
IF INT(S) = S THEN 2
IF N < 16152361 THEN 1
S = N / 4019
IF INT(S) = S THEN 2
S = N / 4021
IF INT(S) = S THEN 2
S = N / 4027
IF INT(S) = S THEN 2
S = N / 4049
IF INT(S) = S THEN 2
IF N < 16410601 THEN 1
S = N / 4051
IF INT(S) = S THEN 2
S = N / 4057
IF INT(S) = S THEN 2
S = N / 4073
IF INT(S) = S THEN 2
S = N / 4079
IF INT(S) = S THEN 2
IF N < 16736281 THEN 1
S = N / 4091
IF INT(S) = S THEN 2
S = N / 4093
IF INT(S) = S THEN 2
S = N / 4099
IF INT(S) = S THEN 2
IF N < 16900321 THEN 1
JK = SQR(N)
H = 4111
626 M = N / H
IF M = INT(M) THEN 2
H = H + 4
IF H > JK THEN 1
M = N / H
IF M = INT(M) THEN 2
H = H + 2
GOTO 626
2 IF (N - 1) / 3 = INT((N - 1) / 3) THEN N = N + 2
NEXT N
130 C = TIMER
PRINT
PRINT
IF i = 0 THEN PRINT "Es wurde keine Primzahl gefunden!"
IF i = 0 THEN PRINT "Die Berechnung dauerte"; (C - B) - (ooo - sss) - (oop - sst) - (ooq - ssu) - (aaab - aaaa); "Sekunden!"
IF i = 0 THEN 6
IF i = 1 THEN PRINT "Es wurde 1 Primzahl gefunden!"
IF i = 1 THEN 5
PRINT "Es wurden"; i; "Primzahlen gefunden!"
5 IF C - B = 0 THEN PRINT "Die Berechnung dauerte 0 Sekunden!"
IF C - B = 0 THEN 6
IF i = 1 THEN PRINT "Die Berechnung dauerte"; (C - B) - ((ooo - sss) + (oop - sst) + (ooq - ssu) + (aaab - aaaa)); "Sekunden!"
IF i = 1 THEN 6
PRINT "Die Berechnung dauerte"; (C - B) - ((ooo - sss) + (oop - sst) + (ooq - ssu) + (aaab - aaaa)); "Sekunden! Dies entspricht einer"
PRINT "durchschnittlichen Berechnungszeit pro Primzahl von"; ((C - B) - (ooo - sss) - (oop - sst) - (ooq - ssu) - (aaab - aaaa)) / i; "Sekunden!"
6 SOUND 1000, 5
11 PRINT "Wollen Sie noch eine Berechnung durchfhren? (J oder N)"
x$ = INPUT$(1)
IF x$ = "J" THEN 10
IF x$ = "j" THEN 10
IF x$ = "N" THEN END
IF x$ = "n" THEN END
IF x$ <> "J,j,N,n" THEN 11
KEY(15) OFF
END
1 i = i + 1
PRINT N;
GOTO 2
100 www = www + 1
IF www = 1 THEN sss = TIMER
IF www = 2 THEN sst = TIMER
IF www = 3 THEN ssu = TIMER
PRINT
PRINT
105 PRINT "Wollen Sie die Berechnung wirklich abbrechen? (J oder N)"
PRINT "(Endwert="; E; ")(Derzeitig in Prfung"; N; ")"
z$ = INPUT$(1)
IF z$ = "J" THEN 110
IF z$ = "j" THEN 110
IF z$ = "N" THEN 120
IF z$ = "n" THEN 120
IF z$ <> "N,n,J,j" THEN 105
110 IF www = 1 THEN ooo = TIMER
IF www = 2 THEN oop = TIMER
IF www = 3 THEN ooq = TIMER
GOTO 130
120 IF www = 1 THEN ooo = TIMER
IF www = 2 THEN oop = TIMER
IF www = 3 THEN ooq = TIMER
PRINT
RETURN
320 PRINT
PRINT "Sind Sie sicher das Sie aus"; INT(E) - INT(A) + 1; "Zahlen die Primzahlen berechnen wollen!"
PRINT "(J,N oder A[Abbrechen])"
z$ = INPUT$(1)
IF z$ = "J" THEN 400
IF z$ = "j" THEN 400
IF z$ = "N" THEN 10
IF z$ = "n" THEN 10
IF z$ = "A" THEN END
IF z$ = "a" THEN END
IF z$ <> "A,a,J,j,N,n" THEN CLS
IF z$ <> "A,a,J,j,N,n" THEN 320
400 PRINT
PRINT "Sie k”nnen die Berechnung jederzeit mit ESC Abbrechen!"
PRINT
B = TIMER
FOR N = INT(A) TO 2
PRINT N;
NEXT N
i = i + 1
A = A + 1
GOTO 310
330 PRINT
PRINT "Sind Sie sicher das Sie aus"; INT(E) - INT(A) + 1; "Zahlen die Primzahlen berechnen wollen!"
PRINT "(J,N oder A[Abbrechen])"
z$ = INPUT$(1)
IF z$ = "J" THEN 600
IF z$ = "j" THEN 600
IF z$ = "N" THEN 10
IF z$ = "n" THEN 10
IF z$ = "A" THEN END
IF z$ = "a" THEN END
IF z$ <> "A,a,J,j,N,n" THEN CLS
IF z$ <> "A,a,J,j,N,n" THEN 330
600 PRINT
PRINT "Sie k”nnen die Berechnung jederzeit mit ESC Abbrechen!"
PRINT
B = TIMER
FOR N = INT(A) TO INT(E)
PRINT N;
NEXT N
i = i + 1
GOTO 130