Skip to content
Number Theory · Chapter 25

Algebraic Number Theory

Turn numbers into variables, then factor: difference of squares, sums and differences of cubes, Simon's trick and Sophie Germain crack contest number theory.

You'll need
open on YouTube
25.10%

Substitute, Group, Factor: Quadratic Factorizations

In this section you will be able to turn numbers into variables, then factor with the difference of squares.

a divides b and c, and a + b + c = 100. Substitute b = ax and c = ay, and the sum factors: a(1 + x + y) = 100.

Number theory problems often hide algebra. Give the messy part a name, like x=4nx = 4^{n} or b=axb = ax, and look for a factorization.

The star tool is the difference of squares, x2−y2=(x−y)(x+y)x^{2} - y^{2} = (x - y)(x + y). It’s Theorem 12.2.1 from Chapter 12, now aimed at whole numbers: one big number becomes a product of two smaller ones.

Look:A product of two factors equal to a fixed number means you can list the factor pairs. That’s where the counting comes from.

Exploreplay first, formulas later

7² − 3² = 4 × 10 = 40

a7
b3
−3²a = 7a = 7
72−32=4×10=407^2 - 3^2 = 4 \times 10 = 40

7² − 3² = 4 × 10 = 40

Name it

Concept 25.0.1 · Algebraic Number Theory Techniques

  1. Make substitutions to convert numbers to variables
  2. Group terms
  3. Look for factorizations
  4. Sometimes use modular arithmetic, divisibility, or other number theory techniques

(3 − 2) times 3 factors telescopes to 3^8 − 2^8 = 6,305

Multiply by 3−2=13 - 2 = 1. Then (a−b)(a+b)=a2−b2(a - b)(a + b) = a^{2} - b^{2} eats the factors one at a time.

(3−2)(3+2)(32+22)(34+24)(3 - 2)(3 + 2)(3^{2} + 2^{2})(3^{4} + 2^{4})
0 of 3 factors combined

Difference-of-squares chain with 3 factors

Theorem 25.1.1 · Exponent Rules

x−a=1xax^{-a} = \frac{1}{x^{a}}
xa×xb=xa+bx^{a} \times x^{b} = x^{a+b}
xa÷xb=xa−bx^{a} \div x^{b} = x^{a-b}
(xa)b=xab\left(x^{a}\right)^{b} = x^{ab}

These are the same rules as Theorem 12.0.1 in Chapter 12.

Theorem 25.1.2 · Difference of Squares

x2−y2=(x−y)(x+y)x^{2} - y^{2} = (x - y)(x + y)

Same identity as Theorem 12.2.1. In number theory, it turns one big number into a product of two smaller ones.

Watch itpredict, then reveal

Example 25.1

AIME

Find the number of ordered triples (a,b,c)(a, b, c) where aa, bb, and cc are positive integers, aa is a factor of bb, aa is a factor of cc, and a+b+c=100a + b + c = 100.

  1. 1

    aa divides bb and cc. Substitute b=axb = ax and c=ayc = ay with positive integers x,yx, y. What does a+b+c=100a + b + c = 100 become?

open on YouTube

Example 25.2

Omega Learn

How many values of nn from 11 to 100100 inclusive make 16n−2×4n+116^{n} - 2 \times 4^{n} + 1 a multiple of 4949?

  1. 1

    Substitute x=4nx = 4^{n}. Then 16n=(4n)2=x216^{n} = (4^{n})^{2} = x^{2}. What does the expression become?

open on YouTube

Try it

Problem 25.6.1

AMC 10

There is a positive integer nn such that (n+1)!+(n+2)!=n!⋅440(n + 1)! + (n + 2)! = n! \cdot 440. What is the sum of the digits of nn?

Problem 25.6.10

AMC 10

The ages of Jonie's four cousins are distinct single-digit positive integers. Two of the cousins' ages multiplied together give 2424, while the other two multiply to 3030. What is the sum of the ages of Jonie's four cousins?

Problem 25.6.24(additional)

AMC 10

How many ordered pairs (m,n)(m, n) of positive integers, with m≥nm \ge n, have the property that their squares differ by 9696?

10² − 2² = 8 × 12 = 96

a10
b2
−2²a = 10a = 10
102−22=8×12=9610^2 - 2^2 = 8 \times 12 = 96
a2−b2=(a−b)(a+b)a^2 - b^2 = (a - b)(a + b)

