Chapter

Functional Equations on Integers

A module on discrete functional equations: induction, parity, divisibility, recurrences, residue classes, and finite domains.
Log in to track solved progress and bookmarks.

Theory

Key Idea

On the integers, a functional equation often becomes a recurrence. Instead of continuity, we use induction, parity, divisibility, residue classes, and finiteness of the domain. It is important not to transfer real-domain methods automatically: on \(\mathbb Z\), one can move by one step or by separate residue classes.

Basic Facts

If \(f(m+n)=f(m)+f(n)\) on \(\mathbb Z\), then \(f(n)=cn\), where \(c=f(1)\). A first-order recurrence determines all values from one initial value. A recurrence with step \(d\) usually determines the function separately on each residue class modulo \(d\). On a finite set, injectivity and surjectivity are equivalent.

When to Use This Method

Use the discrete method when arguments differ by \(1\), \(2\), or \(3\), when \(m+n\) and \(m-n\) appear, when the function is defined on residues modulo a number, or when the statement includes integrality, divisibility, or parity. It is often useful to find \(f(0)\), \(f(1)\), and then a formula for \(f(n+1)-f(n)\).

How to Recognise the Method

Signs of the method: the equation can be read as a recurrence; substitutions \(m=0\), \(n=0\), \(m=n\) give initial values; the expression changes only within the same parity class; in a finite field every element is a multiple of \(1\).

Typical Mistakes

Do not assume that a step-two recurrence connects even and odd values. Do not forget negative integers. In modular problems, all equalities must be interpreted modulo the modulus, not as ordinary integer equalities. On a finite domain, use the fact that injectivity already means bijectivity.

Mini-checklist

1. Is there an initial value? 2. What is the recurrence step: \(1\), \(2\), or \(3\)? 3. Should even and odd values be separated? 4. What happens for negative \(n\)? 5. Can a known correction be subtracted: \(n^2\), \(\binom{n}{2}\)? 6. If the domain is finite, can injectivity be upgraded to bijectivity?

Examples

Example 1. A First-Order Recurrence

The simplest discrete case: each next value is determined by the previous one.

Problem. Let \(f:\mathbb Z\to\mathbb Z\), \(f(0)=2\), and \(f(n+1)=f(n)+5\). Find \(f(n)\).

Solution.

For \(n>0\), induction gives \(f(n)=2+5n\). For negative integers, move backwards: \(f(n)=f(n+1)-5\), so the same formula remains true. The answer is \(f(n)=5n+2\).

Comment. On \(\mathbb Z\), always check the backward direction.

Example 2. Step Two and Parity

A step-two recurrence splits the problem into two classes.

Problem. Let \(f(n+2)=f(n)+4\), \(f(0)=1\), and \(f(1)=3\). Find \(f(n)\).

Solution.

On even numbers, \(f(2k)=1+4k=2(2k)+1\). On odd numbers, \(f(2k+1)=3+4k=2(2k+1)+1\). Hence \(f(n)=2n+1\) for all integers \(n\).

Comment. If the initial values were not compatible, the formula could differ on even and odd numbers.

Example 3. The \(mn\) Correction

Here a sum becomes a square after subtracting a known correction.

Problem. Find all \(f:\mathbb Z\to\mathbb Z\) such that \(f(m+n)=f(m)+f(n)+2mn\).

Solution.

Let \(g(n)=f(n)-n^2\). Then \(g(m+n)=g(m)+g(n)\). On \(\mathbb Z\), \(g(n)=cn\), where \(c\in\mathbb Z\). The answer is \(f(n)=n^2+cn\). Direct checking works.

Comment. Polynomial corrections are often recognised through square identities.

Example 4. The \(\binom{n}{2}\) Correction

With the added term \(mn\), the binomial correction is more convenient than \(n^2\).

Problem. Find all \(f:\mathbb Z\to\mathbb Z\) such that \(f(m+n)=f(m)+f(n)+mn\).

Solution.

