John Grieve: Number Theory Game    
 Number Theory Game12 comments
14 Jun 2010 @ 06:17, by John Grieve

Number Theory Game/ Chaos Theory Game/ trivial or Deep?

In Chaos theory we get interesting results when you re-iterate something that does not give a Straight-line(linear) result. Here is a game which I have just invented, which those of you who like playing with calculators may enjoy.

Start with a number, let's say 2. Find the nth root of it, let's say the square root, which in this case is 1.41421. I am deliberately taking the first 5 decimal places though it could be any number of places, as long as you stick with the same number. Reverse those 5 decimal digits and REPEAT that is RE-ITERATE. When you reverse 1.41421 you get 1.12414 and when you take the square root of this number you get 1.06025. This number reversed becomes 1.52060. And so on

It is evident that this process could terminate if we arrive at a palindromic decimal number, or if any previous number is repeated in which case an endless loop is created.

Trivial or Deep ? I look forward to your comments and discoveries.

[< Back] [John Grieve]



14 Jun 2010 @ 07:11 by swanny @ : Average
I wonder if there would be an average that one might reach but I suppose that would depend on how many times it was done, but say do it 100 times what would the average be for that process done 100 times? Just curious.  

14 Jun 2010 @ 08:31 by johnjoseph : Averages
As you may know, averages are important in linear and non-linear maths and dynamics,but to do it a significant number of times you would have to give up the calculator and program it.To help do this there is an interesting Applesoft Emulator at  

14 Jun 2010 @ 11:15 by johnjoseph : moving averages
hi ed,here's something on averages. The more relevant non-linear moving average (NMA) is not easy to find on the web:
Incidentally i used to have an apple ii plus and programme in 6502 machine language and Assembler.Anyone interested in writing fast number theory programs might find this interesting:  

14 Jun 2010 @ 20:30 by johnjoseph : Programme for calculating averages
I've just written an APPLESOFT BASIC programme which can calculate the averages mentioned earlier. I will Copy and Paste it into a comment, when less tired ,and if you do the same into the Emulator you will see the results generated.

14 Jun 2010 @ 20:54 by swanny @ : wow
wow thanks john and that was fast,
yea take a break you deserve it
I myself can't do programing except maybe a little HTML
which doesn't count so thanks again
be curious to see the results of a 100x sample


15 Jun 2010 @ 06:24 by johnjoseph : Chaos Game: Averages Programme
Hi Ed,here's the program i mentioned. The emulator is slower than a real APPLE but it gets there in the end. I'm not sure if this is non-linear etc. and also the Average may be non-linear but I'll leave that to someone more expert than me in Statistics.

5 REM Number Theory Game
6 REM Average of 100 Tries
15 DIM M$(9):X=2:D=100:CO=0:N=0
20 GOSUB 600

45 PRINT "The Value of N is ";N: PRINT "The Average is ";CO/D


400 X2 = SQR(X)
410 X2$ = STR$(X2)
450 STOP

500 REM Reverse Character
502 PRINT TAB(10) X2$
505 X2=0
510 FOR Y= 6 TO 0 STEP -1
515 M$(Y+1)= MID$((X2$),ABS(Y-7),1)
517 NEXT Y
519 P$=""
521 M$(0)="1.":P$=M$(0)
522 FOR T= 1 TO 6: P$=P$+M$(T):PRINTP$:NEXT T

540 X2=VAL(P$):P$ = ""
542 X=X2:GOSUB 400
555 STOP

610 REM
612 IF N=0 THEN GOSUB 400
615 CO=CO+X2
630 REM
645 GOSUB 500
647 N=N+1
646 P$=""
660 GOTO 615  

15 Jun 2010 @ 06:47 by swanny @ : hmmm
hmmmmm when I try to run the program it doesn't seem to come up with the 100 th time and just goes to 99 and gives me this error message
" Syntax error: Expected: ')', saw [NUMBER: 5 ], line: 45 "
and then my firewall program (clam win) kicked in and started downloading some software files?
whats going on ? hmmm its got me stumped...


15 Jun 2010 @ 07:28 by johnjoseph : Sorry technical problem
It should run alright now, I was trying to get a better display at the end but now you will need to scroll to the bottom when the program finishes, to see the results

15 Jun 2010 @ 08:09 by swanny @ : great
great it worked thanks and youre not to bad at this
for the 100th run I got an average of 1.21443593
which is a finite number any way
I'm going to run it again an see if I get the same number
the second time too.
hmmm yes why would it give the same number each time you run it?
the second time it gave the same number
but I wonder if thats normal or not
I get an error or note at the end of
" Break, line: 50 "
what would you need to change in the program to get it to run 200 times
but good work none the less


15 Jun 2010 @ 08:31 by johnjoseph : Averages in longer runs
Hi,to get a longer run change the value of the variable D in line 15, e.g. to 200. But it is worth noting that the emulator slows down the longer it runs. I may write a version of this programme for 6502 Assembler when it would be possible to do very long runs reasonably quickly  

15 Jun 2010 @ 09:26 by swanny @ : Lower Number
thanks again john and youre up late to I see
running it 200 times gives a different lower number
ie 1.21076837 im just going to run it twice thus to see
if its the same each time.
yes apparently and now thus I wonder if the trend is the more times you run
will the average go lower or higher or is there a correlation, trend or is it random. hmm running it 300 times gave ie 1.2125513 higher than 200 times but not as high as 100 times

100 times = 1.21443593
200 times = 1.21076837
300 times = 1.2125513
400 times = 1.21108105

okay so but what the initial or root number we're squaring
it gives us an average of 1.21 and
1.21 x 1.21 = 1.4641
well anyway

carry on


6 Jul 2016 @ 03:27 by king king @ : king  

Your Name:
Your URL: (or email)
For verification, please type the word you see on the left:

Other entries in
26 Feb 2017 @ 20:56: Trump versus the Media
26 Jan 2017 @ 18:53: Women's Marches the beginning of the Fightback
7 Jan 2017 @ 20:11: Now's the End Times
15 Nov 2016 @ 22:48: Theory of Civilization-- Part 3
15 Nov 2016 @ 22:20: Theory of Civilization-- Part 2
15 Nov 2016 @ 21:52: Theory of Civilization-- Part 1
14 Nov 2016 @ 22:11: Global march of the right in the context of the dynamics of civilization
12 May 2016 @ 21:47: SuperCivilization, The Second Axial Age and not-so-enlightened Despots Cont.
12 May 2016 @ 21:20: SuperCivilization, The Second Axial Age and not-so-enlightened Despots
28 Feb 2016 @ 18:55: Economic Evolution

[< Back] [John Grieve] [PermaLink]?