Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Babbage-problem/BBC-BASIC/babbage-problem-1.basic
Normal file
17
Task/Babbage-problem/BBC-BASIC/babbage-problem-1.basic
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
REM Statements beginning 'REM' are explanatory remarks: the machine will ignore them.
|
||||
|
||||
REM We shall test positive integers from 1 upwards until we find one whose square ends in 269,696.
|
||||
|
||||
REM A number that ends in 269,696 is one that leaves a remainder of 269,696 when divided by a million.
|
||||
|
||||
REM So we are looking for a value of n that satisfies the condition 'n squared modulo 1,000,000 = 269,696', or 'n^2 MOD 1000000 = 269696' in the notation that the machine can accept.
|
||||
|
||||
LET n = 0
|
||||
|
||||
REPEAT
|
||||
LET n = n + 1
|
||||
UNTIL n^2 MOD 1000000 = 269696
|
||||
|
||||
PRINT "The smallest number whose square ends in 269696 is" n
|
||||
|
||||
PRINT "Its square is" n^2
|
||||
Loading…
Add table
Add a link
Reference in a new issue