Use \(\binom{m+n}{2}=\binom{m}{2}+\binom{n}{2}+mn\). Let \(g(n)=f(n)-\binom{n}{2}\). Then \(g(m+n)=g(m)+g(n)\), so \(g(n)=cn\). The answer is \(f(n)=\binom{n}{2}+cn\).

Comment. This correction remains integral for all integers \(n\).

Example 5. A Finite Domain

On a finite set, injectivity immediately gives surjectivity.

Problem. Let \(p\) be prime and \(f:\mathbb Z/p\mathbb Z\to\mathbb Z/p\mathbb Z\), \(f(x+y)=f(x)+f(y)\). Prove that \(f(x)=xf(1)\).

Solution.

Every element is \(x\cdot1\) in the additive sense modulo \(p\). Therefore \(f(x)=f(1+\cdots+1)=xf(1)\). All equalities are modulo \(p\).

Comment. This is the finite version of additivity on \(\mathbb Q\), but the proof is shorter.

Example 6. Parity as an Obstruction

Sometimes it is enough to look at the parity of neighbouring values.

Problem. Prove that there is no \(f:\mathbb Z\to\mathbb Z\) such that \(f(n+1)-f(n)=2n+1\) and all values \(f(n)\) have the same parity.

Solution.

The difference \(f(n+1)-f(n)=2n+1\) is always odd. Hence neighbouring values have opposite parity. Therefore all values cannot have the same parity.

Comment. This is short, but it is an important olympiad check.

Example 7. A Functional Equation on \(\mathbb Z\)

An integer version of the familiar injectivity method.

Problem. Find all \(f:\mathbb Z\to\mathbb Z\) such that \(f(n+f(m))=f(n)+m\).

Solution.

With \(n=0\), \(f(f(m))=f(0)+m\). This implies injectivity. With \(m=0\), \(f(n+f(0))=f(n)\), so \(f(0)=0\). Thus \(f(f(m))=m\). Put \(m=f(t)\): \(f(n+t)=f(n)+f(t)\). Therefore \(f(n)=cn\) on \(\mathbb Z\). From \(f(f(n))=n\), we get \(c^2=1\). The answer is \(f(n)=n\) and \(f(n)=-n\).

Comment. The method resembles the real-domain one, but linearity on \(\mathbb Z\) is simpler.

Example 8. Residues Modulo a Prime

The finite version can give the same answer as the rational one.

Problem. Let \(p\) be an odd prime, \(f:\mathbb Z/p\mathbb Z\to\mathbb Z/p\mathbb Z\), and \(f(x+f(y))=f(x)+y\). Find \(f\).

Solution.

With \(x=0\), \(f(f(y))=f(0)+y\), so \(f\) is injective, and on a finite set it is bijective. With \(y=0\), \(f(x+f(0))=f(x)\), hence \(f(0)=0\). Thus \(f(f(y))=y\). Substituting \(y=f(t)\), we get \(f(x+t)=f(x)+f(t)\), so \(f(x)=ax\). From \(f(f(y))=y\), \(a^2=1\), hence \(a=1\) or \(a=-1\). The answer is \(f(x)=x\) and \(f(x)=-x\).

Comment. Finiteness replaces the proof of surjectivity.

Problems

Problems

#6.1
#6.1

Linear Recurrence

Induction Grade 10 Grade 11 ★★☆☆☆

Let \(f:\mathbb Z\to\mathbb Z\), \(f(0)=-1\), and \(f(n+1)=f(n)+4\). Find \(f(n)\).

Details
Problem: ALG-B3-M06-P001
Difficulty: Level 2 of 5
Tag: Induction
Grade: Grade 10, Grade 11
#6.2
#6.2

Two Parity Classes

Parity Grade 10 Grade 11 ★★☆☆☆

Let \(f(n+2)=f(n)+6\), \(f(0)=2\), and \(f(1)=5\). Find \(f(n)\) for all \(n\in\mathbb Z\).

Details
Problem: ALG-B3-M06-P002
Difficulty: Level 2 of 5
Tag: Parity
Grade: Grade 10, Grade 11
#6.3
#6.3

Shifted Sum on Natural Numbers

