2 pmodm127 - calculate q mod 2^(2^127-1)
14 This custom function will return the value:
18 This custom function serves as a demonstration of how to write
19 a custom function. It performs the equivalent of:
23 The return value is integer in the half open range: [0, q).
27 Can you find a value, q, for which this custom function returns 1?
28 If you do, send the value of q to chongo using the EMail address
31 http://www.isthe.com/chongo/address.html
34 > custom("pmodm127", 65537)
37 > custom("pmodm127", 2^31-1)
40 > custom("pmodm127", 7^51+2)
41 11228202966269457258557496419097462731193173
44 calc must be built with ALLOW_CUSTOM= -DCUSTOM
45 calc must be executed with a -C arg.
46 q must be an integer > 0
54 ## Copyright (C) 2004 Landon Curt Noll
56 ## Calc is open software; you can redistribute it and/or modify it under
57 ## the terms of the version 2.1 of the GNU Lesser General Public License
58 ## as published by the Free Software Foundation.
60 ## Calc is distributed in the hope that it will be useful, but WITHOUT
61 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
62 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
63 ## Public License for more details.
65 ## A copy of version 2.1 of the GNU Lesser General Public License is
66 ## distributed with calc under the filename COPYING-LGPL. You should have
67 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
68 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
70 ## @(#) $Revision: 30.1 $
71 ## @(#) $Id: pmodm127,v 30.1 2007/03/16 11:10:04 chongo Exp $
72 ## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/pmodm127,v $
74 ## Under source code control: 2004/02/25 07:13:15
75 ## File existed as early as: 2004
77 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
78 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/