squares_r function
How many ways a whole number is a sum of a given count of squares, counting order and signs.
How to write it
squares_r(d, n)
- d
- How many squares. Takes a whole number.
- n
- The number to write as a sum. Takes a whole number.
Examples
squares_r(2, 5)In the solver,
Open in the solversquares_r(2, 5)gives8.
Related functions
- stirling_s1
Stirling number of the first kind, with sign.
- solve_congruence
Solve a congruence for a variable.
- stirling_s2
Stirling number of the second kind: the ways to split n items into k groups.
- primitive_root
A primitive root of a prime: a number whose powers cover all the nonzero residues.
- subfactorial
Subfactorial: how many ways to reorder n items so none stays in place.
- prime_pi
How many primes are at most a number.