diff --git a/expreduce/builtin_numbertheory.go b/expreduce/builtin_numbertheory.go index d9fc98d..d6ed983 100644 --- a/expreduce/builtin_numbertheory.go +++ b/expreduce/builtin_numbertheory.go @@ -149,5 +149,7 @@ func GetNumberTheoryDefinitions() (defs []Definition) { defs = append(defs, Definition{Name: "FactorInteger"}) defs = append(defs, Definition{Name: "FractionalPart"}) defs = append(defs, Definition{Name: "IntegerPart"}) + defs = append(defs, Definition{Name: "PowerMod"}) + defs = append(defs, Definition{Name: "EulerPhi"}) return } diff --git a/expreduce/resources.go b/expreduce/resources.go index 791a1ec..b696413 100644 --- a/expreduce/resources.go +++ b/expreduce/resources.go @@ -383,7 +383,7 @@ func resourcesMatrixM() (*asset, error) { return a, nil } -var _resourcesNumbertheoryM = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xa4\x58\xff\x6f\xdb\xba\x11\xff\x3d\x7f\xc5\xad\x03\xb6\xc4\x93\x6d\x7d\x89\xd3\x26\x41\xf6\x56\xb4\xcd\xd0\xed\xbd\xd7\x74\x2f\xc0\x7e\x30\x84\x84\xb6\x98\x44\xa8\x4c\x05\x92\x9c\x34\x30\xfc\xbf\xef\x8e\x94\x64\x51\xd6\xc9\x36\x56\xa0\xb1\x44\x7e\xee\x74\xfc\xdc\x1d\xef\xc8\x9b\x2c\x5e\xc8\xef\x17\x17\xcb\x5c\x3c\x4a\xb8\x82\x77\xf7\x66\x64\xaa\xc2\x7b\xc8\x64\xb1\xcc\x54\x0e\xb7\xd9\x52\x42\xfc\x00\xf7\xea\x1e\xe2\x1c\x9e\x09\xe1\xc0\xb5\x48\x72\x09\x69\xf1\x24\xb3\xd7\x38\x97\xa3\x77\x97\x47\x1f\x8b\x22\x8b\x67\xcb\x42\xe6\x53\xa3\x26\x44\x95\xab\x5f\xe3\xbc\x10\xb3\x04\x45\x6e\xb2\xb4\x90\xf3\x42\x46\xeb\xcb\xa3\x5b\x99\x17\x79\xf9\x35\x42\x1d\x01\xfe\xfb\xf2\x47\xbc\x78\x4e\xe4\x97\x9f\x82\x7e\xf2\xa9\x1e\x34\x13\x62\x21\x49\x64\x4a\xc6\x90\x26\x6d\xe5\x24\x0c\x9d\x0e\x8c\x36\xad\x06\x79\xae\xdb\x0d\xb3\x54\x9d\x7f\xf0\x4f\x27\xde\xd9\x24\xd8\x03\x3b\xf4\xc3\x50\x63\x42\x07\xbe\x5c\x2f\x33\xe2\xa0\xc3\xe6\x4f\xe9\x62\x21\x55\x31\xad\x48\xbd\x87\x54\x25\x6f\xf0\x9a\x66\x3f\x72\x78\x48\x33\xf8\xaa\x0a\xf9\x28\xb3\xfc\xe2\xdd\x1e\xcb\x98\x8c\x1a\x1f\xd5\xec\x75\xd1\x63\xcb\x30\x0b\x6f\xf1\xb3\x0f\x68\xb8\x17\xca\x1d\x4d\x2a\x23\x8f\xd0\xc7\x47\xff\xfc\xf4\xb9\x19\x5b\xf8\x3a\x55\x9e\x03\xca\x77\x60\x34\x1a\x61\x88\x3d\xc4\x2a\xca\x01\xf9\x83\xc7\x4c\x0a\x0c\x9c\x02\xe6\xc8\x5a\xaa\x20\x92\x2a\x5d\xc4\x4a\x14\xc8\x53\xfa\xa0\x21\xb1\xa1\x0b\x7f\x9f\x97\x45\x4e\x01\x77\x3c\x80\x2f\x2f\x48\xf1\x52\x24\x44\xac\x84\xfc\x29\x5d\x26\x11\xa8\xb4\x00\x25\x65\xa4\xc5\x32\xd4\x7a\x77\x77\x07\x85\xcc\x16\x23\x40\x1b\x28\x88\xaf\x13\x51\x8c\x60\x70\x42\x26\x4e\xff\x23\x8a\x38\x55\x22\x99\x8a\x3b\x07\x66\x77\x48\x70\x3d\x32\xc7\x91\x88\x46\x4a\x2d\x21\x5c\x5c\x01\xae\x90\xc4\xe8\xbf\x18\x44\x0e\xcc\x07\xb3\x70\x7c\x3c\x1b\x44\x27\x06\x17\x5e\x32\x6a\xe7\x77\xa5\xcb\x79\x7d\xa5\xb6\x59\xad\xe9\x78\x70\xfb\x84\x06\x47\xf2\x25\x26\x82\xe0\x21\x4b\x17\xf0\x94\xbe\x42\x5c\x54\xcb\x9d\x49\x88\x52\x25\xcb\xd5\x88\xbb\xea\xc3\x5a\xf9\xc7\x59\x3e\x15\xa1\x95\x9c\x88\xd2\x99\x49\x24\x38\xb0\xc9\xcf\x6f\x4a\x7e\x45\xde\x8b\xb8\x78\xc3\x97\x2c\x92\x19\x06\x74\xde\x95\xb7\xc4\xe2\x01\x49\x1b\x38\x7a\x81\xe7\x0e\x9c\x75\x87\xd1\xc4\x00\x30\x55\x1d\x08\xf0\xbf\x37\xd9\x27\xd8\xbd\x5a\xad\xdf\xad\xd6\x73\x1b\x7a\x49\x2d\x93\x10\x1b\xfb\x98\xf4\xb7\x14\x05\x3d\x9a\x5a\x40\x06\xd4\x52\xc6\x25\xd7\xd6\x57\x87\x67\x8c\xc6\xb3\x12\x39\x3c\x33\xa8\x1e\x68\x0b\x46\x29\xbb\x25\xab\xf3\x98\x13\xde\x48\xf4\xc2\x70\x91\xa2\xc4\xe9\x47\x16\x28\x36\x40\xc1\x02\xcb\xf5\xf5\xf3\xd9\xf3\x8d\xea\x03\x1c\xd1\xee\x86\x6a\x86\xb7\x32\x44\x27\x26\x38\x77\x21\x78\xe7\xd7\xa1\x8e\x51\x4b\xff\x19\x65\xde\x46\xd9\x29\xa3\x68\xec\x97\x18\x7a\xf0\xf0\x2f\x87\x0b\x2a\x1c\x3e\xf4\x78\x8c\xe6\x2b\xa2\x34\xb6\xd7\x69\x33\x67\xbe\xf1\x1a\x6e\x57\xf3\x5e\xc7\x31\x64\x54\xb3\x98\x9d\xdd\x80\xf3\xf3\x32\x38\xcf\xcf\x77\xb0\x30\xe4\x09\xd8\x30\x3e\xdc\x8f\xf2\xe1\x7e\x9c\x0f\xfb\x48\xdf\x02\xee\xc0\x07\xf5\x32\xf0\x69\xc8\x85\xd8\x7e\x30\x8d\x38\x46\xc8\x49\xed\xd0\x61\xe5\xd1\x46\x79\xfe\xf5\xd3\x6f\xcd\xf2\x8c\xaf\x6c\x79\x4e\xa4\xd8\xd4\xe6\xc5\x32\x29\x62\xdc\xeb\x37\x85\xb9\x2a\xc8\xa4\x42\xdc\xfd\xf2\xfb\x72\x31\x93\xd9\x77\xaa\x7a\xd5\xb3\xae\x45\xc7\x62\x5c\x05\x4c\x78\x32\x98\xf5\xe1\xab\x0a\x69\xc9\xa3\xed\x24\xa1\xa5\x48\x47\x5d\x24\x1b\xc5\x0d\x27\xc3\x2b\x53\xda\xea\xca\xd6\x2c\x6c\x9b\xba\xb6\x5d\xd6\x50\xf6\x90\xb2\xf6\x1e\x83\x89\x6c\xe9\x49\x52\x3f\xf8\xd0\x04\x61\x01\xfc\xc0\x00\xc9\x3d\x84\xd3\x0f\xde\x98\x2d\x44\x6d\x1c\xa6\xf4\x98\xa9\xaa\x81\xdb\x01\x65\x6b\xdc\x8a\x60\x5a\xff\xd9\xba\x21\xb7\x6a\x08\xae\xf7\xa9\xca\x2b\xad\x43\xff\x09\x5c\x56\x53\x8f\xd9\xc6\xbd\xe4\xdd\xda\xd1\x7d\x38\xbd\x0f\x55\x48\x76\x1f\x32\x2e\x38\xab\xc1\xe8\x8e\x33\x0d\x6e\xe4\xc3\x6f\x69\xd4\xcc\x07\x7c\x9d\xfe\x74\xe0\xcd\x4a\x84\x4c\x2e\x04\xbe\x60\x1b\xfa\xfa\x24\x15\xdc\xff\xd4\x67\xa2\x28\x7e\x89\x23\xec\x37\x67\x6f\x70\xff\x76\x5f\xb6\xa6\xd7\x62\xae\xbb\xd7\x25\x36\xa3\xcb\x85\xcc\xe2\x39\x26\x90\xc2\x90\x54\x45\x0e\x49\xfc\x43\xc2\x4d\x7c\x41\x3d\x28\x7d\x48\x54\xad\xe1\x60\xae\x63\x9e\xe0\xdf\x9d\x59\xd7\xa8\x4e\x85\x39\x0c\x40\xcb\x21\x51\x97\x5a\x43\xb3\xdd\xa4\x6e\xb3\x6e\x36\x35\xde\x60\xa9\xb7\x84\x31\xcc\xac\x8c\xc1\xa9\xd6\x41\xad\xfc\xd2\xf5\x52\xcd\x49\x27\xf6\xc3\x52\x44\x75\xba\x74\x35\x84\xa8\xe3\x90\xcc\xc1\x1d\x86\x0c\x9a\x38\x4c\x2c\xba\x66\xde\xe5\xe6\xbf\xa2\x07\xa8\x9f\xa7\x03\x82\x34\x58\xdf\x61\x4a\xc8\x4d\x6c\x00\x43\x1f\xf9\x76\x02\xfc\xb3\x67\x6f\xa9\x85\x58\x13\x0d\xa1\x41\xe8\x40\xf5\xb4\xaf\xa5\x2e\x67\xa9\x59\x86\x08\xab\x05\x31\xf5\xd7\xe8\xa8\x60\x2e\x07\xf3\x1c\xbd\x00\xcf\x61\x4b\xce\xa9\x41\x1c\x07\xe3\xd3\x13\x0e\x15\x60\xe1\x32\x28\x6f\xec\xb3\xa8\xf7\xb5\x2e\xaf\x47\x97\xeb\x18\x83\xb9\x6e\xbd\x54\x42\xbf\x2c\xc4\x2f\x21\x3e\x6f\xb0\xd1\x12\xf4\x68\x31\x3a\x36\xd3\x14\x09\xff\x56\xe9\xab\xba\x16\x71\xb2\xcc\xba\x63\xd6\x1b\x4d\x0c\xe3\xf4\xc0\xc5\xed\xa8\x0e\xc6\xd6\x51\x98\xce\xa9\xd6\x45\x8b\x1e\xe8\xbb\x67\x11\x0a\x24\x62\xaa\x63\x2f\x6d\x2a\xa5\xcc\x56\x62\x2b\x5c\xca\xd5\xd5\x95\x6b\xa5\xb5\x06\xef\xbc\x81\xd1\xa8\xc3\x2f\x60\x8c\x25\xcc\x06\xde\x84\x0c\x19\x1f\x94\x17\x07\x06\xc4\x74\xee\x66\xd2\x1f\x85\x15\x0e\x1f\x7b\x80\xa2\xc6\xd9\x6d\xce\xb7\x28\xb2\x98\xa7\xf7\x1d\xc4\xa7\x51\xd4\xe4\xdd\x48\x70\xb4\x7b\x16\xed\x84\xdd\xc9\x3a\x81\x0e\x21\xbd\x64\x4b\xdb\xc1\x90\xde\x84\x70\xa4\x1b\xc7\x68\x08\x43\xb9\x9e\xd3\x8c\x57\x4f\x3c\x4c\x54\x28\x9b\x6e\x53\xf6\x4a\xae\x9a\xbc\x5b\x13\xda\x01\x0f\x7a\x24\xb7\x6e\x77\xd0\x09\x44\xb9\x0d\xae\x6b\x9b\x32\xf7\x31\x55\x37\xf8\x59\x26\xb8\xbb\x7e\x12\x39\xd2\xf6\xaf\x34\x56\xd3\xf6\x37\x1c\x38\x5e\xfd\x79\xaa\x57\x0b\x43\x7c\x40\x62\xd6\xf0\x97\x13\x18\xff\x03\x6c\x68\x84\x3a\xc7\x63\xf8\x23\xcd\x0a\xea\x54\x1c\x6f\x1d\xb6\x8d\x40\x0b\xab\x10\xf8\xe5\x77\xf9\x88\x26\xbd\x48\x6d\x48\xd3\x8a\x9b\x4c\x3e\x4b\x15\xb5\x0c\x19\xa2\x2c\x5a\xb0\xc2\xdd\x18\x50\x33\xf7\x05\x57\xab\x5b\xad\xe8\x82\x61\xbd\xd6\x4d\xc4\xed\xb7\xcf\xdf\x2e\x60\x99\x63\xb3\x90\x26\x89\xc8\xa2\xbf\xe6\x90\x3d\xa5\x20\x92\xc7\x34\x8b\x8b\xa7\x85\xbe\xc5\xea\xb1\xf4\x26\xcd\xe3\xda\x52\x8c\xda\x65\x22\xa7\x2b\x85\x0e\x41\x90\x03\x31\x3e\x60\x31\x2e\x1d\xb1\xd6\xbe\xfe\xfa\x30\xc5\xf9\xab\x2b\xf0\xa8\xf0\x53\x8a\x4c\x57\x2b\x6d\x38\xf6\x7f\x97\x84\xa8\xfc\x86\xb6\xae\xf5\xc0\x7f\x9f\x62\x54\x8b\x52\x7f\x22\x29\x1d\x0c\x66\xc8\xa4\x09\xc4\xa1\x9e\x72\xcd\x07\x63\xf8\x1b\x78\x46\x13\x7c\x7c\x26\xba\x6e\xd3\x69\xa9\x93\xb0\x66\x86\x6c\x54\xe3\xd8\xbc\x68\x3b\x4d\x90\xe9\x81\x5b\xba\xf1\xab\x64\x6a\xcf\x1d\x99\xf9\x46\x36\x5a\xbc\xec\x4c\x4b\x0b\x7d\x48\x7e\xae\x56\x3e\x35\xb5\x6b\xa7\x15\x55\x4c\xb3\xbf\xa2\x40\xf0\xd6\x0e\x4a\x0d\xe9\x27\xd0\x2f\x13\xfc\xbb\xa5\xa1\x8e\x7c\x3c\x3c\x52\xc1\x6a\x54\x2c\xbe\x03\xdf\xa8\xf7\x39\xbd\x78\x12\xde\x61\xdb\xfb\x4e\xb1\xf7\x3b\xa4\x82\x4e\x29\xee\xc8\xb1\x31\xb4\xd3\xc4\x5e\xa9\x6d\x3c\xb3\xa7\x55\xf9\xd4\xc6\xb3\x04\x78\x9d\x70\x56\xbb\xdf\x09\x67\x8d\x0f\x3a\xe1\x2c\x43\xa8\xdd\xdf\x86\x33\xc7\xcd\x15\x7a\xad\x4b\x3b\xeb\x35\xba\x95\xc0\x18\x01\x63\x15\xfe\x76\xcb\xd7\x51\xe8\x7b\xce\x69\xd8\xe3\x16\xa3\x44\xdf\x75\xf4\xc6\x72\x23\x94\xbb\x4c\xea\x13\x6e\xca\x96\x15\x27\x13\x73\x33\x79\x23\xb2\xc2\x2a\x39\xd6\x8c\xae\x39\x8f\xb8\x17\x9a\x8a\xf3\x50\x4f\xc2\x33\xce\xd2\x6d\x06\x16\x1f\xaa\x3d\x2d\x29\xfb\x42\x5d\x6f\x8f\x7f\xd7\x9b\x59\xb9\xbb\x79\x54\x5c\x74\xfb\xab\x5f\xc2\x0e\x0d\xcd\xd6\xc1\x6e\xd3\x6c\xe8\xae\x83\x58\xe3\x10\x66\x9d\xc9\x36\x5b\x98\xa5\xee\x90\x3d\xcc\x75\x5a\x56\x73\xf9\x54\x1e\x18\xda\x68\x3d\xca\x49\xe8\xc3\xc3\x96\x04\x8d\xf2\x12\x5d\xdf\xf0\xd8\x6f\x6c\x99\xcf\x5d\xbe\xe3\xb9\xa0\x85\xc4\x21\xfe\xb8\xb1\x85\xed\x39\x77\xb4\xb0\x01\xa7\x77\xcb\x56\xcf\x0e\xe8\x32\x5a\xda\xd1\xdc\x18\x6e\x85\x72\xd5\x3c\xd9\x71\x6c\xe1\xed\x20\x56\x30\x84\xad\xe4\x68\x4b\x34\x83\x56\x59\x41\xdb\xc0\xfd\xdf\x11\xdb\xd0\x75\x48\xb8\xe2\x1e\xd2\xb4\x96\x0b\x56\xd7\x46\xf5\x04\x69\x1b\xc9\x07\xe7\x36\x72\x3f\x9d\xec\x25\x78\x13\xc4\x06\x63\x1b\xc6\x1e\xb2\x9b\x30\x36\x04\x6d\xf6\xec\xf8\xfb\x5f\x00\x00\x00\xff\xff\x47\x77\xb7\x86\x16\x20\x00\x00") +var _resourcesNumbertheoryM = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xa4\x5a\x6d\x6f\xe3\xb8\x11\xfe\x9e\x5f\x31\xdd\x02\x6d\xe2\x4a\xb6\x5e\xe2\x64\x93\x20\xbd\x2e\x76\x93\x62\xdb\xbb\x5b\x6f\x2f\x40\x3f\x18\xaa\x23\x5b\x74\x2c\x9c\x2d\x19\x92\x9c\x6c\x60\xf8\xbf\x77\x86\xd4\x1b\x65\x8d\x6c\xe3\x16\xb0\x2d\x91\xcf\x3c\x1c\x0e\x67\x38\x43\x6e\x46\x49\xb8\x12\xdf\x6f\x6f\x37\xa9\xff\x22\xe0\x1e\x3e\x3c\xab\x96\x71\xe4\x3d\x43\x22\xb2\x4d\x12\xa5\xf0\x94\x6c\x04\x84\x73\x78\x8e\x9e\x21\x4c\x61\x4d\x08\x03\x1e\xfd\x65\x2a\x20\xce\x16\x22\x79\x0b\x53\xd1\xff\x70\x77\xf6\x29\xcb\x92\x70\xba\xc9\x44\x3a\x56\x34\x1e\x52\x6e\x7f\x0e\xd3\xcc\x9f\x2e\x51\x64\x94\xc4\x99\x98\x65\x22\xd8\xdd\x9d\x3d\x89\x34\x4b\xf3\xd1\x08\x75\x06\xf8\xef\xe1\xb7\x70\xb5\x5e\x8a\x87\x1f\x3e\xfd\xa4\x63\xd9\xa8\x3a\xfc\x95\x20\x91\x31\x29\x43\x4c\x52\xcb\xa1\xe7\x19\x2d\x18\xa9\x5a\x09\xb2\x2d\xab\x1d\xa6\x51\xdd\x7c\x74\x2e\x87\xf6\xd5\xd0\x3d\x02\x6b\x3a\x9e\x27\x31\x9e\x01\x0f\x8f\x9b\x84\x6c\xd0\xa2\xf3\xe7\x78\xb5\x12\x51\x36\x2e\x8c\xfa\x0c\x71\xb4\x7c\x87\xb7\x38\xf9\x3d\x85\x79\x9c\xc0\xd7\x28\x13\x2f\x22\x49\x6f\x3f\x1c\x31\x8d\x61\xbf\x36\xa8\xb4\x5e\x9b\x79\x74\x19\x66\xe2\x0d\xfb\x1c\x03\x32\x8f\x42\x59\xfd\x61\xa1\xe4\x19\xae\xf1\xd9\x3f\x3f\x7f\xa9\xfb\x16\xbe\x8e\x23\xdb\x80\xc8\x31\xa0\xdf\xef\xa3\x8b\xcd\xc3\x28\x48\x01\xed\x07\x2f\x89\xf0\xd1\x71\x32\x98\xa1\xd5\xe2\x08\x02\x11\xc5\xab\x30\xf2\x33\xb4\x53\x3c\x97\x90\x50\x99\x0b\x7f\xd7\x9b\x2c\x25\x87\x3b\xef\xc1\xc3\x2b\x9a\x78\xe3\x2f\xc9\xb0\x02\xd2\x45\xbc\x59\x06\x10\xc5\x19\x44\x42\x04\x52\x2c\x41\xd6\xc9\x64\x02\x99\x48\x56\x7d\x40\x1d\xc8\x89\x1f\x97\x7e\xd6\x87\xde\x05\xa9\x38\xfe\x8f\x9f\x85\x71\xe4\x2f\xc7\xfe\xc4\x80\xe9\x04\x0d\x5c\xb6\xcc\xb0\x25\xa0\x96\x9c\xc5\x83\xdb\x7b\xc0\x19\x92\x18\x7d\xfc\x5e\x60\xc0\xac\x37\xf5\x06\xe7\xd3\x5e\x70\xa1\x70\xde\x1d\x43\x3b\x9b\xe4\x4b\xce\xf3\xe5\x6c\xd3\x92\xe9\xbc\xf7\xb4\x40\x85\x03\xf1\x1a\x92\x81\x60\x9e\xc4\x2b\x58\xc4\x6f\x10\x66\xc5\x74\xa7\x02\x82\x38\x12\xf9\x6c\xfc\x49\x31\xb0\x24\xff\x34\x4d\xc7\xbe\xa7\x05\x27\xa2\x64\x64\x92\x11\x0c\xa8\xe2\xf3\x5b\x24\xbe\xa2\xdd\xb3\x30\x7b\xc7\x97\x24\x10\x09\x3a\x74\xda\x16\xb7\x64\xc5\x13\x82\xd6\x35\xe4\x04\x6f\x0c\xb8\x6a\x77\xa3\xa1\x02\x60\xa8\x1a\xe0\xe2\xc7\x1e\x1e\xe3\xec\x76\x49\xeb\xb4\xd3\xda\x56\x8d\x97\x68\x99\x80\xa8\xf4\x63\xc2\x5f\x23\x72\x3b\x98\x1a\x40\x06\xd4\x20\xe3\x82\x6b\x6f\x54\xf3\x8a\x61\xbc\xca\x91\xe6\x95\x42\x75\x40\x1b\x30\x0a\xd9\x3d\x59\x19\xc7\x9c\x70\x25\xd1\x09\xc3\x49\xfa\x39\x4e\x3e\xb2\x40\xbf\x02\xfa\x2c\x30\x9f\x5f\xb7\x3d\x3b\xc6\x28\x06\xe0\x0c\x6d\x55\xa6\x66\xec\x96\xbb\xe8\x50\x39\xe7\x21\x04\xbf\xf8\xa5\xab\xa3\xd7\xd2\x87\x21\xb3\x2b\xb2\x4b\x86\x68\xe0\xe4\x18\x7a\xb0\xf1\x9b\xc3\xb9\x05\x0e\x1f\x3a\x56\x8c\xfa\x0b\x43\x49\x6c\xe7\xa2\x4d\x8d\x59\xb5\x6a\xb8\x5d\xcd\x3a\x17\x8e\x31\x46\xd1\x8b\xd1\xd9\x0e\xb8\xb9\xc9\x9d\xf3\xe6\xe6\x80\x15\x4c\xde\x00\x95\xc5\xcd\xe3\x4c\x6e\x1e\x67\x73\xb3\xcb\xe8\x7b\xc0\x03\x78\xb7\x9c\x06\x3e\x99\x9c\x8b\x1d\x07\x93\x88\x73\x84\x5c\x94\x0b\x6a\x16\x2b\x5a\x4b\xcf\x3f\x7f\xfe\xa5\x9e\x9e\xf1\x95\x4d\xcf\x4b\xe1\x57\xb9\x79\xb5\x59\x66\x21\xee\xf5\x55\x62\x2e\x12\x32\x51\xf8\x93\x9f\x7e\xdd\xac\xa6\x22\xf9\x4e\x59\xaf\x78\x96\xb9\xe8\xdc\x1f\x14\x0e\xe3\x5d\xf4\xa6\x5d\xf8\x22\x43\x6a\xf2\xa8\x3b\x49\x48\x29\xe2\x28\x93\x64\x2d\xb9\x61\xa7\x77\xaf\x52\x5b\x99\xd9\xea\x89\xad\xca\x6b\xfb\x69\x0d\x65\x4f\x49\x6b\xd7\xe8\x4c\xa4\x4b\x47\x90\x3a\xee\xc7\x3a\x08\x13\xe0\x47\x06\x48\xcb\x43\x38\xf9\x60\x0f\xd8\x44\xd4\xc4\x61\x48\x0f\x98\xac\xea\x5a\x2d\x50\x36\xc7\x6d\x09\x26\xf9\xaf\x76\x35\xb9\x6d\x4d\x70\x77\x4c\x56\xde\x4a\x0e\xf9\xe5\x5a\x2c\x53\x87\xda\x6a\x79\x69\x75\xcb\x85\xee\xc2\xc9\x7d\xa8\x40\xb2\xfb\x90\x5a\x82\xab\x12\x8c\xcb\x71\x25\xc1\xb5\x78\xf8\x25\x0e\xea\xf1\x80\xaf\xe3\x1f\x06\xbc\x6b\x81\x90\x88\x95\x8f\x2f\x58\x86\xbe\x2d\x44\x04\xcf\x3f\xe4\x99\x28\x08\x5f\xc3\x00\xeb\xcd\xe9\x3b\x3c\xbf\x3f\xe7\xa5\xe9\xa3\x3f\x93\xd5\xeb\x06\x8b\xd1\xcd\x4a\x24\xe1\x0c\x03\x28\x42\x97\x8c\xb2\x14\x96\xe1\xef\x02\x46\xe1\x2d\xd5\xa0\x34\x90\x5f\x94\x86\xbd\x99\xf4\x79\x82\x7f\x37\xa6\x6d\xad\x32\x14\x66\xd0\x03\x29\x87\x86\xba\x93\x0c\xf5\x72\x93\xaa\xcd\xb2\xd8\x94\x78\x85\xa5\xda\x12\x06\x30\xd5\x22\x06\xbb\x1a\x07\xb5\x7c\xa4\xc7\x4d\x34\x23\x4e\xac\x87\x85\x1f\x94\xe1\xd2\x56\x10\x22\xc7\x29\x91\x83\x3b\x0c\x29\x34\x34\x18\x5f\xb4\x54\xbf\xc5\xf5\x7f\xc5\x15\xa0\x7a\x9e\x0e\x08\x42\x61\x1d\x83\x49\x21\xa3\x50\x01\x4c\x07\xed\x6d\xb8\xf8\x75\x64\x6d\x29\x85\x58\x15\x95\x41\x5d\xcf\x80\xe2\xe9\x58\x4d\x2d\x4e\x53\x35\x0d\xdf\x2b\x26\xc4\xe4\x5f\xc5\x51\xc0\x2c\x0e\x66\x1b\x72\x02\xb6\xc1\xa6\x9c\x4b\x85\x38\x77\x07\x97\x17\x1c\xca\xc5\xc4\xa5\x50\xf6\xc0\x61\x51\xd7\x25\x97\xdd\xc1\x65\x19\x4a\x61\xae\x5a\xcf\x49\xe8\x97\x85\x38\x39\xc4\xe1\x15\x56\x2c\x6e\x07\x8b\xe2\xa8\xba\xc9\x13\xfe\x1d\xc5\x6f\xd1\xa3\x1f\x2e\x37\x49\xbb\xcf\xda\xfd\xa1\xb2\x38\x3d\x70\x7e\xdb\x2f\x9d\xb1\x71\x14\xa6\x73\xaa\x76\xd1\x22\x1b\xba\xee\x59\xfc\x08\x04\x62\x8a\x63\x2f\x6d\x2a\xb9\xcc\x5e\x60\x47\x38\x95\xfb\xfb\x7b\x4b\x0b\x6b\x09\x3e\x78\x03\x23\x51\xa7\x5f\xc0\x28\x4d\x98\x0d\xbc\x0e\x31\x99\x35\xc8\x2f\x0e\x14\x88\xa9\xdc\x55\xa7\xd3\xf7\x0a\x1c\x3e\x76\x00\xfd\x12\xa7\x97\x39\xdf\x82\x40\xb3\x3c\xbd\x1f\x30\x7c\x1c\x04\x75\xbb\x2b\x09\xce\xec\xb6\x66\x76\xc2\x1e\xb4\x3a\x81\x4e\x31\x7a\x6e\x2d\xa9\x07\x63\xf4\x3a\x84\x33\xba\x5a\x18\x09\x61\x4c\x2e\xfb\xa4\xc5\x8b\x27\x1e\xe6\x17\x28\xdd\xdc\x2a\xed\xe5\xb6\xaa\xdb\x5d\xeb\x90\x0b\x30\x97\x2d\xa9\x76\xbb\x83\x8b\x40\x26\xd7\xc1\x65\x6e\x8b\xd4\x7d\x4c\x51\x0d\x7e\x11\x4b\xdc\x5d\x3f\xfb\x29\x9a\xed\x5f\x71\x18\x8d\x9b\x63\x18\x70\xbe\xfd\xf3\x58\xce\x16\x4c\x7c\x40\xc3\xec\xe0\x2f\x17\x30\xf8\x07\xe8\xd0\x00\x39\x07\x03\xf8\x2d\x4e\x32\xaa\x54\x0c\x7b\xe7\x35\x95\x40\x0d\x0b\x17\xf8\xe9\x57\xf1\x82\x2a\xbd\x0a\xa9\x48\x5d\x8b\x51\x22\xd6\x22\x0a\x1a\x8a\x98\x28\x8b\x1a\x6c\x71\x37\x06\x64\xe6\x46\xb0\x24\xdd\x76\x4b\x17\x0c\xbb\x9d\x2c\x22\x9e\xbe\x7d\xf9\x76\x0b\x9b\x14\x8b\x85\x78\xb9\xf4\x93\xe0\xaf\x29\x24\x8b\x18\xfc\xe5\x4b\x9c\x84\xd9\x62\x25\x6f\xb1\x3a\x34\x1d\xc5\x69\x58\x6a\x8a\x5e\xbb\x59\x8a\xf1\x36\xc2\x05\x41\x90\x01\x21\x3e\x60\x32\xce\x17\x62\x27\xd7\xfa\xeb\x7c\x8c\xfd\xf7\xf7\x60\x53\xe2\xa7\x10\x19\x6f\xb7\x52\x71\xac\xff\xee\x08\x51\xac\x1b\xea\xba\x93\x0d\xff\x5d\x84\x48\x8b\x52\x7f\x22\x29\xe9\x0c\xaa\x49\x85\x09\x84\x9e\xec\xb2\xd4\x80\x21\xfc\x0d\x6c\xc5\x04\x9f\xd6\x64\xae\xa7\x78\x9c\x73\x12\x56\xf5\x90\x8e\xd1\x20\x54\x2f\x52\x4f\xe5\x64\xb2\xe1\x89\x6e\xfc\x0a\x99\x72\xe5\xce\x54\x7f\x2d\x1a\x35\xbb\x1c\x0c\x4b\x0d\x7d\x4a\x7c\x6e\xb7\x0e\x15\xb5\x3b\xa3\xe1\x55\x4c\xb1\xbf\x25\x47\xb0\x77\x06\x4a\x99\xf4\xe3\xca\x97\x21\x7e\xef\x31\x94\x9e\x8f\x87\x47\x4a\x58\xb5\x8c\xc5\x57\xe0\x15\xbd\xc3\xf1\xe2\x49\xf8\x80\x6e\xd7\xad\x62\xd7\x07\xa4\xdc\x56\x29\xee\xc8\x51\x29\xda\xaa\x62\xa7\xd4\x3e\x9e\xd9\xd3\x8a\x78\x6a\xe2\x59\x03\xd8\xad\x70\x96\xdd\x69\x85\xb3\xca\xbb\xad\x70\xd6\x42\xc8\xee\xec\xc3\x99\xe3\xe6\x16\x57\xad\x8d\x9d\x5d\x35\xba\x95\x40\x1f\x01\xa5\x15\xfe\xb6\xcb\x97\x5e\xe8\xd8\xc6\xa5\xd7\xb1\x2c\x8a\x44\xde\x75\x74\xfa\x72\xcd\x95\xdb\x54\xea\x12\xae\xcb\xe6\x19\x27\xf1\x67\xaa\x73\xe4\x27\x99\x96\x72\xb4\x1e\x99\x73\x5e\x70\x2f\x54\x19\x67\x5e\x76\xc2\x1a\x7b\xe9\x36\x03\x93\x0f\xe5\x9e\x86\x94\x7e\xa1\x2e\xb7\xc7\xbf\xcb\xcd\x2c\xdf\xdd\x6c\x4a\x2e\xb2\xfc\x95\x2f\x5e\x0b\x43\xbd\x74\xd0\xcb\x34\x1d\x7a\xe8\x20\x56\x3b\x84\x69\x67\xb2\x6a\x0b\xd3\xe8\x4e\xd9\xc3\x2c\xa3\xa1\x35\x17\x4f\xf9\x81\xa1\x89\x96\xad\x9c\x84\x3c\x3c\xec\x49\x50\x2b\x2f\xd1\x36\x86\xcd\x8e\xb1\xa7\x3e\x77\xf9\x8e\xe7\x82\x06\x12\x9b\xf8\xe3\xc6\x1e\xb6\xe3\xdc\xd1\xc0\xba\x1c\xef\x9e\xae\xb6\xee\xd0\xb9\xb7\x34\xbd\xb9\xd6\xdc\x70\xe5\xa2\x78\xd2\xfd\x58\xc3\xeb\x4e\x1c\x81\x09\x7b\xc1\xd1\x94\xa8\x3b\x6d\xa4\x39\x6d\x0d\xf7\x87\x3d\xb6\xc6\x75\x8a\xbb\xe2\x1e\x52\xd7\x96\x73\x56\x4b\x47\x75\x38\x69\x13\xc9\x3b\xe7\x3e\xf2\x38\x4e\xf6\x12\xbc\x0e\x62\x9d\xb1\x09\x63\x0f\xd9\x75\x18\xeb\x82\xba\xf5\x1a\xfe\x37\x8a\xdf\x44\xd2\xb8\x0d\x2b\xda\xe4\x95\x98\x01\x2b\xf4\xbf\x59\xbc\x5a\x93\x3b\x80\xba\x2a\xfb\x9f\x6a\x96\x97\x5f\x55\xd9\x2a\xe6\xf3\x70\x16\x8a\x28\x83\x57\x91\xa4\xe8\x12\xea\xd6\x18\xcf\x59\xf3\xdc\x47\xfa\x58\xc0\x56\xec\x58\xe0\xbf\xe3\x67\x35\x29\x8f\x59\x39\xb1\xfe\xf7\x05\x39\x9e\x2b\xe9\x38\x67\x2b\xe4\x4e\xf1\xb4\x2b\xa3\xd4\x6e\x68\xc0\xcd\x0d\xfd\x9f\xc4\xb5\x6e\xb0\x07\xac\xaa\x93\xd1\x22\xd4\x0e\xf8\x79\x9b\x0c\xd5\xd2\x54\xb2\x15\x6b\xf8\x2c\xce\xa4\x51\x0a\x23\xc8\x3f\x08\x50\x61\x5b\x3f\xc3\xe7\x1c\xc7\x4f\xb3\x1c\xd5\x2a\x72\x4d\xa5\x47\xfb\x99\xe0\x4c\x2b\xf8\xa9\x7a\x8f\x7a\xc8\x18\x6c\x66\xe8\x17\xb8\x4d\xd8\x83\x75\x7e\x80\xda\xae\x9b\x49\x39\xf2\xe4\x91\xa0\x65\x08\xed\x80\x54\xf6\x9b\xb4\xc9\xe4\x17\x0f\x79\xdb\x29\x2b\x71\xe9\x18\x25\xd5\x0d\x53\x5b\x5b\x46\xcd\x04\xad\x88\x3a\x8b\x59\xd1\x1c\xb8\x0e\x2c\x45\xb8\xff\xac\xad\x91\xea\xe1\xf4\xff\x00\x00\x00\xff\xff\x65\xbd\x2b\xe2\x65\x23\x00\x00") func resourcesNumbertheoryMBytes() ([]byte, error) { return bindataRead( @@ -398,7 +398,7 @@ func resourcesNumbertheoryM() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "resources/numbertheory.m", size: 8214, mode: os.FileMode(420), modTime: time.Unix(1508304866, 0)} + info := bindataFileInfo{name: "resources/numbertheory.m", size: 9061, mode: os.FileMode(420), modTime: time.Unix(1509604266, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/expreduce/resources/numbertheory.m b/expreduce/resources/numbertheory.m index ed770be..54144a1 100644 --- a/expreduce/resources/numbertheory.m +++ b/expreduce/resources/numbertheory.m @@ -224,3 +224,31 @@ ESameTest[1,IntegerPart[1]], ] }; + +PowerMod::usage = "`PowerMod[x, y, m]` computes `Mod[x^y, m]`"; +(*TODO: use efficient version of this function.*) +PowerMod[x_, y_, m_] := Mod[x^y, m]; +Attributes[PowerMod] = {Listable, Protected, ReadProtected}; +Tests`PowerMod = { + ESimpleExamples[ + ESameTest[6,PowerMod[5, 9999, 7]], + ] +}; + +EulerPhi::usage = "`EulerPhi[n]` computes Euler's totient function for `n`"; +Attributes[EulerPhi] = {Listable, Protected, ReadProtected}; +EulerPhi[0] := 0; +EulerPhi[n_Integer?Positive] := + If[n === 1, 1, + n*Product[1 - 1/p[[1]], {p, FactorInteger[n]}]]; +EulerPhi[n_Integer?Negative] := EulerPhi[-n]; +Tests`EulerPhi = { + ESimpleExamples[ + ESameTest[42,EulerPhi[98]], + ESameTest[0,EulerPhi[0]], + ESameTest[42,EulerPhi[-98]], + ], ETests[ + ESameTest[1,EulerPhi[1]], + ESameTest[1,EulerPhi[-1]], + ] +};