maths script -- 5

Job ID: 33158367

Budget: $30 – $250 USD

hi u can use python or php or whatever u think is best
i need a maths script
we have an input rule and then output
the output will be truncated to a string length we wish e.g 2 digits
then i want to produce a flow diagram
e.g input rules if number even divide by 2. if odd add 1 and divide by 2.
now suppose we work in 2 digits (modulo 100) we have
example: 57 > 58/2 = 29 or 79.
the reason for 2 answers is we treat the 58 as xxxxxxx58 with infinitely long left tail so any digits could be there. and when u divide a number ending in 58 by 2 u get 29 or 79 as the new 2 digit ending.
we then repeat for both 29 and 79.
29 goes to (30)/2 = 15 or 65, and 79 goes to (80)/2 = 40 or 90
and we keep repeating untill all possibilites covered then i want to construct a flow diagram of the starting input and the possible future outputs, (there is only 100 possible 2 digit outputs) so eventually we will get repeats and end up back where we started.
so i can set the even rule, the odd rule, the output length, the range e.g compute for range A to B e.g 00 to 99

output on screen and format of circles around each number and lines and arrows between input and output
No time wasters
Related categories: PHP JavaScript Python Software Architecture Mathematics