10² − 2² = 8 × 12 = 96

Contest cornerreal contest problems

Problem 25.6.9

AMC 10/12

Which of the following is equivalent to

(2+3)(22+32)(24+34)(28+38)(216+316)(232+332)(264+364)?(2 + 3)\left(2^{2} + 3^{2}\right)\left(2^{4} + 3^{4}\right)\left(2^{8} + 3^{8}\right)\left(2^{16} + 3^{16}\right)\left(2^{32} + 3^{32}\right)\left(2^{64} + 3^{64}\right)?
Click a choice or type its letter (A–E).

Problem 25.6.19(additional)

AMC 10

There exists a unique strictly increasing sequence of nonnegative integers a1<a2<⋯<aka_1 < a_2 < \cdots < a_k such that

2289+1217+1=2a1+2a2+⋯+2ak.\frac{2^{289} + 1}{2^{17} + 1} = 2^{a_1} + 2^{a_2} + \cdots + 2^{a_k}.

What is kk?

Checkpoint for section 25.1

Get 2 of 3 right to master this section. One try each, no hints.
1

Factor 210−12^{10} - 1 as a difference of squares, (25−1)(25+1)\left(2^{5} - 1\right)\left(2^{5} + 1\right). What is the larger factor?

2

How many ordered pairs (m,n)(m, n) of positive integers satisfy m2−n2=15m^{2} - n^{2} = 15?

3

Compute 1012−992101^{2} - 99^{2} without a calculator.

25.20%

Cubic Factorizations

In this section you will be able to factor sums and differences of cubes and use them to find remainders.

Is n³ + 1 ever prime? Factor it as (n + 1)(n² − n + 1) and you’ll see: almost never.

Cubes factor too (Theorems 12.3.1 and 12.3.2 from Chapter 12). The second factor is a quadratic: x2+xy+y2x^{2} + xy + y^{2} for a difference, x2−xy+y2x^{2} - xy + y^{2} for a sum.

A related fact: 13+23+⋯+n3=(n(n+1)2)21^{3} + 2^{3} + \cdots + n^{3} = \left(\frac{n(n+1)}{2}\right)^{2}. When you work mod n+5n + 5, you can replace nn by −5-5 inside any polynomial.

Exploreplay first, formulas later

5³ − 2³ = 3 × 39 = 117

a5
b2
first factor
a−b=5−2a - b = 5 - 2
3
second factor
a2+ab+b2=25+10+4a^2 + ab + b^2 = 25 + 10 + 4
39
53−23=3×39=1175^3 - 2^3 = 3 \times 39 = 117

5³ − 2³ = 3 × 39 = 117

Name it

Theorem 25.2.1 · Difference of Cubes

x3−y3=(x−y)(x2+xy+y2)x^{3} - y^{3} = (x - y)\left(x^{2} + xy + y^{2}\right)

Same identity as Theorem 12.3.1.

Theorem 25.2.2 · Sum of Cubes

x3+y3=(x+y)(x2−xy+y2)x^{3} + y^{3} = (x + y)\left(x^{2} - xy + y^{2}\right)

Same identity as Theorem 12.3.2.

Watch itpredict, then reveal

Example 25.3

AIME

Find the sum of all positive integers nn such that when 13+23+33+⋯+n31^{3} + 2^{3} + 3^{3} + \cdots + n^{3} is divided by n+5n + 5, the remainder is 1717.

Identity lab (its total is revealed at the end of the example)

Type any integer, or a power such as 2^50.

13+23+⋯+n3=(n(n+1)2)21^{3} + 2^{3} + \cdots + n^{3} = \left(\frac{n(n+1)}{2}\right)^{2}
  • 13+23+⋯+n31^{3} + 2^{3} + \cdots + n^{3}
    = 3,025
    = 5² × 11²
  • n(n+1)2\frac{n(n+1)}{2}
    = 55
    = 5 × 11
✓ the factors multiply back
552=3,02555^{2} = 3{,}025
13+23+⋯+n3≡10(mod15)1^{3} + 2^{3} + \cdots + n^{3} \equiv 10 \pmod{15}
Since n≡−5n \equiv -5, the square (n(n+1)2)2\left(\frac{n(n+1)}{2}\right)^{2} acts like ((−5)(−4)2)2\left(\frac{(-5)(-4)}{2}\right)^{2}.

