Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/M-bius-function/Minimal-BASIC/m-bius-function.basic
Normal file
24
Task/M-bius-function/Minimal-BASIC/m-bius-function.basic
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
10 REM Moebius function
|
||||
20 FOR T = 0 TO 9
|
||||
30 FOR U = 1 TO 10
|
||||
40 LET N = 10*T+U
|
||||
50 GOSUB 110
|
||||
60 PRINT M;" ";
|
||||
70 NEXT U
|
||||
80 PRINT
|
||||
90 NEXT T
|
||||
100 END
|
||||
|
||||
110 LET M = 1
|
||||
120 IF N = 1 THEN 230
|
||||
130 LET F = 2
|
||||
140 LET F2 = F*F
|
||||
150 IF INT(N/F2)*F2 <> N THEN 180
|
||||
160 LET M = 0
|
||||
170 GOTO 230
|
||||
180 IF INT(N/F)*F <> N THEN 210
|
||||
190 LET M = -M
|
||||
200 LET N = N/F
|
||||
210 LET F = F+1
|
||||
220 IF F <= N THEN 140
|
||||
230 RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue