Page 1 sur 1

algorithm to detect the period of a decimal number

Publié : sam. août 31, 2019 10:21 pm
par compsystems
Hello bp

Do you know an algorithm to detect the period of a decimal number?
1/1 = 1
1/2 = 0.5
1/3 = 0.33333333... = 0.③
1/4 = 0.25
1/5 = 0.2
1/6 = 0.166666666... = 0.1⑥
1/7 = 0.142857142857142857... = 0.①④②⑧⑤⑦
1/8 = 0.125
1/9 = 0.11111111... = 0.①
1/10 = 0.1
1/11 = 0.0909090909... = 0.ⓞ⑨
1/12 = 0.0833333333... = 0.08③
1/13 = 0.076923076923076923... = 0.ⓞ⑦⑥⑨②③
1/14 = 0.0714285714285714285... =0.0⑦①④②⑧⑤
1/15 = 0.066666666... =0.0⑥
1/16 = 0.0625
1/17 = 0.05882352941176470588235294117647... = 0.052631578947368421
1/18 = 0.055555555... = 0.0⑤
1/19 = 0.052631578947368421052631578947368421... = 0.052631578947368421
1/20 = 0.05
1/21 = 0.047619047619047619.. = 0.ⓞ④⑦⑥①⑨
1/22 = 0.04545454545... = 0.ⓞ④⑤
1/23 = 0.0434782608695652173913043478260869565... = 0. 0434782608695652173913
1/24 = 0.04166666666... = 0.041⑥
1/25 = 0.04
1/26 = 0.0384615384615384615... = 0.0③⑧④⑥⑤
1/27 = 0.037037037037... = 0.ⓞ③⑦
1/28 = 0.03571428571428571428... = 0.03571428
1/29 = 0.03448275862068965517241379310344827586... = 0.0344827586206896551724137931
1/30 = 0.033333333... = 0.0③
1/31 = 0.032258064516129032258064516129...
1/32 = 0.03125
1/33 = 0.0303030303... = 0.ⓞ③
1/34 = 0.029411764705882352941176470588235... = 0.02941176470588235
1/35 = 0.0285714285714285714... = 0.0285714
1/36 = 0.0277777777... = 0.02⑦