Identity lab: 1³ + … + x³

  1. 1

    The sum of the first nn cubes has a closed form. Which one?

    Predict first:
    Click a choice or type its letter (A–E).
open on YouTube

Contest cornerreal contest problems

Problem 25.6.4

AMC 10

What is the greatest three-digit positive integer nn for which the sum of the first nn positive integers is not a divisor of the product of the first nn positive integers?

Problem 25.6.27(additional)

AMC 10/12

For each integer n≥2n \ge 2, let SnS_n be the sum of all products jkjk, where jj and kk are integers and 1≤j<k≤n1 \le j < k \le n. What is the sum of the 1010 least values of nn such that SnS_n is divisible by 33?

Checkpoint for section 25.2

Get 2 of 3 right to master this section. One try each, no hints.
1

Factor 113−111^{3} - 1 with the difference of cubes. What is the second factor, x2+xy+y2x^{2} + xy + y^{2}?

2

What is the remainder when 13+23+⋯+1031^{3} + 2^{3} + \cdots + 10^{3} is divided by 1515?

3

For how many positive integers nn is n3+1n^{3} + 1 a prime number?

25.30%

Simon's Favorite Factoring Trick

In this section you will be able to use Simon's Favorite Factoring Trick to turn xy, x and y terms into a product.

ab − 4a − 4b + 8 = 0 looks stuck. Add 8 to both sides and it becomes (a − 4)(b − 4) = 8.

Simon’s trick (Theorem 12.4.2 in Chapter 12) adds the right constant so that xy+kx+jyxy + kx + jy factors as (x+j)(y+k)(x + j)(y + k), minus jkjk.

Once you have a product equal to a number, list its factor pairs, negatives included, and keep the ones that fit the problem.

Exploreplay first, formulas later

ab − 4a − 4b = −8 becomes (a − 4)(b − 4) = 8: 4 solutions (5, 12), (6, 8), (8, 6), (12, 5)

a coefficient-4
b coefficient-4
right side-8
ab−4a−4b=−8ab - 4a - 4b = -8
a−4b−4ab−4b−4a?

ab − 4a − 4b = -8. Add the magic number to both sides.

Name it

Theorem 25.3.1 · Simon's Favorite Factoring Trick

xy+kx+jy+jk=(x+j)(y+k)xy + kx + jy + jk = (x + j)(y + k)

Same trick as Theorem 12.4.2.

Watch itpredict, then reveal

Example 25.4

AMC 12

A rectangular floor measures aa by bb feet, where aa and bb are positive integers with b>ab > a. An artist paints a rectangle on the floor with the sides of the rectangle parallel to the sides of the floor. The unpainted part of the floor forms a border of width 11 foot around the painted rectangle and occupies half of the area of the entire floor. How many possibilities are there for the ordered pair (a,b)(a, b)?

  1. 1

    The painted rectangle loses 11 foot on each side. What are its dimensions?

Try it

Problem 25.6.17(additional)

AMC 10

Consider the set of all fractions xy\frac{x}{y}, where xx and yy are relatively prime positive integers. How many of these fractions have the property that if both numerator and denominator are increased by 11, the value of the fraction is increased by 10%10\%?

Problem 25.6.20(additional)

AMC 10

For how many integers nn is n20−n\dfrac{n}{20 - n} the square of an integer?

Contest cornerreal contest problems

Problem 25.6.13

AMC 10

Grandma has just finished baking a large rectangular pan of brownies. She is planning to make rectangular pieces of equal size and shape, with straight cuts parallel to the sides of the pan. Each cut must be made entirely across the pan. Grandma wants to make the same number of interior pieces as pieces along the perimeter of the pan. What is the greatest possible number of brownies she can produce?

Checkpoint for section 25.3

Get 2 of 3 right to master this section. One try each, no hints.
1

How many pairs of positive integers (x,y)(x, y) with x≤yx \le y satisfy xy+x+y=23xy + x + y = 23?

2

To factor xy−3x−5y=0xy - 3x - 5y = 0 with Simon's trick, which number do you add to both sides?

3

How many ordered pairs of integers (x,y)(x, y), negatives allowed, satisfy xy−2x−2y=0xy - 2x - 2y = 0?

25.40%

Higher Powers and Sophie Germain

