HP Forums
(49G) Series Factors of Natural Numbers, OEIS A027750 - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (49G) Series Factors of Natural Numbers, OEIS A027750 (/thread-7088.html)



(49G) Series Factors of Natural Numbers, OEIS A027750 - Gerald H - 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.

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
  ;
;