Post Reply 
(49g 50g) Ramanujan Tau Function
11-02-2018, 04:02 PM
Post: #4
RE: (49g 50g) Ramanujan Tau Function
Here's my shortest & fastest effort at a stand alone programme, only good for input up to 1,048,575 but that's no great handicap as the programme is slow, taking 9 sec to process input 100 & 18 sec for input 200, the time characteristic being linear on the input.

Size: 350.0000

CkSum: # 59690d

Code:
::
  CK1&Dispatch
  # FF
  ::
    DUP
    ZINT 2
    Z<
    ?SEMI
    DUPDUP
    FPTR2 ^QMul
    '
    ::
      FPTR2 ^DupZIsOne?
      ?SEMI
      FPTR2 ^MZSQFF
      #2/
      ZINT 1
      SWAP
      ZERO_DO
      3PICK
      ROT
      COERCE
      #1+
      FPTR2 ^PPow#
      ZINT 1
      FPTR2 ^QSub
      ROT
      ZINT 1
      FPTR2 ^QSub
      FPTR2 ^ZQUOText
      FPTR2 ^QMul
      LOOP
    ;
    '
    NULLLAM
    BINT3
    NDUPN
    DOBIND
    ZINT 0
    3GETLAM
    FPTR2 ^Z2BIN
    ONE_DO
    INDEX@
    FPTR2 ^#>Z
    DUPDUP
    ZINT 35
    FPTR2 ^QMul
    ZINT 52
    3GETLAM
    FPTR2 ^QMul
    FPTR2 ^QSub
    OVER
    FPTR2 ^QMul
    ZINT 18
    2GETLAM
    FPTR2 ^QMul
    FPTR2 ^QAdd
    FPTR2 ^QMul
    FPTR2 ^QMul
    3GETLAM
    INDEX@
    FPTR2 ^#>Z
    DUP
    1GETLAM
    EVAL
    3UNROLL
    FPTR2 ^QSub
    1GETLAM
    EVAL
    FPTR2 ^QMul
    FPTR2 ^QMul
    FPTR2 ^QAdd
    LOOP
    ZINT 24
    FPTR2 ^QMul
    3GETLAM
    DUP
    1GETLAM
    EVAL
    SWAP
    BINT4
    FPTR2 ^RP#
    FPTR2 ^QMul
    SWAP
    FPTR2 ^QSub
    ABND
  ;
;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (49g 50g) Ramanujan Tau Function - Gerald H - 11-02-2018 04:02 PM



User(s) browsing this thread: 1 Guest(s)