In this section you will be able to factor higher powers, spot Sophie Germain's identity, and watch products telescope.

Is 10⁴ + 324 prime? Write 324 = 4 · 3⁴, and Sophie Germain splits it into 58 × 178.

xn−ynx^{n} - y^{n} always has the factor x−yx - y, and for odd nn, xn+ynx^{n} + y^{n} always has the factor x+yx + y. These are Theorem 12.4.1 from Chapter 12.

Sophie Germain’s identity is new: x4+4y4x^{4} + 4y^{4} is a sum, yet it factors. It is a difference of squares in disguise, (x2+2y2)2−(2xy)2\left(x^{2} + 2y^{2}\right)^{2} - (2xy)^{2}.

Look:When the factors of one term match the factors of the next, a long product collapses. That’s a telescoping product.

Exploreplay first, formulas later

x = 3, y = 1: 85 = 5 × 17

Type any integer, or a power such as 2^50.

x4+4y4=(x2−2xy+2y2)(x2+2xy+2y2)x^{4} + 4y^{4} = \left(x^{2} - 2xy + 2y^{2}\right)\left(x^{2} + 2xy + 2y^{2}\right)
  • x4+4y4x^{4} + 4y^{4}
    = 85
    = 5 × 17
  • x2−2xy+2y2x^{2} - 2xy + 2y^{2}
    = 5
    = 5prime
  • x2+2xy+2y2x^{2} + 2xy + 2y^{2}
    = 17
    = 17prime
✓ the factors multiply back

Both factors are bigger than 1 in size, so 85 is composite.

Identity lab: x⁴ + 4y⁴

Name it

Theorem 25.4.1 · nth Power Factorizations

Sum of odd powers:

x2n+1+y2n+1=(x+y)(x2n−x2n−1y+x2n−2y2−⋯−xy2n−1+y2n)x^{2n+1} + y^{2n+1} = (x + y)\left(x^{2n} - x^{2n-1}y + x^{2n-2}y^{2} - \cdots - xy^{2n-1} + y^{2n}\right)

The signs in the second factor alternate between positive and negative.

Difference of powers:

xn−yn=(x−y)(xn−1+xn−2y+xn−3y2+⋯+xyn−2+yn−1)x^{n} - y^{n} = (x - y)\left(x^{n-1} + x^{n-2}y + x^{n-3}y^{2} + \cdots + xy^{n-2} + y^{n-1}\right)

The signs in the second factor are all positive.

Same identities as Theorem 12.4.1.

Theorem 25.5.1 · Sophie Germain's Identity

x4+4y4=(x2−2xy+2y2)(x2+2xy+2y2)x^{4} + 4y^{4} = \left(x^{2} - 2xy + 2y^{2}\right)\left(x^{2} + 2xy + 2y^{2}\right)

Remark 25.5.2

Be on the lookout for 4th powers to apply Sophie Germain's Identity!

They can hide: 2202+1=14+4(250)42^{202} + 1 = 1^{4} + 4\left(2^{50}\right)^{4}.

x = 1, y = 1,125,899,906,842,624: 642775…205505 (61 digits) = 253530…725505 (31 digits) × 253530…096001 (31 digits)

Type any integer, or a power such as 2^50.

x4+4y4=(x2−2xy+2y2)(x2+2xy+2y2)x^{4} + 4y^{4} = \left(x^{2} - 2xy + 2y^{2}\right)\left(x^{2} + 2xy + 2y^{2}\right)
  • x4+4y4x^{4} + 4y^{4}
    = 642775…205505 (61 digits)
    = 5 × 809 × (58-digit composite)
  • x2−2xy+2y2x^{2} - 2xy + 2y^{2}
    = 253530…725505 (31 digits)
    = 5 × (30-digit composite)
  • x2+2xy+2y2x^{2} + 2xy + 2y^{2}
    = 253530…096001 (31 digits)
    = 809 × (28-digit composite)
✓ the factors multiply back
(253530…725505 (31 digits))×(253530…096001 (31 digits))=642775…205505 (61 digits)(253530\ldots725505\,(\text{31 digits})) \times (253530\ldots096001\,(\text{31 digits})) = 642775\ldots205505\,(\text{61 digits})

Both factors are bigger than 1 in size, so 642775…205505 (61 digits) is composite.

Identity lab: x⁴ + 4y⁴

