The less period of "1/b"

30 Views Asked by At

Which is the less "b" natural number, for which the less period of "1/b" is 7?

I have already tried this way:

I have the following formula: 10^i ≡ 1 (mod b), where "i" is the less period of "1/b". So I replaced this "i" with 7 (b | 10^7 - 1), and calculated the unknown "b" this way. The solution for "b" would be 239, but I got this only for the fourth time with the above formula. Can you please help me with an another, faster algorithm to calculate this "b"?

Thanks in advance!