Partition function P: Difference between revisions
Content added Content deleted
m (→{{header|jq}}: indentation) |
m (→version 3: standardized capitalization.) |
||
Line 1,112: | Line 1,112: | ||
This REXX version is about '''90%''' faster than REXX version 1. |
This REXX version is about '''90%''' faster than REXX version 1. |
||
The biggest part of the improvement was using memoization of the expressions ('''k+k+k - 1) * k % 2''' for all values of (positive) ''' |
The biggest part of the improvement was using memoization of the expressions ('''k+k+k - 1) * k % 2''' for all values of (positive) '''k''' up to '''hi'''. |
||
<lang rexx>/*REXX program calculates and displays a specific value (or a range of) partitionsP(N).*/ |
<lang rexx>/*REXX program calculates and displays a specific value (or a range of) partitionsP(N).*/ |
||
numeric digits 1000 /*able to handle some ginormous numbers*/ |
numeric digits 1000 /*able to handle some ginormous numbers*/ |