Integer Domain Grade 10 Grade 11 ★★☆☆☆

A function \(f:\mathbb N\to\mathbb Z\) satisfies \(f(m+n)=f(m)+f(n)+1\) and \(f(1)=4\). Find \(f(n)\).

Details
Problem: ALG-B3-M06-P003
Difficulty: Level 2 of 5
Tag: Integer Domain
Grade: Grade 10, Grade 11
#6.4
#6.4

Cyclic Recurrence

Recursion Grade 10 Grade 11 ★★☆☆☆

Let \(f\) be defined on residues modulo \(7\) and suppose \(f(x+1)\equiv f(x)+1\pmod 7\). Prove that \(f(x)\equiv x+c\pmod 7\) for some \(c\).

Details
Problem: ALG-B3-M06-P004
Difficulty: Level 2 of 5
Tag: Recursion
Grade: Grade 10, Grade 11
#6.5
#6.5

Second Differences

Recursion Grade 10 Grade 11 ★★☆☆☆

Let \(f:\mathbb Z\to\mathbb Z\), \(f(0)=0\), \(f(1)=2\), and \(f(n+2)-2f(n+1)+f(n)=0\) for all \(n\). Find \(f(n)\).

Details
Problem: ALG-B3-M06-P005
Difficulty: Level 2 of 5
Tag: Recursion
Grade: Grade 10, Grade 11
#6.6
#6.6

Cauchy on the Integers

Additive Grade 10 Grade 11 ★★★☆☆

Find all \(f:\mathbb Z\to\mathbb Z\) such that \(f(m+n)=f(m)+f(n)\) and \(f(1)=-3\).

Details
Problem: ALG-B3-M06-P006
Difficulty: Level 3 of 5
Tag: Additive
Grade: Grade 10, Grade 11
#6.7
#6.7

A Square Correction

Integer Domain Grade 10 Grade 11 ★★★☆☆

Find all \(f:\mathbb Z\to\mathbb Z\) such that \(f(m+n)=f(m)+f(n)+2mn\).

Details
Problem: ALG-B3-M06-P007
Difficulty: Level 3 of 5
Tag: Integer Domain
Grade: Grade 10, Grade 11
#6.8
#6.8

A Binomial Correction

Binomial coefficients Grade 10 Grade 11 ★★★☆☆

Find all \(f:\mathbb Z\to\mathbb Z\) such that \(f(m+n)=f(m)+f(n)+mn\).

Details
Problem: ALG-B3-M06-P008
Difficulty: Level 3 of 5
Tag: Binomial coefficients
Grade: Grade 10, Grade 11
#6.9
#6.9

The Midpoint Equation on Integers

Parity Grade 10 Grade 11 ★★★☆☆

Find all \(f:\mathbb Z\to\mathbb Z\) such that \(f(m+n)+f(m-n)=2f(m)\) for all \(m,n\).

Details
Problem: ALG-B3-M06-P009
Difficulty: Level 3 of 5
Tag: Parity
Grade: Grade 10, Grade 11
#6.10
#6.10

Alternating Parity

Parity Grade 10 Grade 11 ★★★☆☆

Prove that there is no \(f:\mathbb Z\to\mathbb Z\) such that \(f(n+1)-f(n)=2n+1\) and all values \(f(n)\) have the same parity.

Details
Problem: ALG-B3-M06-P010
Difficulty: Level 3 of 5
Tag: Parity
Grade: Grade 10, Grade 11
#6.11
#6.11

Quadratic Equation on Integers

Induction Grade 10 Grade 11 ★★★★☆

Let \(f:\mathbb Z\to\mathbb Z\), \(f(0)=0\), \(f(1)=1\), and \(f(m+n)+f(m-n)=2f(m)+2f(n)\). Prove that \(f(n)=n^2\).

Details
Problem: ALG-B3-M06-P011
Difficulty: Level 4 of 5
Tag: Induction
Grade: Grade 10, Grade 11
#6.12
#6.12

A Derivative on Natural Numbers

Divisibility Grade 10 Grade 11 ★★★★☆