Contest cornerreal contest problems

Problem 25.6.6

AMC 10

What is the remainder when 2202+2022^{202} + 202 is divided by 2101+251+12^{101} + 2^{51} + 1?

Problem 25.6.7

AIME

Compute

(104+324)(224+324)(344+324)(464+324)(584+324)(44+324)(164+324)(284+324)(404+324)(524+324).\frac{(10^{4} + 324)(22^{4} + 324)(34^{4} + 324)(46^{4} + 324)(58^{4} + 324)}{(4^{4} + 324)(16^{4} + 324)(28^{4} + 324)(40^{4} + 324)(52^{4} + 324)}.

Checkpoint for section 25.4

Get 2 of 3 right to master this section. One try each, no hints.
1

Sophie Germain factors 54+4=6295^{4} + 4 = 629. What is the smaller factor, x2−2xy+2y2x^{2} - 2xy + 2y^{2} with x=5x = 5, y=1y = 1?

2

Factor 212−12^{12} - 1 with differences of squares and cubes. What is its largest prime factor?

3

In the telescope below, each term x4+324x^{4} + 324 splits into (x−3)2+9(x - 3)^{2} + 9 and (x+3)2+9(x + 3)^{2} + 9. Cancel every matching pair. Which factor is left at the bottom?

Sophie Germain telescope with y = 3: 2 terms over 2 terms = 317/5

Each term is x4+4⋅34=((x−3)2+32)((x+3)2+32)x^{4} + 4\cdot 3^{4} = \big((x-3)^{2} + 3^{2}\big)\big((x+3)^{2} + 3^{2}\big). Consecutive x values differ by 2⋅32\cdot 3, so one term's big factor is the next term's small factor.

Top58178370634
Bottom1058178370

0 of 3 pairs cancelled.

Keep cancelling…

Sophie Germain telescope, 4 terms with y = 3

25.6

Practice Problems

In this section you will be able to mix substitution, factoring and number theory on contest problems.

Time to mix it all up. These problems use factorials, digit sums, parity, coins and dice, and each one hides a factorization. Every problem has three hints if you get stuck.

Want every problem from this chapter on one page? Open the problem set.

Contest cornerreal contest problems

Problem 25.6.2

AMC 10

This problem also appears in the book as 22.1.3.

For all integers n≥9n \ge 9, the value of

(n+2)!−(n+1)!n!\frac{(n + 2)! - (n + 1)!}{n!}

is always which of the following?

Click a choice or type its letter (A–E).

Problem 25.6.3

AMC 10

This problem also appears in the book as 24.1.10.

Let S(n)S(n) equal the sum of the digits of positive integer nn. For example, S(1507)=13S(1507) = 13. For a particular positive integer nn, S(n)=1274S(n) = 1274. Which of the following could be the value of S(n+1)S(n + 1)?

Click a choice or type its letter (A–E).

Problem 25.6.5

AMC 10

This problem also appears in the book as 19.2.6.

When a student multiplied the number 6666 by the repeating decimal

1.a‾ b‾ a‾ b‾…=1.a‾ b‾‾,1.\underline{a}\,\underline{b}\,\underline{a}\,\underline{b}\ldots = 1.\overline{\underline{a}\,\underline{b}},

where aa and bb are digits, he did not notice the notation and just multiplied 6666 times 1.a‾ b‾1.\underline{a}\,\underline{b}. Later he found that his answer is 0.50.5 less than the correct answer. What is the 2-digit number a‾ b‾\underline{a}\,\underline{b}?

Problem 25.6.8

AMC 12

A sequence of numbers is defined by D0=0D_0 = 0, D1=0D_1 = 0, D2=1D_2 = 1 and Dn=Dn−1+Dn−3D_n = D_{n-1} + D_{n-3} for n≥3n \ge 3. What are the parities (evenness or oddness) of the triple of numbers (D2021,D2022,D2023)(D_{2021}, D_{2022}, D_{2023}), where EE denotes even and OO denotes odd?

Click a choice or type its letter (A–E).

Problem 25.6.11

AMC 10/12

Let ff be a function defined on the set of positive rational numbers with the property that f(a⋅b)=f(a)+f(b)f(a \cdot b) = f(a) + f(b) for all positive rational numbers aa and bb. Suppose that ff also has the property that f(p)=pf(p) = p for every prime number pp. For which of the following numbers xx is f(x)<0f(x) < 0?

