Sum of squares
This applet finds the decomposition of any positive number greater than 1 into up to four squares.
Notice that it does not find the prime factorization of the number entered by the user, so some cases where two squares would be enough, it will be represented as a sum of three squares. For example, 10000998089 = 95317² + 30260².
Read the methods used in this applet.
You can also enter expressions that use the following operators and parentheses:
- + for addition
- - for subtraction
- * for multiplication
- / for integer division
- % for remainder
- ^ or ** for exponentiation
- n!: factorial
- p#: primorial (product of all primes less or equal than p).
- B(n): Previous pseudoprime to n
- F(n): Fibonacci number Fn
- L(n): Lucas number Ln = Fn-1 + Fn+1
- N(n): Next pseudoprime to n
- P(n): Unrestricted Partition Number (number of decompositions of n into sums of integers without regard to order).
You can use the prefix 0x for hexadecimal numbers, for example 0x38 is equal to 56.
Written by Dario Alpern. Last updated 2 August 2016.
If you find any error or you have a comment, please fill in the form.