Skip to main content
1 of 3
Xwtek
  • 2k
  • 11
  • 28

Haskell, 57 bytes

import Data.List
(==[[]]).intersect<*>map(\a->a++a).tails

True for irrational number, False for rational number

I used a different algorithm for this program. This program returns true if the sequence ends with two identical sequence next to each other. For example, this program returns true for [1,2,3,4,3,4] because it ends with [3,4,3,4], which is [3,4] repeated twice.

For rational number, it's obvious that this will return false for large enough string, because rational number always ends with repeating string of digits. However, I don't know if this program still works for irrational number,

Xwtek
  • 2k
  • 11
  • 28