Payam Number

Author

Eric W. Weisstein
June 11, 2003

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Numbers/PayamNumber.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/PayamNumber.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Listing

From http://home.btclick.com/rwsmith/pp/payam3.htm

str="    2            3                3
    3            9                3
    4            15                45
    5-9            105                45
    10            165                2145
    11            165                2805
    12-17        75075            92235
    18-19        855855            529815
    20-22        5583435            529815
    23-25        18625035        529815
    26-27        18625035        1426425
    28-34        27183585        247016055
    35            1684200375        247016055
    36            1684200375        74297465385
    37-38        1684200375        77271113205
    39-49        198840832905    191844014505
    50            305892154425    191844014505
    51-66        532326689895    246419198025
    67            139592518105755    169680848811045";

l=ReadList[StringToStream[str],{Word,Number,Number},RecordSeparators->{" "}]

p1=Flatten[{If[(n=ToExpression[First[#]])<0,Table[#[[2]],{1-n}],#[[2]]]}&/@l]

p2=Flatten[{If[(n=ToExpression[First[#]])<0,Table[#[[3]],{1-n}],#[[3]]]}&/@l]