10-22-2016, 04:28 PM
For positive integer input N the programme returns the Nth element of the series of factors of the Natural Numbers.
For info on the series see
https://oeis.org/A027750
The time characteristic of the programme is linear on the input.
For info on the series see
https://oeis.org/A027750
The time characteristic of the programme is linear on the input.
Code:
::
CK1&Dispatch
BINT1
::
" NTH FACTOR OF NATURAL SEQUENCE"
DispCoord1
SetDA3Temp
COERCE
ZEROZERO
BEGIN
SWAP#1+SWAP
OVER
FPTR2 ^#>Z
FPTR2 ^DIVISext
DUPLENCOMP
ROT#+
DUPUNROT
5PICK
#<
WHILE
DROP
REPEAT
'
Z<
FPTR2 ^SortList
ROTDROPSWAP
ROT
#1--
NTHCOMPDROP
;
;