Let \(f:\mathbb N\to\mathbb Z_{\ge0}\), \(f(mn)=mf(n)+nf(m)\), and \(f(p)=p\) for every prime \(p\). Find \(f(n)\).

Details
Problem: ALG-B3-M06-P012
Difficulty: Level 4 of 5
Tag: Divisibility
Grade: Grade 10, Grade 11
#6.13
#6.13

Additivity Modulo a Prime

Additive Grade 10 Grade 11 ★★★★☆

Let \(p\) be prime, \(f:\mathbb Z/p\mathbb Z\to\mathbb Z/p\mathbb Z\), and \(f(x+y)=f(x)+f(y)\). Prove that \(f(x)=ax\) for some residue \(a\).

Details
Problem: ALG-B3-M06-P013
Difficulty: Level 4 of 5
Tag: Additive
Grade: Grade 10, Grade 11
#6.14
#6.14

A Preimage on Integers

Additive Grade 10 Grade 11 ★★★★★

Find all \(f:\mathbb Z\to\mathbb Z\) such that \(f(n+f(m))=f(n)+m\) for all integers \(m,n\).

Details
Problem: ALG-B3-M06-P014
Difficulty: Level 5 of 5
Tag: Additive
Grade: Grade 10, Grade 11
#6.15
#6.15

Shift and Involution

Integer Domain Grade 10 Grade 11 ★★★★★

Find all \(f:\mathbb Z\to\mathbb Z\) such that \(f(m+n)=f(m)+f(n)+2\) and \(f(f(n))=n\).

Details
Problem: ALG-B3-M06-P015
Difficulty: Level 5 of 5
Tag: Integer Domain
Grade: Grade 10, Grade 11
#6.16
#6.16

Involution Modulo a Prime

Composition Grade 10 Grade 11 ★★★★★

Let \(p\) be an odd prime, \(f:\mathbb Z/p\mathbb Z\to\mathbb Z/p\mathbb Z\), \(f(x+y)=f(x)+f(y)\), and \(f(f(x))=x\). Find \(f\).

Details
Problem: ALG-B3-M06-P016
Difficulty: Level 5 of 5
Tag: Composition
Grade: Grade 10, Grade 11
#6.17
#6.17

Square Recurrence

Recursion Grade 10 Grade 11 ★★★★★

Let \(f:\mathbb Z\to\mathbb Z\), \(f(0)=0\), and \(f(n+1)-f(n)=2n+1\). Find \(f(n)\).

Details
Problem: ALG-B3-M06-P017
Difficulty: Level 5 of 5
Tag: Recursion
Grade: Grade 10, Grade 11
#6.18
#6.18

Arguments of the Same Parity

Parity Grade 10 Grade 11 ★★★★★

Find all \(f:\mathbb Z\to\mathbb Z\) such that \(f(m+n)-f(m-n)=4mn\) for all \(m,n\).

Details
Problem: ALG-B3-M06-P018
Difficulty: Level 5 of 5
Tag: Parity
Grade: Grade 10, Grade 11
#6.19
#6.19

Step Three

Recursion Grade 10 Grade 11 ★★★★★

Let \(f:\mathbb Z\to\mathbb Z\), \(f(0)=0\), \(f(1)=1\), \(f(2)=4\), and \(f(n+3)-f(n)=6n+9\). Find \(f(n)\).

Details
Problem: ALG-B3-M06-P019
Difficulty: Level 5 of 5
Tag: Recursion
Grade: Grade 10, Grade 11
#6.20
#6.20

A Functional Equation Modulo a Prime

Additive Grade 10 Grade 11 ★★★★★

Let \(p\) be an odd prime and let \(f:\mathbb Z/p\mathbb Z\to\mathbb Z/p\mathbb Z\) satisfy \(f(x+f(y))=f(x)+y\) for all residues \(x,y\). Find \(f\).

Details
Problem: ALG-B3-M06-P020
Difficulty: Level 5 of 5
Tag: Additive
Grade: Grade 10, Grade 11

Ladders

No published ladders were found.
Previous Chapter
Next Chapter