Erdős-primes: Difference between revisions
m
→{{header|Tiny BASIC}}: The variable E is not used. Removed line with E = ...
(→{{header|Tiny BASIC}}: Simplified and corrected. K! is calculated from (K - 1)!, not from the beginning. Now, there are displayed all 25 Erdős primes smaller than 2500 (previously, only 22).) |
m (→{{header|Tiny BASIC}}: The variable E is not used. Removed line with E = ...) |
||
Line 287:
Can't manage the stretch goal because integers are limited to signed 16 bit.
{{works with|TinyBasic}}
<syntaxhighlight lang="basic">10 REM Erdős-primes
20 LET P = 1
Line 302:
130 LET F = F * K
140 LET Z = P - F
150 IF Z < 0 THEN GOTO
160 GOSUB 1000
170 IF A = 1 THEN
180
190
200
210 IF P
▲230 GOTO 40
990 REM primality of Z by trial division, result is in A
1000 LET Y = 1
|