Message Boards Message Boards

0
|
3455 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

What is the best way to find periodic digit groups in a decimal expression?

Posted 10 years ago

For example, 1/3 is fairly easy as 3 repeats from the first decimal point. But suppose the number is 12.345678678678678... How can one efficiently ask Mathematica to return {6,7,8} in such a case?

POSTED BY: Harvey Dale
2 Replies
Posted 10 years ago

Just a slight modification to ilian's post, if all you wanted was the repeating digits

Last[First[RealDigits[4111111/333000]]]

Paul.

POSTED BY: Paul Cleary

See http://reference.wolfram.com/language/ref/RealDigits.html

In[2]:= RealDigits[4111111/333000]

Out[2]= {{1, 2, 3, 4, 5, {6, 7, 8}}, 2}
POSTED BY: Ilian Gachevski
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract