ArticleslgStudy

mathematics

Sum of squares function

Sum of squares function is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Sum of squares function rather than just read about it. In short: In number theory, the sum of squares function is an arithmetic function that gives the number of representations for a given positive integer n {\displaystyle n} as the sum of k {\displaystyle k} squares, where representations that differ only in the order of the summands or in the signs of the numbers being squared are counted as different. It is denoted by r k ( n ) {\displaystyle r_{k}(n)} .

Sum of squares function — main illustration
Sum of squares function — illustration

Key takeaways

  • Sum of squares function belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Sum of squares function to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Sum of squares function from memory before moving on to harder problems.

Reference excerpt

In number theory, the sum of squares function is an arithmetic function that gives the number of representations for a given positive integer n {\displaystyle n} as the sum of k {\displaystyle k} squares, where representations that differ only in the order of the summands or in the signs of the numbers being squared are counted as different. It is denoted by r k ( n ) {\displaystyle r_{k}(n)} .

Definition The function is defined as

r k ( n ) = | { ( a 1 , a 2 , … , a k ) ∈ Z k : n = a 1 2 + a 2 2 + ⋯ + a k 2 } | {\displaystyle r_{k}(n)=|\{(a_{1},a_{2},\ldots ,a_{k})\in \mathbb {Z} ^{k}\ :\ n=a_{1}^{2}+a_{2}^{2}+\cdots +a_{k}^{2}\}|}

where | | {\displaystyle |\,\ |} denotes the cardinality of a set. In other words, r k ( n ) {\displaystyle r_{k}(n)} is the number of ways n {\displaystyle n} can be written as a sum of k {\displaystyle k} squares. For example, r 2 ( 1 ) = 4 {\displaystyle r_{2}(1)=4} since 1 = 0 2 + ( ± 1 ) 2 = ( ± 1 ) 2 + 0 2 {\displaystyle 1=0^{2}+(\pm 1)^{2}=(\pm 1)^{2}+0^{2}} where each sum has two sign combinations, and also r 2 ( 2 ) = 4 {\displaystyle r_{2}(2)=4} since 2 = ( ± 1 ) 2 + ( ± 1 ) 2 {\displaystyle 2=(\pm 1)^{2}+(\pm 1)^{2}} with four sign combinations. On the other hand, r 2 ( 3 ) = 0 {\displaystyle r_{2}(3)=0} because there is no way to represent 3 as a sum of two squares.

Formulae

k = 2

The number of ways to write a natural number as sum of two squares is given by r 2 ( n ) {\displaystyle r_{2}(n)} . It is given explicitly by

r 2 ( n ) = 4 ( d 1 ( n ) − d 3 ( n ) ) {\displaystyle r_{2}(n)=4(d_{1}(n)-d_{3}(n))}

where d 1 ( n ) {\displaystyle d_{1}(n)} is the number of divisors of n {\displaystyle n} which are congruent to 1 modulo 4 and d 3 ( n ) {\displaystyle d_{3}(n)} is the number of divisors of n {\displaystyle n} which are congruent to 3 modulo 4. Using sums, the expression can be written as:

r 2 ( n ) = 4 ∑ d ∣ n d ≡ 1 , 3 ( mod 4 ) ( − 1 ) ( d − 1 ) / 2 {\displaystyle r_{2}(n)=4\sum _{d\mid n \atop d\,\equiv \,1,3{\pmod {4}}}(-1)^{(d-1)/2}}

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Sum of squares function

Start with the simplest possible case. Write down what Sum of squares function claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Sum of squares function before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Sum of squares function ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Sum of squares function

In research
Sum of squares function appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Sum of squares function in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Sum of squares function is common in secondary-school and first-year university syllabi. It links to neighbouring topics Arithmetic functions, Integer factorization algorithms, Squares in number theory, so understanding it makes those chapters shorter.
In everyday life
Look for Sum of squares function outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Sum of squares function in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Sum of squares function means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Sum of squares function out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Sum of squares function in simple terms?

In number theory, the sum of squares function is an arithmetic function that gives the number of representations for a given positive integer n {\displaystyle n} as the sum of k {\displaystyle k} squares, where representations that differ only in the order of the summands or in the signs of the num…

Why does Sum of squares function matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Sum of squares function?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Sum of squares function.

Tags

  • Arithmetic functions
  • Integer factorization algorithms
  • Squares in number theory

Keep exploring