? 2+3 %1 = 5 ? 2*3 %2 = 6 ? gcd(53535,3737626) %3 = 1 ? bezout(53535,3737626) %4 = [-1643201, 23536, 1] ? 53535*%4[1]+3737626*%[2] %5 = 1 ? 53535*%4[1]+3737626*%4[2] %6 = 1 ? 663636%7 %7 = 1 ? Mod(663636,7) %8 = Mod(1, 7) ? Mod(663636*565353,7) %9 = Mod(5, 7) ? Mod(663636,7)*Mod(565353,7) %10 = Mod(5, 7) ? Mod(663636^737737373737,7) *** length (lg) overflow ? Mod(663636,7)^737737373737 %11 = Mod(1, 7) ? Mod(663633,7)^737737373737 *** Warning: large exponent in Mod(a,N)^n: reduce n mod phi(N). %12 = Mod(5, 7) ? chinese(Mod(3,7),Mod(5,8)) %13 = Mod(45, 56) ? eulerphi(56) %14 = 24 ? factor(56) %15 = [2 3] [7 1] ? %15[1,2] %16 = 3 ? %15[2,1] %17 = 7 ? ?isprime isprime(x,{flag=0}): true(1) if x is a (proven) prime number, false(0) if not. If flag is 0 or omitted, use a combination of algorithms. If flag is 1, the primality is certified by the Pocklington-Lehmer Test. If flag is 2, the primality is certified using the APRCL test. ? ? Help topics: for a list of relevant subtopics, type ?n for n in 0: user-defined identifiers (variable, alias, function) 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 looks 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 ffinit fibonacci gcd hilbert isfundamental ispower isprime ispseudoprime issquare issquarefree kronecker lcm moebius nextprime numbpart numdiv omega precprime prime primepi primes qfbclassno qfbcompraw qfbhclassno qfbnucomp qfbnupow qfbpowraw qfbprimeform qfbred qfbsolve quadclassunit quaddisc quadgen quadhilbert quadpoly quadray quadregulator quadunit removeprimes sigma sqrtint zncoppersmith znlog znorder znprimroot znstar ? ?ispseudoprime ispseudoprime(x,{n}): true(1) if x is a strong pseudoprime, false(0) if not. If n is 0 or omitted, use BPSW test, otherwise use strong Rabin-Miller test for n randomly chosen bases. ? isprime(3747738784738274728877721) %18 = 0 ? ispseudoprime(3747738784738274728877721) %19 = 0 ? factor(3747738784738274728877721) %20 = [3 1] [289573 1] [13439317 1] [321005737627 1] ? for(n=1,100,if(isprime(n)&&n%8==1,print(n," ","hello"))) 17 hello 41 hello 73 hello 89 hello 97 hello ? for(n=1,100,if(isprime(n)&&n%8==1,print(n," ","hello"),if(n==50,break))) 17 hello 41 hello ? for(n=1,100,if(isprime(n)&&n%8==1,print(n," ","hello"),if(n==50,print("goodbye");break))) 17 hello 41 hello goodbye ? n=1000;while(!isprime(n),n++);n %21 = 1009 ? ? Help topics: for a list of relevant subtopics, type ?n for n in 0: user-defined identifiers (variable, alias, function) 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 looks 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). ? ?11 addhelp alias allocatemem break default error extern for fordiv forell forprime forstep forsubgroup forvec getheap getrand getstack gettime global if input install kill next print print1 printp printp1 printtex quit read readvec reorder return setrand system trap type until whatnow while write write1 writebin writetex ? \rlesson.gp ? function(a,b)=for(n=a,b,if(n%2==1,if(Mod(3,n)^(n-1)==Mod(1,n),return(n);break))) ? ?function function(a, b) = for(n=a,b,if(n%2==1,if(Mod(3,n)^(n-1)==Mod(1,n),return(n);break))) ? function(100,200) %22 = 101 ? \rlesson.gp ? function(a,b)=for(n=a,b,if(n%2==1&&!isprime(n),if(Mod(3,n)^(n-1)==Mod(1,n),return(n);break))) ? ?function function(a, b) = for(n=a,b,if(n%2==1&&!isprime(n),if(Mod(3,n)^(n-1)==Mod(1,n),return(n);break))) ? function(100,200) %23 = 121 ? \rlesson.gp ? function(a,b)=for(n=a,b,if(n%2==1&&!isprime(n),if(Mod(3,n)^(n-1)==Mod(1,n),return(n);break))) ? function(1000,2000) %24 = 1105 ? \q Goodbye!