EasyManua.ls Logo

Casio fx9750GII - PROGRAMMING Examples (Continued); Programming Examples: Number Theory

Casio fx9750GII
87 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
PROGRAMMING
Example 3
‘Factors of Numbers’, is a
program that nds all factors of
any input number, checks whether
it is prime, and / or a perfect
number and counts the number
of factors.
A program that can stimulate a
project on ‘Special Numbers’, for
example.
The calculator executes about
550 calculations a minute. Try
checking some of those 2
n
-1
primes!
Refer to the ‘Programme Mode
Command List’ for entering and
editing the program. (See index
for page reference)
“FACTOR OF NUMBERS”
Lbl 0
?A
0Z
0K
0N
Lbl 1
0B
0C
0D
K+1K
Int (A÷K)B
A÷KC
B-CD
D=0K
D=0N+1N
D=0B+ZZ
A=KGoto 2
Goto 1
Lbl 2
“INPUT NUMBER”
A
“PERFECT NUMBER CHECK”
Z
“”
N=2Goto 3
Z=2xA”THE INPUT NUMBER
IS A
PERFECT NUMBER”
“”
“THERE ARE”
N
“FACTORS”
“ALL FACTORS ARE NOW
FOUND”
“”
“PLEASE TRY AGAIN”
Goto 0
Lbl 3
“THE INPUT NUMBER IS A
PRIME NUMBER”
Example 4
The ‘Mendelbrot’ is a well-known use of imaginary numbers, named after its discoverer, the US
mathematician Benoit Mendelbrot. The program draws part of the Mendelbrot Set.
‘Zooming In’ on a specic part of the Mendelbrot Set can be done by editing the Viewing Window in the
rst 4 lines of the program.
The set is related to the complex function f(z)=z
2
+ c, with c being a constant. Many ‘spikes’ are evident
around the boundaries and are very similar to each other, that is, they are smaller versions of the larger
ones The program requires a lot of calculations to be made, as the screen is set to 127x63x30. That is,
about ¼ million calculations in total.
Try the View Window at:
(a) -1.5 < x < -1.1 and
-0.1 < y < 0.1
(b) -0.8 < x < -0.4 and
0.5 < y < 0.7 for example
Refer to the ‘Programme Mode
Command List’ for entering and
editing the program. (See index
for page reference)
“MENDELBROT”
-2Xmin
0.5Xmax
-1Ymin
1Ymax
(Ymax-Ymin)÷62V
(Xmax-Xmin)÷126H
XminX
YminY
While X<Xmax+H
While Y<Ymax+V
X+iYZ
0N
ZC
While Abs Z<2 And N<30
Z
2
+CZ
N+1N
WhileEnd
If N>29
Then Plot X, Y
IfEnd
Y+VY
WhileEnd
YminY
X+HX
WhileEnd
Stop

Related product manuals