(19:56) gp > 2+2 \\ basic (and \\ is the "comment to end of line" character sequence) %1 = 4 (19:56) gp > 100! \\ not as basic %2 = 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 (19:57) gp > 1/(1-x) \\ try to make a power series %3 = -1/(x - 1) \\ oops, too smart, gp treats rational functions as exact expressions (19:57) gp > 1/(1-x)+O(x^10) \\ coerce it into a power series %4 = 1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + O(x^10) (19:57) gp > taylor(1/(1-x),x) \\ another way: explicitly ask for taylor series %5 = 1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^10 + x^11 + x^12 + x^13 + x^14 + x^15 + O(x^16) (19:57) gp > ? \\ type ? to get help Help topics: for a list of relevant subtopics, type ?n for n in 0: user-defined functions (aliases, installed and user functions) 1: PROGRAMMING under GP 2: Standard monadic or dyadic OPERATORS 3: CONVERSIONS and similar elementary functions 4: functions related to COMBINATORICS 5: NUMBER THEORETICAL functions 6: POLYNOMIALS and power series 7: Vectors, matrices, LINEAR ALGEBRA and sets 8: TRANSCENDENTAL functions 9: SUMS, products, integrals and similar functions 10: General NUMBER FIELDS 11: Associative and central simple ALGEBRAS 12: ELLIPTIC CURVES 13: L-FUNCTIONS 14: HYPERGEOMETRIC MOTIVES 15: MODULAR FORMS 16: MODULAR SYMBOLS 17: GRAPHIC functions 18: 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) ?? refcard-ell (or -lfun/-mf/-nf: specialized reference card) ?? keyword (long help text about "keyword" from the user's manual) ??? keyword (a propos: list of related functions). (19:57) gp > ?4 \\ look at section 4 bernfrac bernpol bernreal bernvec binomial eulerfrac eulerianpol eulerpol eulerreal eulervec fibonacci hammingweight harmonic numbpart numtoperm partitions permcycles permorder permsign permtonum stirling (19:57) gp > ?numbpart numbpart(n): number of partitions of n. (19:58) gp > sum(i=0,10,numbpart(i)*x^i)+O(x^11) \\ OGF of partitions %6 = 1 + x + 2*x^2 + 3*x^3 + 5*x^4 + 7*x^5 + 11*x^6 + 15*x^7 + 22*x^8 + 30*x^9 + 42*x^10 + O(x^11) (19:58) gp > prod(i=1,10,1/(1-x^i)+O(x^11)) \\ Euler's formula for the same %7 = 1 + x + 2*x^2 + 3*x^3 + 5*x^4 + 7*x^5 + 11*x^6 + 15*x^7 + 22*x^8 + 30*x^9 + 42*x^10 + O(x^11) (19:59) gp > %6-%7 \\ check if they match %8 = O(x^11) \\ they do, to the desired accuracy (19:59) gp > quit \\ all done