RosettaCodeData/Task/Tau-number/PureBasic/tau-number.basic

21 lines
421 B
Plaintext

OpenConsole()
Procedure.i numdiv(n)
c=2
For i=2 To (n+1)/2 : If n%i=0 : c+1 : EndIf : Next
ProcedureReturn c
EndProcedure
Procedure.b istau(n)
If n=1 : ProcedureReturn #True : EndIf
If n%numdiv(n)=0 : ProcedureReturn #True : Else : ProcedureReturn #False : EndIf
EndProcedure
c=0 : i=1
While c<100
If istau(i) : Print(RSet(Str(i),4)+#TAB$) : c+1 : If c%10=0 : PrintN("") : EndIf: EndIf
i+1
Wend
Input()