MODSR.LOG 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. REDUCE 3.6, 15-Jul-95, patched to 6 Mar 96 ...
  2. % Test series for the package MODSR: SOLVE and ROOTS for
  3. % modular polynomials and modular polynomial systems.
  4. % Moduli need not be primes.
  5. on modular;
  6. setmod 8;
  7. 1
  8. m_solve(2x=3);
  9. {}
  10. % {}
  11. m_solve(2x=4);
  12. {{x=2},{x=6}}
  13. % {{x=2},{x=6}}
  14. m_solve(x^2-1);
  15. {{x=1},{x=3},{x=5},{x=7}}
  16. % {{x=1},{x=3},{x=5},{x=7}}
  17. m_solve({x^2-y^3=3});
  18. {{x=0,y=5},
  19. {x=2,y=1},
  20. {x=4,y=5},
  21. {x=6,y=1}}
  22. % {{x=0,y=5}, {x=2,y=1}, {x=4,y=5}, {x=6,y=1}}
  23. m_solve({x^2-y^3=3,x=2});
  24. {{y=1,x=2}}
  25. % {{y=1,x=2}}
  26. m_solve({x=2,x^2-y^3=3});
  27. {{x=2,y=1}}
  28. % {{x=2,y=1}}
  29. m_solve({x1,x2 + 6,2*x1**3 + 4*x2**4 + x3 + 6});
  30. {{x1=0,x2=2,x3=2}}
  31. % {{x1=0,x2=2,x3=2}}
  32. setmod 800;
  33. 8
  34. m_solve(x^2-1);
  35. {{x=1},
  36. {x=49},
  37. {x=351},
  38. {x=399},
  39. {x=401},
  40. {x=449},
  41. {x=751},
  42. {x=799}}
  43. % {{x=1}, {x=49}, {x=351}, {x=399}, {x=401}, {x=449}, {x=751}, {x=799}}
  44. m_solve({x1 + 51,
  45. 282*x1^4 + x2 + 468,
  46. x3 + 1054,
  47. 256*x1^2 + 257*x2^4 + 197*x3 + x4 + 653,
  48. 255*x1^4 + 40*x2^2 + x5 + 868,
  49. 230*x1^4 + 670*x3 + 575*x4^4 + 373*x5^3 + x6 + 1328,
  50. 182*x4^4 + 727*x5^2 + 609*x6**4 + x7 + 1032,
  51. 623*x1^3 + 614*x2^4 + 463*x3**2 + 365*x4 + 300*x7 + x8 + 1681});
  52. {{x1=749,x2=50,x3=546,x4=729,x5=77,x6=438,x7=419,x8=399}}
  53. % {{x1=749,x2=50,x3=546,x4=729,x5=77,x6=438,x7=419,x8=399}}
  54. m_solve{x+y=4,x^2+y^2=8};
  55. {{x=2,y=2},
  56. {x=22,y=782},
  57. {x=42,y=762},
  58. {x=62,y=742},
  59. {x=82,y=722},
  60. {x=102,y=702},
  61. {x=122,y=682},
  62. {x=142,y=662},
  63. {x=162,y=642},
  64. {x=182,y=622},
  65. {x=202,y=602},
  66. {x=222,y=582},
  67. {x=242,y=562},
  68. {x=262,y=542},
  69. {x=282,y=522},
  70. {x=302,y=502},
  71. {x=322,y=482},
  72. {x=342,y=462},
  73. {x=362,y=442},
  74. {x=382,y=422},
  75. {x=402,y=402},
  76. {x=422,y=382},
  77. {x=442,y=362},
  78. {x=462,y=342},
  79. {x=482,y=322},
  80. {x=502,y=302},
  81. {x=522,y=282},
  82. {x=542,y=262},
  83. {x=562,y=242},
  84. {x=582,y=222},
  85. {x=602,y=202},
  86. {x=622,y=182},
  87. {x=642,y=162},
  88. {x=662,y=142},
  89. {x=682,y=122},
  90. {x=702,y=102},
  91. {x=722,y=82},
  92. {x=742,y=62},
  93. {x=762,y=42},
  94. {x=782,y=22}}
  95. off modular;
  96. % m_roots has the modulus as its second argument.
  97. m_roots(x^2-1,8);
  98. {1,3,5,7}
  99. % {1,3,5,7}
  100. m_roots(x^3-1,7);
  101. {1,2,4}
  102. % {1,2,4}
  103. m_roots(x^3-x,7);
  104. {0,1,6}
  105. % {0,1,6}
  106. m_roots((x-1)*(x-2)*(x-3),7);
  107. {1,2,3}
  108. % {1,2,3}
  109. m_roots((x-1)*(x-2)*(x^3-1)*(x-5),7);
  110. {1,2,4,5}
  111. % {1,2,4,5}
  112. m_roots((x-1)*(x-2)*(x^3-1)*(x-5),1009);
  113. {1,2,5,374,634}
  114. % {1,2,5,374,634}
  115. m_roots((x-1)*(x-2)*(x^3-1)*(x-5),1000);
  116. {1,2,5,26,51,101,127,130,151,201,226,251,255,301,351,377,401,426,451,501,505,551
  117. ,601,626,627,651,701,751,755,801,826,851,877,901,951}
  118. length ws;
  119. 35
  120. % 35
  121. end;
  122. (TIME: modsr 16769 16769)