? 2+3 %1 = 5 ? factor(2727727271717171717171717727273883393939393) %2 = [ 491 1] [ 7753 1] [ 186041 1] [3851598460485572359677805325251 1] ? factor(27) %3 = [3 3] ? 105%7 %4 = 0 ? Mod(105,7) %5 = Mod(0, 7) ? Mod(100000000,101) %6 = Mod(1, 101) ? Mod(1000000020,101) %7 = Mod(30, 101) ? Mod(1000000020,101)^2 %8 = Mod(92, 101) ? %7^2 %9 = Mod(92, 101) ? %7^5 %10 = Mod(6, 101) ? a=%9 %11 = Mod(92, 101) ? b=%7 %12 = Mod(30, 101) ? a+b %13 = Mod(21, 101) ? a+b^3 %14 = Mod(24, 101) ? a^1000000000000000000000000000000000000 *** _^_: Warning: Mod(a,b)^n with n >> b : wasteful. %15 = Mod(1, 101) ? Mod(2,1010100101010010101010010101010101)^923929299292929292 %16 = Mod(637039225939229545751688663340168, 1010100101010010101010010101010101) ? for(n=1,100,if(Mod(2,101)^n==Mod(1,101),print(n))) 100 ? for(n=1,100,if(Mod(3,101)^n==Mod(1,101),print(n))) 100 ? for(n=1,100,if(Mod(5,101)^n==Mod(1,101),print(n))) 25 50 75 100 ? for(n=1,100,if(Mod(5,101)^n==Mod(1,101),print(n);break)) 25 ? for(n=1,100,if(Mod(5,101)^n==Mod(1,101),print(n);break,print("oops"))) oops oops oops oops oops oops oops oops oops oops oops oops oops oops oops oops oops oops oops oops oops oops oops oops 25 ? ?fordiv fordiv(n,X,seq): the sequence is evaluated, X running over the divisors of n. ? fordiv(100,n,if(Mod(5,101)^n==Mod(1,101),print(n)) *** syntax error, unexpected $end, expecting )-> or ',' or ')': *** ...1)^n==Mod(1,101),print(n)) *** ^- ? fordiv(100,n,if(Mod(5,101)^n==Mod(1,101),print(n))) 25 50 100 ? fordiv(100,n,if(Mod(5,101)^n==Mod(1,101),print(n);break)) 25 ? znorder(Mod(5,101)) %24 = 25 ? ?znorder znorder(x,{o}): order of the integermod x in (Z/nZ)*. Optional o represents a multiple of the order of the element. ? for(n=20,100,if(znorder(Mod(n,101))==100,print(n);break)) 26 ? znprimroot(101) %26 = Mod(2, 101) ? ? 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 bestapprPade bezout bigomega binomial chinese content contfrac contfracpnqn core coredisc dirdiv direuler dirmul divisors eulerphi factor factorback factorcantor factorff factorial factorint factormod ffgen ffinit fflog ffnbirred fforder ffprimroot fibonacci gcd gcdext hilbert isfundamental ispolygonal ispower ispowerful isprime isprimepower ispseudoprime issquare issquarefree istotient kronecker lcm logint 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 randomprime removeprimes sigma sqrtint sqrtnint stirling sumdedekind sumdigits zncoppersmith znlog znorder znprimroot znstar ? gcd(10298289281273872872328,17837328783728787287282873) %27 = 1 ? gcd(10298289281273872872328,17837328783728787287282872) %28 = 8 ? bezout(10298289281273872872328,17837328783728787287282872) %29 = [609294442679515732492050, -351772987102753193911, 8] ? v=%29 %30 = [609294442679515732492050, -351772987102753193911, 8] ? w=[10298289281273872872328,17837328783728787287282872] %31 = [10298289281273872872328, 17837328783728787287282872] ? v[1]*w[1]+v[2]*w[2] %32 = 8 ? v[1]*w[1]+v[2]*w[2]==v[3] %33 = 1 ? v[1]*w[1]+v[2]*w[2]==7 %34 = 0 ? ? 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). ? # timer = 1 (on) ? bezout(10298289281273872872328,17837328783728787287282872) %35 = [609294442679515732492050, -351772987102753193911, 8] ? # timer = 0 (off) ? myfunction(n)=n^2 %36 = (n)->n^2 ? myfunction(9) %37 = 81 ? \q