John D. Cook 6/27/2026

When will the decimals in a/b repeat?

Read Original

This article investigates the repeating decimal patterns in fractions derived from harmonic numbers. It provides Python code using SymPy to compute the period length of the decimal expansion of 1/lcm(1..n), determining both non-repeating and repeating digit segments. The example shows that for n=50, there are 5 non-repeating digits followed by 1,275,120 repeating digits. The content is technical, focusing on number theory, algorithms, and programming, making it relevant to IT/technology.

When will the decimals in a/b repeat?

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet