︠d7195b43-8ca5-4f01-829e-b0a11258801as︠ R. = QQ[] f = x^6 + 9398*x^5 + 939*x^4 + 10*x^3 + 17*x + 3 ︡9949c408-aeea-4929-a95b-fd2110f522ae︡︡{"done":true} ︠b23ca8ba-c973-48a2-bf9b-d41c1086864cs︠ f.factor() ︡d015caa4-4336-4161-b594-bf67568562c1︡︡{"stdout":"x^6 + 9398*x^5 + 939*x^4 + 10*x^3 + 17*x + 3"}︡{"stdout":"\n"}︡{"done":true} ︠233922e4-8ad2-4d93-aaa7-75e682d509aas︠ for p in primes(50): print p, f.factor_mod(p) ︡567317d2-5c00-4750-b58c-db12105999e1︡︡{"stdout":"2 "}︡{"stdout":"(x + 1) * (x^2 + x + 1) * (x^3 + x + 1)\n3 x * (x + 2)^2 * (x^3 + x^2 + x + 2)\n5 x^6 + 3*x^5 + 4*x^4 + 2*x + 3\n7 x^6 + 4*x^5 + x^4 + 3*x^3 + 3*x + 3\n11 (x + 4)^2 * (x^4 + 7*x^3 + 9*x^2 + 2*x + 5)\n13 (x + 3) * (x + 10)^2 * (x^3 + 2*x^2 + 5*x + 3)\n17 (x^2 + x + 2) * (x^2 + 3*x + 12) * (x^2 + 10*x + 15)\n19 (x + 16) * (x^2 + 16*x + 11) * (x^3 + 18*x^2 + x + 12)\n23 (x + 13) * (x + 18) * (x^4 + 6*x^3 + 13*x^2 + 20*x + 18)\n29 (x^3 + 10*x^2 + 10*x + 22) * (x^3 + 21*x^2 + 23*x + 12)\n31 (x + 7) * (x^2 + 9*x + 22) * (x^3 + 20*x^2 + 7*x + 28)\n37 (x + 20) * (x + 24) * (x^2 + 6*x + 4) * (x^2 + 24*x + 27)\n41 x^6 + 9*x^5 + 37*x^4 + 10*x^3 + 17*x + 3\n43 (x + 35) * (x^5 + 32*x^4 + 34*x^3 + 24*x^2 + 20*x + 5)\n47 (x + 8) * (x + 13) * (x^4 + 24*x^3 + 2*x^2 + 10*x + 5)\n"}︡{"done":true} ︠8e3de795-b268-4a1c-bf63-cbd80d054492s︠ f.factor_mod(17) f.factor_mod(29) ︡bfbd3840-d199-42b0-879d-30236c70db32︡︡{"stdout":"(x^2 + x + 2) * (x^2 + 3*x + 12) * (x^2 + 10*x + 15)\n"}︡{"stdout":"(x^3 + 10*x^2 + 10*x + 22) * (x^3 + 21*x^2 + 23*x + 12)\n"}︡{"done":true} ︠b99b2c9f-6e06-491a-a1d3-fc37254aa632︠ devel/sage/sage/groups/perm_gps/partn_ref/refinement_matrices.pyx ︠0a0dfac1-36b5-4245-a768-551666c6332cs︠ v = list(Partitions(6)) ︡7a84d072-28ed-4676-90e7-368808d5f323︡︡{"done":true} ︠2d9bf466-f647-47e5-b95b-dc53e9f3ca7es︠ v ︡7c541bd3-1de1-4d30-8fab-c07fac04f954︡︡{"stdout":"[[6], [5, 1], [4, 2], [4, 1, 1], [3, 3], [3, 2, 1], [3, 1, 1, 1], [2, 2, 2], [2, 2, 1, 1], [2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]]\n"}︡{"done":true} ︠72bf05dd-3836-4147-a1d2-d6a7cca2f76bs︠ v[1] [x for x in v if v[1].contains(x)] ︡88f5a509-6d7e-4913-aa9c-0a213df3d824︡︡{"stdout":"[5, 1]\n"}︡{"stdout":"[[5, 1]]\n"}︡{"done":true} ︠92373e3c-d659-4c5f-a9cd-3ea47ba93becs︠ R. = QQ[] f = R.random_element(800) f ︡514a5cd2-0d2c-492d-a7df-c6adfa12e44c︡︡{"stdout":"2/21*x^800 + x^799 + 1/2*x^798 + 4*x^796 + 88/61*x^795 + 1/89*x^792 - x^790 - x^789 + x^788 - x^786 + x^785 - 49*x^783 + 2*x^782 - x^781 + 2*x^780 + 2*x^779 + x^778 - 1/2*x^777 + 1/11*x^776 - 1/12*x^773 - 13*x^770 - 1/6*x^769 - 1/6*x^768 - 11*x^767 - x^766 - x^765 - 19/2*x^763 - 1/24*x^762 - 15*x^761 - 4/3*x^760 - 1/40*x^758 + x^756 - 2*x^754 + 4*x^752 + x^751 + x^750 + 10*x^749 + x^747 - 2*x^745 + 1/3*x^744 + 73/347*x^743 + x^742 + x^741 + 1/8*x^740 + x^738 + x^737 + 9/20*x^736 - x^735 - 3*x^733 - 1/6*x^731 - 3/4*x^730 + 5/2*x^729 - 3*x^726 - x^725 - x^724 + 2*x^722 - 7/8*x^721 + 16/3*x^720 + 3*x^719 + 2*x^718 - 4*x^717 + 67*x^713 + x^711 - 13/5*x^710 + 3*x^707 - 1/2*x^706 - 2/7*x^704 - 2*x^703 - x^702 - 1/54*x^701 - x^699 - x^698 + 2*x^697 + 3/2*x^696 + 1/2*x^695 + x^693 + x^692 + 6*x^691 + 13*x^690 - 1/3*x^689 + 1/2*x^688 + 5*x^687 + 3*x^686 + 5*x^684 + 5*x^682 - 1/2*x^681 - 2*x^680 + x^679 - 1/14*x^678 + 3*x^677 - x^676 + x^675 + 2*x^674 + 23*x^673 - 1/119*x^672 + 3*x^671 - x^670 - x^669 + 3/7*x^668 - x^667 - 2/3*x^666 + 1/2*x^663 + 2*x^662 - 5*x^661 - 1/7*x^660 - 14*x^659 + 1/3*x^658 + 3*x^657 + 19/3*x^656 + 3*x^655 - x^653 + 1/4*x^652 + x^650 + x^649 + 1/15*x^648 - 2*x^647 + 1/2*x^646 + 2*x^644 - 2*x^643 + x^642 + x^641 - 8/7*x^640 + x^638 - 1/2*x^635 + x^633 - 3*x^631 - 2*x^630 - 2*x^629 - 35*x^628 + 2*x^627 - 2/3*x^626 + x^625 + 2*x^623 - x^622 - 19*x^621 + 28/5*x^620 + 17*x^619 - 1/4*x^616 + 2*x^615 - 1/2*x^613 + 3*x^610 - 5*x^609 + 15/2*x^607 + x^606 + 2/3*x^605 - x^604 - 28*x^603 - 4*x^601 - 11*x^600 + 3*x^599 - 3*x^598 + x^597 - 1/3*x^596 + 5/6*x^595 + x^593 + 1/3*x^592 - 5*x^591 - 13/5*x^590 + 6*x^589 - 135/2*x^588 + 11*x^587 - 3*x^586 - 7*x^585 - 3/2*x^584 - 1/2*x^583 + 2*x^582 + x^581 - x^580 - 4*x^579 + x^578 + x^577 + 3/10*x^576 - 1/3*x^575 - 7*x^574 + 2*x^573 - 1/6*x^572 - 17*x^571 - 1/5*x^570 + x^568 + 1/20*x^566 - 11*x^565 + 1/40*x^563 + x^562 + x^561 - 1/4*x^560 + x^559 + x^558 - x^557 + x^556 + 1/3*x^555 + 1/5*x^554 - x^553 + 1/124*x^552 + 25*x^551 + 2*x^549 - 4*x^548 + 2*x^547 + 1/4*x^545 + 1/2*x^544 - 1/2*x^543 - x^542 - 2*x^541 - x^539 + 2*x^538 + 13/3*x^537 - x^536 - x^535 - 1/4*x^534 - x^532 + 2*x^531 + 1/6*x^529 - x^528 - 1/3*x^526 + 1/2*x^524 - 2*x^523 + 1/4*x^522 - x^521 + 2*x^520 - 15/2*x^519 + 1/2*x^518 - 1/6*x^516 + 1/9*x^512 - x^511 + x^510 - x^509 - 1/9*x^508 + 16/5*x^507 - 5/3*x^506 + x^505 + 9*x^504 + x^503 - 1/2*x^502 + x^501 + 79/85*x^499 - 25/29*x^498 - 6*x^496 + x^495 + 1/4*x^494 - 2*x^492 - 3*x^491 + 1/5*x^490 + 1/21*x^488 + x^487 - x^486 + x^484 + x^483 + x^482 - 3*x^478 + 6*x^477 + x^476 - 4*x^475 - 6*x^474 - 1/5*x^473 - 1/2*x^469 - 1/2*x^468 + 4*x^467 + 2/15*x^466 + x^464 + x^463 + x^462 - x^461 - 2/3*x^459 - 3*x^456 - 1/3*x^455 + x^454 - x^453 + x^450 + 1/2*x^449 - x^448 + 2*x^446 - 14*x^444 - 1/9*x^443 + 1/5*x^442 + x^441 - x^440 - 3/2*x^438 - x^437 - 17*x^436 + x^435 - x^434 - 2/3*x^433 + x^432 + 1/2*x^431 + 2/9*x^430 + x^426 + 4/3*x^423 - 1/2*x^422 + 4*x^420 + 1/18*x^419 - 1/2*x^418 - x^416 - 2/9*x^414 + 75*x^413 + x^412 - 1/2*x^410 - 1/4*x^409 + 3*x^408 + 1/2*x^407 + 1/2*x^406 - x^405 - 1/19*x^403 - x^401 - 5/2*x^400 + 1/6*x^399 - 1/4*x^397 - 1/3*x^394 + 4*x^393 - 1/2*x^392 - 1/2*x^390 + x^389 + 2/5*x^388 + x^387 + x^386 - x^384 - 4/7*x^383 - 2/11*x^381 - 1/3*x^380 - 21*x^379 + 2*x^378 + x^377 - 1/28*x^376 - 1/40*x^375 + 1/8*x^374 + 2*x^373 - 2/21*x^372 + x^371 - x^370 - x^369 + x^368 + 1/5*x^367 - x^366 - x^365 - 1/82*x^362 + 3*x^361 - 6/5*x^360 - 1/23*x^359 - 1/2*x^358 + 5*x^357 - x^356 + x^355 + 3*x^354 + 2*x^353 + x^351 - 1/6*x^350 + 1/2*x^349 + x^348 + 2/5*x^347 - 334*x^346 + 2/7*x^345 + x^344 - 32*x^343 + 2/9*x^342 - 2*x^341 + 1/4*x^339 - 6*x^338 - 1/3*x^337 - x^336 - x^335 + x^334 - 3*x^332 - x^331 - 2*x^330 - 2*x^327 - 1/7*x^326 - 12/17*x^323 + 1/8*x^322 + x^321 - 1/3*x^320 + x^319 - x^318 + 1/10*x^316 + 6/5*x^315 + 7/3*x^314 + x^313 + 1/3*x^312 + 1/2*x^309 - x^308 + x^307 + 1/5*x^305 - x^303 + x^302 - 1/2*x^301 - x^300 - 8*x^299 - 5/3*x^298 - 1/4*x^297 + 2*x^296 - 1/2*x^295 + 3/2*x^293 - 3*x^292 - 75*x^290 + 10*x^289 - 1/2*x^288 + x^287 + x^285 - 7/2*x^284 + 8/3*x^283 + 4*x^282 + 2*x^281 - 1/6*x^280 - x^278 + 1/3*x^276 - x^275 - 1/5*x^274 - 7/2*x^272 - 5/6*x^271 - x^269 - x^266 + 24*x^265 - 4/5*x^264 - 7/5*x^262 + 6*x^261 + 27*x^259 - x^258 - 1/2*x^256 + 6*x^255 + x^254 - 2*x^252 + x^251 - 1/2*x^250 + 2*x^249 - 5/3*x^248 + 2/5*x^247 - 1/6*x^246 + 1/13*x^245 + 1/2*x^243 - 1/19*x^241 - 4*x^240 - 1/3*x^239 - x^238 - 2/3*x^237 - x^236 - 1/5*x^235 + 1/30*x^234 + 10*x^233 + 1/2*x^232 - x^231 - x^230 - 6*x^229 + 6*x^227 + 6*x^226 + x^225 - x^222 + x^220 + 10*x^219 + 5/2*x^218 + 1/2*x^217 - x^216 - 11/4*x^215 + 10/101*x^214 - x^213 + 2*x^212 - 1/2*x^211 + x^210 + x^209 - x^208 - 1/78*x^207 + x^206 - 9*x^205 + 3*x^204 + 3*x^203 - x^202 - x^200 + 3*x^199 + 2*x^198 - 4*x^197 + x^196 + 2/3*x^195 - 2*x^194 + x^193 + 13/3*x^192 - 2*x^191 - 1/4*x^190 + x^189 - 1/3*x^188 + x^187 - 2/3*x^186 + 5*x^185 + 1/2*x^184 - 1/19*x^183 + x^182 + 3*x^181 + 11*x^178 + 2/3*x^175 - 1/4*x^174 + x^173 + x^172 + 1/2*x^170 - 50*x^169 - x^167 + 6*x^165 + 3*x^163 - 1/4*x^162 + x^161 + 1/18*x^160 + x^158 - 8*x^157 + 18*x^156 + 1/2*x^155 - 5*x^154 + 1/11*x^153 - x^152 + 1/2*x^151 + x^150 + x^149 + 2*x^146 + 7/2*x^145 + 31/15*x^143 - 2*x^142 + x^140 - 1/2*x^139 + x^137 + 1/5*x^136 + 13/112*x^134 - 4*x^133 - 1/7*x^132 - 7/2*x^131 - 13*x^130 - x^129 + x^128 - x^127 - 5*x^126 - 3/13*x^125 - 3/2*x^124 + 1/2*x^123 - 2/3*x^121 - 1/9*x^120 + x^119 + 1/2*x^118 + 1/3*x^115 - 1/4*x^114 + 1/6*x^113 - 1/2*x^112 + x^110 - x^109 + 161*x^108 - 3/2*x^107 - 1/2*x^105 + x^104 + 5*x^102 - 7*x^101 + 1/3*x^100 + 1/3*x^99 - 1/3*x^98 - 2*x^97 + x^96 - 2*x^95 - 2*x^94 - x^92 + 2*x^89 - x^88 + 2*x^86 - x^84 + x^81 + 25*x^80 + 3/5*x^79 - 10/13*x^78 + 5/6*x^77 + 2*x^76 - x^75 + x^73 - 8*x^72 + 2*x^71 + 1/19*x^70 - 9*x^69 + 1/23*x^68 - 1/2*x^67 - x^66 - 1/3*x^63 + 1/2*x^62 - 13*x^61 + x^60 + 7*x^58 - 1/9*x^56 - x^55 - 2/79*x^54 - 1/11*x^53 + x^52 + 1/3*x^51 + 14*x^50 + 2/3*x^48 + 1/2*x^47 - x^46 - 3/4*x^45 - 2/21*x^43 - 2/3*x^42 - 2/5*x^38 - 1/3*x^36 + 2*x^35 - x^33 - 2*x^32 + x^31 + 1/6*x^29 + 2/3*x^28 + 1/2*x^27 + 1/2*x^26 + 1/2*x^25 + 2*x^24 - 1/7*x^23 - 3*x^22 - 1/6*x^21 - 1/2*x^20 + 3*x^19 - x^16 + 1/16*x^15 + 2*x^14 - 4/3*x^13 + x^12 + 5*x^11 + x^10 - x^9 - 8*x^7 - 2*x^6 - 45/2*x^3 + 2*x^2 - 1/2"}︡{"stdout":"\n"}︡{"done":true} ︠a8d0891e-ff25-4862-a460-25a089ee6118s︠ f.factor() ︡5cc92b09-0b86-40cd-9a16-79cae15eeb3e︡︡{"stderr":"Error in lines 1-1\n"}︡{"stderr":"Traceback (most recent call last):\n File \"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 905, in execute\n exec compile(block+'\\n', '', 'single') in namespace, locals\n File \"\", line 1, in \n File \"sage/rings/polynomial/polynomial_element.pyx\", line 3674, in sage.rings.polynomial.polynomial_element.Polynomial.factor (/projects/sage/sage-6.10/src/build/cythonized/sage/rings/polynomial/polynomial_element.c:32746)\n return R._factor_univariate_polynomial(self, **kwargs)\n File \"/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/rings/rational_field.py\", line 1306, in _factor_univariate_polynomial\n G = list(f._pari_with_name().factor())\n"}︡{"stderr":" File \"sage/libs/pari/gen.pyx\", line 8987, in sage.libs.pari.gen.gen.factor (/projects/sage/sage-6.10/src/build/cythonized/sage/libs/pari/gen.c:140712)\n pari_catch_sig_on()\n"}︡{"stderr":" File \"sage/ext/interrupt/interrupt.pyx\", line 88, in sage.ext.interrupt.interrupt.sig_raise_exception (/projects/sage/sage-6.10/src/build/cythonized/sage/ext/interrupt/interrupt.c:924)\n raise KeyboardInterrupt\nKeyboardInterrupt\n"}︡{"done":true} ︠c4adae0a-9675-4f51-b2f2-fa17e7813c3es︠ for p in primes(100): try: v = [g[0].degree() for g in f.factor_mod(p)] print p, v except: pass ︡cdaed6b0-1bb3-4bc1-a2c7-adf925aad322︡︡{"stdout":"37"}︡{"stdout":" [1, 3, 5, 13, 34, 94, 211, 439]\n43"}︡{"stdout":" [1, 1, 1, 8, 13, 23, 28, 725]\n47"}︡{"stdout":" [1, 1, 1, 10, 11, 20, 264, 492]\n53"}︡{"stdout":" [1, 1, 3, 8, 34, 142, 171, 440]\n59"}︡{"stdout":" [1, 3, 29, 45, 71, 106, 135, 410]\n67"}︡{"stdout":" [1, 2, 2, 54, 60, 137, 544]\n71"}︡{"stdout":" [2, 21, 24, 240, 513]\n73"}︡{"stdout":" [1, 1, 1, 19, 23, 45, 710]\n83"}︡{"stdout":" [22, 30, 211, 537]\n97"}︡{"stdout":" [1, 5, 26, 101, 142, 231, 294]\n"}︡{"done":true} ︠edec08af-5a0d-4476-9636-48d9addbd55as︠ %time f.is_irreducible() ︡eb9baf00-e149-4260-ae64-59744c84eaa2︡︡{"stdout":"True"}︡{"stdout":"\n"}︡{"stdout":"CPU time: 1.06 s, Wall time: 1.10 s\n"}︡{"done":true} ︠91b975b7-1d2a-46fe-84e8-16c123d73851s︠ f.factor() ︡4d0a4d25-f329-44bb-aede-0dc091e0a438︡︡{"stdout":"(-1/32) * x * (x^29 + 64*x^28 + 32*x^26 + 4/3*x^25 - 416*x^24 - 1568*x^23 + 192/7*x^22 - 256*x^21 + 64*x^20 - 32*x^19 + 64/3*x^18 - 16*x^17 - 32*x^16 + 32*x^15 - 32*x^14 + 32*x^13 + 32/5*x^11 - 80*x^10 - 32*x^9 - 32*x^8 + 64*x^6 - 32*x^5 + 16*x^4 + 32/9*x^3 - 8/9*x^2 + 192)\n"}︡{"done":true} ︠9104fe75-f9cd-4b57-ad0b-cfdcf39c2a1as︠ factorial(7) ︡fbc6f778-4c99-4ab1-9928-ea648746fcc2︡︡{"stdout":"5040\n"}︡{"done":true} ︠1e46cf42-3b10-4c55-b6d1-f8ab8d870152︠