Click a choice or type its letter (A–E).

Problem 25.6.12

AMC 12

Let ff be the unique function defined on the positive integers such that

∑d∣nd⋅f(nd)=1\sum_{d \mid n} d \cdot f\left(\frac{n}{d}\right) = 1

for all positive integers nn, where the sum is taken over all positive divisors of nn. What is f(2023)f(2023)?

Problem 25.6.14

AMC 12

In the state of Coinland, coins have values 66, 1010, and 1515 cents. Suppose xx is the value in cents of the most expensive item in Coinland that cannot be purchased using these coins with exact change. What is the sum of the digits of xx?

Problem 25.6.15

AMC 12

When a standard 6-sided die is rolled nn times, the product of the nn numbers rolled can be any of 936936 possible values. What is nn?

Problem 25.6.16

AMC 10

Square ABCDABCD has sides of length 44. Points PP and QQ lie on AD‾\overline{AD} and CD‾\overline{CD}, respectively, with AP=85AP = \frac{8}{5} and DQ=103DQ = \frac{10}{3}. A path begins along the segment from PP to QQ and continues by reflecting against the sides of ABCDABCD (with congruent incoming and outgoing angles). If the path hits a vertex of the square, it terminates there; otherwise it continues forever. At which vertex does the path terminate?

Click a choice or type its letter (A–E).

Problem 25.6.18(additional)

AIME

Three clever monkeys divide a pile of bananas. The first monkey takes some bananas from the pile, keeps three-fourths of them, and divides the rest equally between the other two. The second monkey takes some bananas from the pile, keeps one-fourth of them, and divides the rest equally between the other two. The third monkey takes the remaining bananas from the pile, keeps one-twelfth of them, and divides the rest equally between the other two. Given that each monkey receives a whole number of bananas whenever the bananas are divided, and the numbers of bananas the first, second, and third monkeys have at the end of the process are in the ratio 3:2:13 : 2 : 1, what is the least possible total for the number of bananas?

Problem 25.6.21(additional)

AMC 10

The number 20132013 is expressed in the form

2013=a1! a2!⋯am!b1! b2!⋯bn!,2013 = \frac{a_1!\,a_2!\cdots a_m!}{b_1!\,b_2!\cdots b_n!},

where a1≥a2≥⋯≥ama_1 \ge a_2 \ge \cdots \ge a_m and b1≥b2≥⋯≥bnb_1 \ge b_2 \ge \cdots \ge b_n are positive integers and a1+b1a_1 + b_1 is as small as possible. What is ∣a1−b1∣|a_1 - b_1|?

Problem 25.6.22(additional)

AMC 10/12

For k>0k > 0, let Ik=10…064I_k = 10\ldots064, where there are kk zeros between the 11 and the 66. Let N(k)N(k) be the number of factors of 22 in the prime factorization of IkI_k. What is the maximum value of N(k)N(k)?

Click a choice or type its letter (A–E).

Problem 25.6.23(additional)

AMC 10

Two fair dice, each with at least 66 faces, are rolled. On each face of each die is printed a distinct integer from 11 to the number of faces on that die, inclusive. The probability of rolling a sum of 77 is 34\frac34 of the probability of rolling a sum of 1010, and the probability of rolling a sum of 1212 is 112\frac{1}{12}. What is the least possible number of faces on the two dice combined?

Problem 25.6.25(additional)

AMC 10

For how many positive integers nn less than or equal to 2424 is n!n! evenly divisible by 1+2+⋯+n1 + 2 + \cdots + n?

Problem 25.6.26(additional)

AIME

Let S\mathcal{S} be the set of all perfect squares whose rightmost three digits in base 1010 are 256256. Let T\mathcal{T} be the set of all numbers of the form x−2561000\frac{x - 256}{1000}, where xx is in S\mathcal{S}. In other words, T\mathcal{T} is the set of numbers that result when the last three digits of each number in S\mathcal{S} are truncated. Find the remainder when the tenth smallest element of T\mathcal{T} is divided by 10001000.

Problem 25.6.28(additional)

AIME

Find the largest integer nn satisfying the following conditions:

(i) n2n^{2} can be expressed as the difference of two consecutive cubes;

(ii) 2n+792n + 79 is a perfect square.