F# code to check whether there are three same digits within a given number
Followed upon @hocho's comment and agree that using groupBy is much better as it can generalise the solution to check any number of same digit rather than limited to just 3 from my initial implementation. I have also simplified the helper method which converts a number into a collection; returning a sequence is enough as there is no need to return an array.

let convertNumberToSeq (number: bigint) = 
        let numberString = string number
        numberString.ToCharArray() 
        |&gt; Seq.map (string &gt;&gt; int)

///&lt;summary&gt;
/// Check whether a given number has at least n same digits
///&lt;/summary&gt;
///&lt;param name="number"&gt;The given number&lt;/param&gt;
///&lt;param name="n"&gt;How many same digits to be checked&lt;/param&gt;
///&lt;returns&gt;
///True if there are n same digits otherwise False
///&lt;/returns&gt;
let SameDigitCheck (number : bigint) (n : int) = 
    if n &lt; 2 then failwith "n must be at least 2"
    let digits = convertNumberToSeq number
    let q = query { for digit in digits do groupBy digit into g; select g }
    q |&gt; Seq.exists (fun x -&gt; Seq.length x &gt;= n)