Surely not the most compact entry, but this one handles large inputs: #include <String.au3> #include "..\Include\BigNum.au3" Local $Inp, $bComposite While 1 $Inp = InputBox("Prime challenge", "Enter a positive number", "0") If @error Then ExitLoop $Inp = StringRegExpReplace($Inp, "^(-?)0*(\d+)$", "$1$2") If StringLeft($Inp, 1) <> '-' Then If StringLen($Inp) < 5 Then $Inp = Int($Inp) $bComposite = StringRegExp(_StringRepeat('1', $Inp), '^1?$|^(11+?)\1+$') Else $b