?2+3 %1 = 5 ?factor(18383737373773727282991209202020222112222222111) %2 = [3 1] [11 1] [13 1] [231114187 1] [21092986417 1] [53128852859 1] [165455572072019 1] ?gcd(173737372372727272,282818180920202020221111) %3 = 1 ?bezout(173737372372727272,282818180920202020221111) %4 = [-24662433496369401212531, 15150321588361103, 1] ?%4[1]*173737372372727272+%4[2]*282818180920202020221111 %5 = 1 ?v=[173737372372727272,282818180920202020221111] %6 = [173737372372727272, 282818180920202020221111] ?v[1] %7 = 173737372372727272 ?v[2] %8 = 282818180920202020221111 ?v[1]*v[2] %9 = 49136087612310489748696032746195539839192 ?gcd(v[1],v[2]) %10 = 1 ?%2[3,1] %11 = 13 ?%2[3,2] %12 = 1 ?%2[5,2] %13 = 1 ?%2[5,1] %14 = 21092986417 ?factor(18) %15 = [2 1] [3 2] ?w=factor(18) %16 = [2 1] [3 2] ?w[1,] %17 = [2, 1] ?w[,1] %18 = [2, 3]~ ?w[,1]~ %19 = [2, 3] ?? Help topics: for a list of relevant subtopics, type ?n for n in 0: user-defined functions (aliases, installed and user functions) 1: Standard monadic or dyadic OPERATORS 2: CONVERSIONS and similar elementary functions 3: TRANSCENDENTAL functions 4: NUMBER THEORETICAL functions 5: Functions related to ELLIPTIC CURVES 6: Functions related to general NUMBER FIELDS 7: POLYNOMIALS and power series 8: Vectors, matrices, LINEAR ALGEBRA and sets 9: SUMS, products, integrals and similar functions 10: GRAPHIC functions 11: PROGRAMMING under GP 12: The PARI community Also: ? functionname (short on-line help) ?\ (keyboard shortcuts) ?. (member functions) Extended help (if available): ?? (opens the full user's manual in a dvi previewer) ?? tutorial / refcard / libpari (tutorial/reference card/libpari manual) ?? keyword (long help text about "keyword" from the user's manual) ??? keyword (a propos: list of related functions). ??4 addprimes bestappr bezout bezoutres bigomega binomial chinese content contfrac contfracpnqn core coredisc dirdiv direuler dirmul divisors eulerphi factor factorback factorcantor factorff factorial factorint factormod ffgen ffinit fflog fforder ffprimroot fibonacci gcd hilbert isfundamental ispower isprime ispseudoprime issquare issquarefree kronecker lcm moebius nextprime numbpart numdiv omega partitions polrootsff precprime prime primepi primes qfbclassno qfbcompraw qfbhclassno qfbnucomp qfbnupow qfbpowraw qfbprimeform qfbred qfbsolve quadclassunit quaddisc quadgen quadhilbert quadpoly quadray quadregulator quadunit removeprimes sigma sqrtint stirling sumdedekind zncoppersmith znlog znorder znprimroot znstar ??bezout bezout(x,y): returns [u,v,d] such that d=gcd(x,y) and u*x+v*y=d. ??bezout bezout(x,y): returns [u,v,d] such that d=gcd(x,y) and u*x+v*y=d. ?isprime(3774874874874773878743878378383773374439811) %20 = 0 ?factor(3774874874874773878743878378383773374439811) %21 = [17 1] [25013 1] [71549 1] [3360433939 1] [36922315221269493424481 1] ?3^10000 %22 = 1631350185342625874303256729181154716812132453582537993934820326191825730814319078748015563084784830967325204522323579543340558299917720385238147914536811250145319235516622439102542362884355668655965964501201417744827552999037327442544642575123553734186738760781361993722561687286201650480559317405990952046166850066311892691157177345225585062696852625187913986708508047253964093373024341015218691432891735457685445727419556221801333774562850247067305942699911420254077317598819984248727618368529938892782529678644025299944478569418367532352170443219578580627012338838293177019899084130086150699610894478206501516341034489494580933768915680768667346256303816479219066534012434413398076320559436475496345156407234050260637779058511412381491900163717703445738501993906023292519447111423589297856532241562834414218484289208346622787576050127600980153070303752583915789387574119249770530046969106245436992679597545634023677773435466713907260157496983431276965355718439614758707126044394794486223574445971120447306293776415377003021033218363553181817345661802274597505531321259851442958754554729653460959719483603654687049177192762521435295750345494840363582234572877488517580950015845183738941379809532971199309210141742840677432612645000546788873654625494865860248449453593888865654274697742436838533549608316492131860193497702509578037010430798027635685735034920586607837180606554239353610167340201798095159894698066433039150584580367424834887807101041291866733582384989962348621505030405257778984851241026383481171923694931142341182358531640508530616493667113745698539428567732477177504605097086552089359615168701715385575519734819965907019295477130834762711105247113447632598636283858595955220964538208905518287185486674463373753321752488011840178759509406085571701014408713649553241854424148943708007471615840489591413645180203244670796105875763334569169674329386962374541087005185159067285934706121257344657204508846546061682608257973168600458521828433345239615773003630637942182243581800150590520391820920696966232670695262351242738024046878411453510149673398340124021984004895673368930962032161379375715672756246165193339754026679596386592159091332206057267334984925330339787424238196077533718273003778369870874878173841974769888032160118631050633286970493130307683944479096833930630127337101408724806094685179369797311443270675928854607762283100252680055484969686771028094594660366959379735464213662223119269502732122951191295294032087976312315176055595949696116314145568827884294958728839910027369188001877414756889265018615206533521911307258241769961690199553024993773521909978675895489253436583523584315611279972816412346121981734390478240251711160320657533052785075256464299531806498590081555797994588593112435130325281125525429579708228194665879870597907749246984964418316658595084495316472689614616829780817839847045156132052618054231084074484310746936895970772683660847181706059877173017075544647344077403137122743765104842160622475752708595851594727315102740066294816111128477782810353149948891367280078316788805117715542728510386173665806940479769590075882046523867397088266016228510759922141874365700687253784267788370880751585039769181243388056177265236484729701950802584896483388322516566898693508127459629398312186404627726859040158020905998850051126247016715049526190813668869386132408155904633628896303709031203352240072236088249492818280907540691431995704492750442079727811783767743144697908575643299075358258810244024061103908451640108994886843335374844410463973407451916506763294141934798562443556734207281591075448412381291748731293828067040322818881300397838408133224248464657141757440485296267516561610152736742565486950871200178839384617178045745596304576494356596488751839648129615990247199673550885429296453679677940437723096572336162518203079829773478585460606032341909164671113867849092884010744992[+++] ??default default({key},{val}): returns the current value of the default key. If val is present, set opt to val first. If no argument is given, print a list of all defaults as well as their values. ?3^10000%101 %23 = 1 ?3^10000%103 %24 = 81 ?Mod(3,101)^10000 %25 = Mod(1, 101) ?3^100000000000%103 at top-level: ^100000000000%103 ^----------------- *** _^s: the PARI stack overflows ! current stack size: 8000000 (7.629 Mbytes) [hint] you can increase GP stack with allocatemem() *** Break loop: type 'break' to go back to GP break> break ?allocatemem() *** Warning: new stack size = 16000000 (15.259 Mbytes). ?allocatemem() *** Warning: new stack size = 32000000 (30.518 Mbytes). ?allocatemem() *** Warning: new stack size = 64000000 (61.035 Mbytes). ?allocatemem() *** Warning: new stack size = 128000000 (122.070 Mbytes). ?allocatemem() *** Warning: new stack size = 256000000 (244.141 Mbytes). ?3^100000000000%103 at top-level: ^100000000000%103 ^----------------- *** _^s: the PARI stack overflows ! current stack size: 256000000 (244.141 Mbytes) [hint] you can increase GP stack with allocatemem() *** Break loop: type 'break' to go back to GP break>break ?Mod(3,103)^100000000000 %26 = Mod(76, 103) ?Mod(3^100000000000,103) at top-level: ^100000000000,103) ^------------------ *** _^s: the PARI stack overflows ! current stack size: 256000000 (244.141 Mbytes) [hint] you can increase GP stack with allocatemem() *** Break loop: type 'break' to go back to GP at top-level: ^100000000000,103) ^------------------ *** _^s: user interrupt after at top-level: ^100000000000,103) ^------------------ break> break ?Mod(3723727277272727272727272,1039299292929292929292)^10000000000000000 %27 = Mod(652690466722500883612, 1039299292929292929292) ?Mod(3,101)*(Mod(5,101) syntax error, unexpected $end, expecting )-> or ',' or ')': ) ^- ?Mod(3,101)*Mod(5,101) %28 = Mod(15, 101) ?Mod(3,101)*Mod(5,103) %29 = Mod(0, 1) ?for(n=1,10,print(Mod(3,1001)^n)) Mod(3, 1001) Mod(9, 1001) Mod(27, 1001) Mod(81, 1001) Mod(243, 1001) Mod(729, 1001) Mod(185, 1001) Mod(555, 1001) Mod(664, 1001) Mod(991, 1001) ?for(n=1,10,print(n,"hello ",Mod(3,1001)^n)) 1hello Mod(3, 1001) 2hello Mod(9, 1001) 3hello Mod(27, 1001) 4hello Mod(81, 1001) 5hello Mod(243, 1001) 6hello Mod(729, 1001) 7hello Mod(185, 1001) 8hello Mod(555, 1001) 9hello Mod(664, 1001) 10hello Mod(991, 1001) ?for(n=1,1000,if(Mod(3,1001)^n==Mod(1,1001),print(n))) 30 60 90 120 150 180 210 240 270 300 330 360 390 420 450 480 510 540 570 600 630 660 690 720 750 780 810 840 870 900 930 960 990 ?for(n=1,1000,if(Mod(3,1001)^n==Mod(1,1001),print(n);break)) 30 ?znorder(Mod(3,1001)) %30 = 30 ??znorder znorder(x,{o}): order of the integermod x in (Z/nZ)*. Optional o represents a multiple of the order of the element. ?p=nextprime(100000000) %31 = 100000007 ?znprimroot(p) %32 = Mod(5, 100000007) ?lift(%) %33 = 5 ??zeta zeta(s): Riemann zeta function at s with s a complex or a p-adic number. ?zeta(2) %34 = 1.6449340668482264364724151666460251892 ?Pi^2/6 %35 = 1.6449340668482264364724151666460251892 ?myfunction(p)=if(isprime(p),return(znprimroot(p)^2)) %36 = (p)->if(isprime(p),return(znprimroot(p)^2)) ?myfunction(100) ?myfunction(101) %37 = Mod(4, 101) ?\rmyfile *** error opening input file: `myfile'. *** Break loop: type 'break' to go back to GP break>break ?\q ?for(n=1,10,if(n%2==0&&n%3==0,print(n," yes"),print(n," no"))) 1 no 2 no 3 no 4 no 5 no 6 yes 7 no 8 no 9 no 10 no ?for(n=1,10,if(n%2==0||n%3==0,print(n," yes"),print(n," no"))) 1 no 2 yes 3 yes 4 yes 5 no 6 yes 7 no 8 yes 9 yes 10 yes ?\q