193
Problem solving with Computer Algebraic Systems ´ Akos Pint´ er T ´ AMOP-4.1.2.D-12/1/KONV-2012-0008 Debrecen 2014

Problem solving with Computer Algebraic Systems

Embed Size (px)

Citation preview

Page 1: Problem solving with Computer Algebraic Systems

Problem solving with Computer

Algebraic Systems

Akos Pinter

TAMOP-4.1.2.D-12/1/KONV-2012-0008

Debrecen

2014

Page 2: Problem solving with Computer Algebraic Systems

Preface

The purpose of this book is twofold. First we would like to provide a collection

from some harder elementary mathematical problems. Second we try to popularize

the Computer Algebraic Systems to solve exercises including IMO-level challenging

questions. Enjoy it!

1

Page 3: Problem solving with Computer Algebraic Systems
Page 4: Problem solving with Computer Algebraic Systems

Abbreviations

AIME – American Invitational Mathematics Examination

ARML – American Regional Mathematics League

CMO – Canadian Mathematical Olympiad

HMMT – Harvard-MIT Math Tournament

BW – Baltic Way

KoMaL – Kozepiskolai Matematikai Lapok

MOSP – Mathematical Olympiad Summer Program

USAMO – United States of America Mathematical Olympiad

IMOLL – International Mathematical Olympiad Long List

IMOSL – International Mathematical Olympiad Shortlist

JMOP – Japan Mathematical Olympiad Preliminary

TITEE – Tokyo Institute Of Technology Entrance Examination

FTST – France Team Selection Test

ARO – All-Russian Olympiad

IZO – International Zhautykov Olympiad

INMO – Iran National Math Olympiad

RNO – Romania National Olympiad

USAIMTS – USA International Mathematical Talent Search

SMT – Stanford Mathematics Tournament

PUMC – Princeton University Mathematical Competition

USAPC – USA Purple Comet

3

Page 5: Problem solving with Computer Algebraic Systems

4

Page 6: Problem solving with Computer Algebraic Systems

Chapter 1

Algebra and Number Theory

Problem (AIME, 1983/6) Let an equal 6n + 8n. Determine the remainder upon

dividing a83 by 49.

Solution: We will use the binomial theorem for expanding (7− 1)83 and (7 + 1)83.

We have

(7 − 1)83 = 783 −(

83

1

)

782 + . . . −(

83

81

)

72 +

(83

82

)

7 − 1

and

(7 + 1)83 = 783 +

(83

1

)

782 + . . . +

(83

81

)

72 +

(83

82

)

7 + 1.

Now for the sum

(7 − 1)83 + (7 + 1)83,

half of our terms cancel out and we are left with

2(783 + 3403 · 781 + · · · + 83 · 7).

One can realize that all of these terms are divisible by 49 except the final term

14 · 83. After some quick division, the answer is 35.

5

Page 7: Problem solving with Computer Algebraic Systems

6

Solution with CAS: 683 + 883 mod49;

35

Problem (AIME, 1983/6) What is the largest 2-digit prime factor of the integer(200100

)?

Solution: Expanding the binomial coefficient, we get

(200

100

)

=200!

100!100!.

Let the prime be p, then 10 ≤ p < 100. In the case p > 50, then the prime factor

p appears twice in the denominator. Thus, we need p to appear as a factor three

times in the numerator, so 3p < 200. The largest such prime is 61.

Solution with CAS: ifactor((200100

));

23 · 3 · 5 · 11 · 132 · 17 · 37 · 53 · 59 · 61 · 101 · · · 199

Problem (AIME, 1986/8) Let S be the sum of the base 10 logarithms of all the

proper divisors (all divisors of a number excluding itself) of 1000000. What is the

integer nearest to S?

Solution: The factorization of 1000000 = 2656, so it has

(6 + 1)(6 + 1) = 49

divisors, of which 48 are proper. The sum of multiple logarithms of the same base

is equal to the logarithm of the products of the numbers. Writing out the first few

terms, we see that the answer is equal to

log 1 + log 2 + log 4 + . . . + log 1000000 = log(2050)(2150)(2051) · · · (2656).

Each power of 2 appears 7 times and the same goes for 5. So the overall power of

Page 8: Problem solving with Computer Algebraic Systems

7

2 and 5 is

7(1 + 2 + 3 + 4 + 5 + 6) = 7 · 21 = 147.

Ssince the question asks for proper divisorsonly, we have to exclude 2656, so each

power is actually 141 times. The answer is thus

S = log 21415141 = log 10141 = 141.

Solution with CAS: A := divisors(1000000); P := 1; for i to nops(A) do;

P := P ∗ A[i]; end do; print(log[10](P ));

147

It means that the sum of the base 10 logarithms of all the proper divisors is

147 − 6 = 141.

Problem (AIME, 1987/3) By a proper divisor of a natural number we mean a

positive integral divisor other than 1 and the number itself. A natural number

greater than 1 will be called nice if it is equal to the product of its distinct proper

divisors. What is the sum of the first ten nice numbers?

Solution: Let p(n) denote the product of the distinct proper divisors of n. It is

easy to see that a number n is nice if and only if

(i) it has exactly two distinct prime divisors.

(ii) it is the cube of a prime number.

Indeed, suppose that another nice number existed that does not fall into one

of these two categories. Then we can either express it in the form n = pqr (with

p, q prime and r > 1) or n = pe (with e 6= 3). In the former case, it suffices to note

that

p(n) ≥ pr · qr = pqr2 > pqr = n.

In the latter case, then

p(n) = 1 · p · p2 · · · pe = pe(e+1)/2

Page 9: Problem solving with Computer Algebraic Systems

8

. For p(n) = n, we have

pe(e+1)/2 = pe

that is e2 + e = 2e. This gives us e = 0, 3 (the case e = 0 does not work). Thus,

listing out the first ten numbers to fit this form,

2 · 3 = 6, 23 = 8, 2 · 5 = 10, 2 · 7 = 14, 3 · 5 = 15, 3 · 7 = 21,

2 · 11 = 22, 2 · 13 = 26, 33 = 27, 3 · 11 = 33.

The sum of these numbers is 182.

Solution with CAS: We print the nice numbers under 50.

B := {}; for i from 2 to 100 do; A:= divisors(i);

k:=nops(A); j:= product(A[l], l = 2..k − 1);

if i = j then B:= ‘union‘(B, {i}); end if; end do; print(B);

{6, 8, 10, 14, 15, 21, 22, 26, 27, 33, 34, 35, 38, 39, 46}

Problem (AIME, 1986/5) Find 3x2y2 if x and y are integers such that

y2 + 3x2y2 = 30x2 + 517.

Solution: If we move the 30x2 term to the left side, we can factorize:

(3x2 + 1)(y2 − 10) = 517 − 10

The prime factorization of 507 is equal to 3 · 132. Since x and y are integers,

3x2 + 1 clearly cannot equal a multiple of three. 169 does not work either, so we

obtain 3x2 + 1 = 13, and x = ±2. This yields y2 − 10 = 39, so y = ±7. The asked

product

3x2y2 = 3 × 4 × 49 = 588.

Page 10: Problem solving with Computer Algebraic Systems

9

Solution with CAS: factor(3x2y2 + y2 − 30x2 − 10);

(y2 − 10)(3x2 + 1)

Problem (AIME, 1986/5) Compute

(104 + 324)(224 + 324)(344 + 324)(464 + 324)(584 + 324)

(44 + 324)(164 + 324)(284 + 324)(404 + 324)(524 + 324).

Solution: We will apply the identity

x4 + 4y4 = (x2 + 2y2 − 2xy)(x2 + 2y2 + 2xy)

for x4 + 324. Now we have

x4 + 324 = (x2 − 6x + 18)(x2 + 6x + 18)

and thus

104 + 324 = 58 · 178, 224 + 324 = 370 · 634,

344 + 324 = 970 · 1378, 464 + 324 = 1858 · 2410, 584 + 324 = 3034 · 3730,

further,

44 + 324 = 10 · 58, 164 + 324 = 178 · 370,

284 + 324 = 634 · 970, 404 + 324 = 1378 · 1858, 524 + 324 = 2410 · 3034.

Finally we get that the original fraction is 373.

Solution with CAS: (104 +324)(224 +324)(344 +324)(464 +324)(584 +324)/((44 +

324)(164 + 324)(284 + 324)(404 + 324)(524 + 324));

373

Problem (AIME, 1989/3) Suppose n is a positive integer and d is a single digit

Page 11: Problem solving with Computer Algebraic Systems

10

in base 10. Find n ifn

810= 0.d25d25d25 . . . .

Solution: We sum an infinite geometric series,

0.d25d25d25 . . . =∞∑

i=1

d25

1000n=

100d + 25

999.

Thus we haven

810=

100d + 25

999

so

n = 30100d + 25

37= 750

4d + 1

37.

Since 750 and 37 are relatively prime, 4d+1 must be divisible by 37, and the only

digit for which this is possible is d = 9. Thus 4d + 1 = 37 and n = 750.

Solution with CAS: for d from 1 to 9 do; if type((1/999) ∗ (810 ∗ (100 ∗ d +

25)), integer) = true then print(d); end if; end do;

9

Problem (AIME, 1996/2) For each real number x, let ⌊x⌋ denote the greatest

integer that does not exceed x. For how many positive integers n is it true that

n < 1000 and that

⌊log2 n⌋

is a positive even integer?

Solution: For integers k, we have to consider the equation

⌊log2 n⌋ = 2k,

or

2k ≤ log2 n < 2k + 1

Page 12: Problem solving with Computer Algebraic Systems

11

This implies

22k ≤ n < 22k+1.

Thus, n must satisfy these inequalities (since n < 1000):

4 ≤ n < 8,

16 ≤ n < 32,

64 ≤ n < 128,

and

256 ≤ n < 512.

There are 4, 16, 64, and 256 solution of the first, second, third and fourth inequality,

respectively, so the answer is 4 + 16 + 64 + 256 = 340.

Solution with CAS: s := 0; for n from 1 to 999 do;

if type((1/2)*floor(log[2](n)), integer) then s := s + 1;

end if; end do; print(s);

341

Problem (AIME, 1998/1) For how many values of k is 1212 the least common

multiple of the positive integers 66, 88, and k?

Solution: It is trivial that k has only 2 and 3 in its prime factorization, i. e.

k = 2a3b. The least common multiple of any numbers an be found by writing

out their factorizations and taking the greatest power for each factor. One can

calculate

[66, 88] = 22436.

Therefore

1212 = 224 · 312 = [22436, 2a3b] = 2max(24,a)3max(6,b),

and b = 12. Since 0 ≤ a ≤ 24, there are 25 values of k.

Solution with CAS: s := 0; for a from 0 to 24 do; for b from 0 to 12 do;

Page 13: Problem solving with Computer Algebraic Systems

12

k := 2a ∗ 3b; if lcm(66, 88, k) = 1212 then s:= s+1; end if; end do; end

do; print(s);

25

Problem (AIME, 2002, I/4) Consider the sequence defined by

ak =1

k2 + k

for k ≥ 1. Given that

am + am+1 + · · · + an−1 =1

29,

for positive integers m and n with m < n, find m + n.

Solution: One can calculate that

1

k2 + k=

1

k(k + 1)=

1

k− 1

k + 1.

Thus we obtain

am +am+1 + · · ·+an−1 =1

m− 1

m + 1+

1

m + 1− 1

m + 2+ · · ·+ 1

n − 1− 1

n=

1

m− 1

n.

This yieldsn − m

mn=

1

29.

Easy to see that 29|mn, and without loss of generality we may assume that n = 29t

for some integer t. Sustituting,

29t − m = mt,

29t = (t + 1)m,

29t

t + 1= m,

Page 14: Problem solving with Computer Algebraic Systems

13

and finally,

29 − 29

t + 1= m.

Since m is an integer, t + 1 = 29, t = 28. It quickly follows that n = 28 · 29 and

m = 28, so m + n = 840.

Solution with CAS: for n from 1 to 10000 do;

if type(1/(1/29 + 1/n), integer) = true then print(n);

end if; end do;

Problem (AIME, 2002, II/6) Find the integer that is closest to

100010000∑

n=3

1

n2 − 4.

Solution: We will use the formula

4

n2 − 4=

1

n − 2− 1

n + 2.

So if you pull the 14

out of the summation, you get

250

10,000∑

n=3

(1

n − 2− 1

n + 2

)

.

Now that telescopes, leaving you with:

250

(

1 +1

2+

1

3+

1

4− 1

9997− 1

9998− 1

9999− 1

10000

)

=

= 250 + 125 + 83.3 + 62.5 − 250

(

− 1

9997− 1

9998− 1

9999− 1

10000

)

.

Now,

250

(

− 1

9997− 1

9998− 1

9999− 1

10000

)

is not enough to bring 520.8 lower than 520.5 so the answer is 521.

Page 15: Problem solving with Computer Algebraic Systems

14

Solution with CAS: evalf(1000(sum(1/(k2 − 4), k = 3..10000)));

520.7333383

Problem (AIME, 2002, II/7) It is known that, for all positive integers k,

12 + 22 + 32 + . . . + k2 =k(k + 1)(2k + 1)

6.

Find the smallest positive integer k such that

12 + 22 + 32 + . . . + k2

is a multiple of 200.

Solution: It is clear thatk(k + 1)(2k + 1)

6

is a multiple of 200 if k(k + 1)(2k + 1) is a multiple of

1200 = 24 · 3 · 52.

So 16, 3, 25 are divisors of k(k+1)(2k+1). Since 2k+1 is always odd, and only one

of k and k + 1 is even, either k, k + 1 ≡ 0 (mod 16). Thus, k ≡ 0, 15 (mod 16).

If k ≡ 0 (mod 3), then 3|k. If k ≡ 1 (mod 3), then 3|2k+1. If k ≡ 2 (mod 3),

then 3|k + 1. Thus, there are no restrictions on k in (mod 3). One can see that

only one of k, k + 1, and 2k + 1 is divisible by 5. So either k, k + 1, 2k + 1 ≡ 0

(mod 25). Thus, k ≡ 0, 24, 12 (mod 25). From the Chinese Remainder Theorem,

we have

k ≡ 0, 112, 224, 175, 287, 399 (mod 400).

Thus, the smallest positive integer k is 112.

Solution with CAS: a :=sum(n2, n = 1..k); for k to 1000 do; if a (mod 200) =

Page 16: Problem solving with Computer Algebraic Systems

15

0 then print(k); end if; end do;

112, 175, 224 . . .

Problem (AIME, 2003, I/1) Given that

((3!)!)!

3!= k · n!,

where k and n are positive integers and n is as large as possible, find k + n.

Solution: A straightforward calculation shows that

((3!)!)!

3!=

(6!)!

3!=

720!

3!=

720!

6=

720 · 719!

6= 120 · 719!

We certainly can not make n any larger if k is going to stay an integer, so the

answer is k + n = 120 + 719 = 839.

Solution with CAS: First we compute the smallest positive integer n such that

a = ((3!)!)!3!

is smaller than n!.

for n to 1000 do if a/factorial(n) < 1 then print(n); end if; end do;

One can see that the smallest positive integer n with the above mentioned property

is 720. Now we determine the fraction a719!

, and we obtain 120.

Problem (AIME, 2003, I/9) An integer between 1000 and 9999, inclusive, is called

balanced if the sum of its two leftmost digits equals the sum of its two rightmost

digits. How many balanced integers are there?

Solution: If the common sum of the first two and last two digits is n, 1 ≤ n ≤ 9,

there are n choices for the first two digits and n + 1 choices for the second two

digits (since zero may not be the first digit). This gives

9∑

n=1

n(n + 1) = 330

Page 17: Problem solving with Computer Algebraic Systems

16

balanced numbers. If the common sum of the first two and last two digits is

n, 10 ≤ n ≤ 18, there are 19 − n choices for both pairs. This gives

18∑

n=10

(19 − n)2 =9∑

n=1

n2 = 285

balanced numbers. Thus, there are in total 330 + 285 = 615 balanced numbers.

Solution with CAS: s := 0; for a to 9 do; for b from 0 to 9 do; for c

from 0 to 9 do; for d from 0 to 9 do; if a + b = c + d then s := s + 1;

end if; end do; end do; end do; end do;print(s);

615

Problem (AIME, 2005, II/5) Determine the number of ordered pairs (a, b) of

integers such that

loga b + 6 logb a = 5,

with 2 ≤ a ≤ 2005, and 2 ≤ b ≤ 2005.

Solution: Our equation can be rewritten as

log b

log a+ 6 · log a

log b=

(log b)2 + 6(log a)2

log a log b= 5.

On multiplying through by log a log b and factoring yields

(log b − 3 log a)(log b − 2 log a) = 0.

Therefore, log b = 3 log a or log b = 2 log a, so either b = a3 or b = a2. In the first

case b = a2, note that 442 = 1936 and 452 = 2025. Thus, all values of a from

2 to 44 will work. For the case b = a3, note that 123 = 1728 while 133 = 2197.

Therefore, for this case, all values of a from 2 to 12 work. There are 44−2+1 = 43

possibilities for the square case and 12− 2+1 = 11 possibilities for the cubic case.

Thus, the answer is 43 + 11 = 54.

Page 18: Problem solving with Computer Algebraic Systems

17

Solution with CAS: s := 0; for a from 2 to 2005 do; for b from 2 to 2005

do; if loga(b)+6logb(a) = 5 then s := s+1; end if; end do; end do;print(s);

54

Problem (AIME, 2005, II/7) Let

x =4

(√

5 + 1)( 4√

5 + 1)( 8√

5 + 1)( 16√

5 + 1).

Find (x + 1)48.

Solution: We will use the following formula

(2n√

5 + 1)(2n√

5 − 1) = (2n√

5)2 − 12 =2n−1√

5 − 1.

It now becomes apparent that if we multiply the numerator and denominator of

4

(√

5 + 1)( 4√

5 + 1)( 8√

5 + 1)( 16√

5 + 1)

by ( 16√

5 − 1), the denominator will telescope to 1√

5 − 1 = 4, so

x =4( 16

√5 − 1)

4=

16√

5 − 1.

It follows that

(x + 1)48 = (16√

5)48 = 53 = 125

.

Solution with CAS: x:= (4(root[16](5.) − 1))/

((sqrt(5.)+1)(root[4](5.)+1)(root[8](5.)+1)(root[16](5.)+1)(root[16](5.)−1));

x := 0.1058230170

Page 19: Problem solving with Computer Algebraic Systems

18

(x + 1)48;

124.9999998

Problem (AIME, 2006 II/3) Let P be the product of the first 100 positive odd

integers. Find the largest integer k such that P is divisible by 3k.

Solution: The product of the first 100 positive odd integers can be written as

1 · 3 · 5 · 7 · · · 195 · 197 · 199 =1 · 2 · · · 200

2 · 4 · · · 200=

200!

2100 · 100!.

Hence, we seek the number of threes in 200! decreased by the number of threes

in 100!. Using the Legendre formula on the prime factorizations of a factorial we

have ⌊200

3

+

⌊200

9

+

⌊200

27

+ . . . = 97

threes in 200! and ⌊100

3

+

⌊100

9

+

⌊100

27

+ . . . = 48

threes in 100! Therefore, we have a total of 97 − 48 = 49 threes.

Solution with CAS: s := 1; for k from 3 to 199 by 2 do; s := s ·k; end do;

ifactor(s);

349 · 525 · · ·

Problem (AIME, 2006 II/3) There exist unique positive integers x and y that

satisfy the equation

x2 + 84x + 2008 = y2.

Find x + y.

Solution: Completing the square, we have

y2 = x2 + 84x + 2008 = (x + 42)2 + 244.

Page 20: Problem solving with Computer Algebraic Systems

19

Thus we obtain

244 = y2 − (x + 42)2 = (y − x − 42)(y + x + 42)

by difference of squares. Since 244 is even, one of the factors is even. A parity check

shows that if one of them is even, then both must be even. Since 244 = 22 · 61,

the factors must be 2 and 122. Since x, y > 0, we have y − x − 42 = 2 and

y + x + 42 = 122. Finally, the latter equation implies that x + y =80. Indeed, by

solving, we find (x,y) = (18,62) is the unique solution.

Solution with CAS: ifactor(327);

{3}{109}

Problem (AIME, 2009 II/7) Define n!! to be

n(n − 2)(n − 4) · · · 3 · 1

for n odd and

n(n − 2)(n − 4) · · · 4 · 2

for n even. When2009∑

i=1

(2i − 1)!!

(2i)!!

is expressed as a fraction in lowest terms, its denominator is 2ab with b odd. Findab10

.

Solution: First, we note that

(2n)!! = 2n · n!,

and

(2n)!! · (2n − 1)!! = (2n)!.

Page 21: Problem solving with Computer Algebraic Systems

20

We can now take the fraction(2i − 1)!!

(2i)!!

and multiply both the numerator and the denominator by (2i)!!. We get that this

fraction is equal to(2i)!

(2i)!!2=

(2i)!

22i(i!)2.

Now we can observe that (2i)!(i!)2

is simply(2ii

), hence this fraction is

(2ii

)

22i,

and our sum turns into

S =2009∑

i=1

(2ii

)

22i.

Let

c =2009∑

i=1

(2i

i

)

· 22·2009−2i.

Obviously c is an integer, and S can be written as c22·2009 . Hence if S is expressed

as a fraction in lowest terms, its denominator will be of the form 2a for some

a ≤ 2 · 2009. In other words, we just showed that b = 1. To determine a, we need

to determine the largest power of 2 that divides c. Let p(i) be the largest x such

that 2x that divides i. We can now return to the observation that

(2i)! = (2i)!! · (2i − 1)!! = 2i · i! · (2i − 1)!!.

Together with the obvious fact that (2i − 1)!! is odd, we get that

p((2i)!) = p(i!) + i.

It immediately follows that

p

((2i

i

))

= p((2i)!) − 2p(i!) = i − p(i!),

Page 22: Problem solving with Computer Algebraic Systems

21

and hence

p

((2i

i

)

· 22·2009−2i

)

= 2 · 2009 − i − p(i!).

Obviously, for i ∈ {1, 2, . . . , 2009} the function

f(i) = 2 · 2009 − i − p(i!)

is is a strictly decreasing function. Therefore

p(c) = p

((2 · 2009

2009

))

= 2009 − p(2009!).

We can now compute

p(2009!) =∞∑

k=1

⌊2009

2k

= 1004 + 502 + · · · + 3 + 1 = 2001.

Hence p(c) = 2009 − 2001 = 8. And thus we obtain

a = 2 · 2009 − p(c) = 4010,

and the answer isab

10=

4010 · 110

= 401.

Solution with CAS: a :=sum(((2i − 1)!!)/((2i)!!), i = 1..2009);

6693254562 . . . 13981551

134984099 . . . 812161024

ifactor(denom(a));

24010

Page 23: Problem solving with Computer Algebraic Systems

22

Problem (AIME, 2010 I/2) Find the remainder when

9 × 99 × 999 × · · · × 99 · · · 9︸ ︷︷ ︸

999 9’s

is divided by 1000.

Solution: One can see that

999 ≡ 9999 ≡ . . . ≡ 99 · · · 9︸ ︷︷ ︸

999 9’s

≡ −1 (mod 1000).

That is a total of 999 − 3 + 1 = 997 integers, so all those integers multiplied out

are congruent to −1 (mod 1000). Thus, the entire expression is congruent to

(−1)(9)(99) = −891 ≡ 109 (mod 1000).

Solution with CAS: mul(10i − 1, i = 1..999) mod 1000;

109

Problem (AIME, 2010 II/6) Find the smallest positive integer n with the property

that the polynomial

x4 − nx + 63

can be written as a product of two non constant polynomials with integer coeffi-

cients.

Solution: We have to distinguish two ways for a monic fourth degree polynomial to

be factored into two non-constant polynomials with real coefficients: into a cubic

and a linear equation, or 2 quadratics.

Consider the case when the factors are cubic and linear. Let x − r1 be the

linear factor, where r1 is a zero of the given quartic, and let

x3 + ax2 + bx + c

Page 24: Problem solving with Computer Algebraic Systems

23

be the cubic. By the rational roots theorem, we have r1 = 1, 3, 7, 9, or 63. One

can calculate that

(x3 + ax2 + bx + c)(x − r1) = x4 + (a − r1)x3 + (b − ar1)x

2 + (c − br1)x − cr1.

Noe setting the appropriate coefficients equal, we obtain a−r1 = 0, thus a = r1,

further, by b − ar1 = 0, b = a2. Finally, c − br1 = −n implies n = a3 − c, and

−cr1 = 63 We get c = −63a

. It follows that

n = a3 +63

a,

where a = r1 = 1, 3, 7, 9, or 63, which reach minimum when a = r1 = 3, where

n = 48.

In the second case the factors are quadratics. Let

x2 + ax + b

and

x2 + cx + d

be the two quadratics, so that

(x2 + ax + b)(x2 + cx + d) = x4 + (a + c)x3 + (b + d + ac)x2 + (ad + bc)x + bd.

Therefore, again setting coefficients equal, a + c = 0, a = −c, b + d + ac =

0, b+d = a2, and ad+bc = −n, finally, bd = 63. Since b+d = a2, the only possible

values for (b, d) are (1, 63) and (7, 9). From this we find that the possible values

for n are ±8 · 62 and ±4 · 2. Therefore, the answer 8.

Solution with CAS: for n from 1 to 10000 do; if irreduc(x4 −n ∗x+63) =

false then print(n): end if: end do;

8

Page 25: Problem solving with Computer Algebraic Systems

24

48

64

352

496

736

9264

Problem (AIME, 2012 II/1) Find the number of ordered pairs of positive integer

solutions (m,n) to the equation

20m + 12n = 2012.

Solution: Solving for m gives us

m =503 − 3n

5,

so in order for m to be an integer, we must have

3n ≡ 503 (mod 5)

which implies

n ≡ 1 (mod 5).

The smallest possible value of n is obviously 1, and the greatest is

503 − 5

3= 166,

so the total number of solutions is 166−15

+ 1 = 34.

Solution with CAS: s := 0; for m from 1 to 101 do; for n from 1 to 167

Page 26: Problem solving with Computer Algebraic Systems

25

do; if 20∗m+12∗n = 2012 then s := s+1; end if; end do; end do;print(s);

34

Problem (KoMaL Gy.3142.) What is the smallest positive integer divisible by

28, which ends 28 (in base 10) and the sum of its digits is 28?

Solution: Because the last two digits of the appropriate number is 28 it has the

form 100k + 28. The number is divisible by 28, and thus by 7. We have that 100k

and so k is also divisible by 7. The sum of the digits of 100k is 18, so 100k (and

k) is divisible by 9. We have k is divisible by 7 and 9, that is by 63. We consider

the first few numbers with these properties:

6328, 12628, 18928, . . . .

One can see that the smallest number with our conditions is 18928.

Solution with CAS: for a to 9 do; for b from 0 to 9 do; for c from 0 to

9 do;

k :=a ∗ 104 + b ∗ 103 + c ∗ 102 + 28;

if ‘and‘(‘mod‘(k, 28) = 0, a+b+c = 18) then print(k); end if; end do;

end do; end do;

18928

37828

56728

69328

75628

81928

88228

Page 27: Problem solving with Computer Algebraic Systems

26

94528

Problem (KoMaL B.3353.) Determine

[

2√

1 · 2 · 3 + 2 · 3 · 4 + . . . + 1998 · 1999 · 2000]

.

Solution: First we consider the number under square root:

1 · 2 · 3 + 2 · 3 · 4 + . . . + 1998 · 1999 · 2000 =1999∑

i=2

(i − 1)i(i + 1) =1999∑

i=2

i3 −1999∑

i=2

i.

Using the identitiesk∑

i=1

i3 =k2(k + 1)2

4,

andk∑

i=1

i =k(k + 1)

2,

we have

1 · 2 · 3 + 2 · 3 · 4 + . . . + 1998 · 1999 · 2000 =19992 · 20002

4− 1999 · 2000

2,

and

4(1 · 2 · 3 + 2 · 3 · 4 + . . . + 1998 · 1999 · 2000) = 19992 · 20002 − 2 · 1999 · 2000.

Finally we obtain that the required value is 1999 · 2000 − 1 = 3997999.

Solution with CAS: floor(2· sqrt(sum (i · (i + 1) · (i + 2), i = 1..1998)))

= 3997999

Page 28: Problem solving with Computer Algebraic Systems

27

Remark: A classical result by Bernoulli is the formula

1k + 2k + . . . + (x − 1)k =1

k + 1(Bk+1(x) − Bk+1(0)) ,

where Bk+1(X) denotes the k + 1th Bernoulli polynomial with degree k + 1.

Problem (KoMaL K.58.) How many perfect square divisors are of the number

857304000?

Solution: The canonical form of 857304000 is

857304000 = 26 · 37 · 53 · 72.

An arbitrary divisor of this number has a form

d = 2α · 3β · 5γ · 7δ,

where

0 ≤ α ≤ 6, 0 ≤ β ≤ 7, 0 ≤ γ ≤ 3, 0 ≤ δ ≤ 2.

A divisor is square if and only if every exponent is even in its canonical form. So

we get 4, 4, 2, 2 possibilities for α, β, γ and δ, respectively, that is we have 64

perfect square divisors.

Solution with CAS: with(numtheory);

A:=divisors(857304000);

k := 0; for i to nops(A) do; if type(sqrt(A[i]), integer) = true then

k := k+1;

end if; end do; print(k);

64

Problem (KoMaL B.4196.) Let n be a positive integer. Determine the first digit

Page 29: Problem solving with Computer Algebraic Systems

28

after decimal point of the number

n∑

k=1

k(k + 1)

n.

Solution: One can prove (by mathematical induction) that

12 + 22 + . . . + n2 =n(n + 1)(2n + 1

6,

and

1 + 2 + . . . + n =n(n + 1)

2.

Using these formulas we have

n∑

k=1

k(k + 1)

n=

(n + 1)(n + 2)

3.

Now, it is easy to see that if n is not divisible by 3, then our sum is an integer

number, and if n is divisible by 3 then the first digit after decimal point is 6.

Solution with CAS: factor(sum(k*(k+1), k = 1 .. n))

1

3n(n + 1)(n + 2)

Problem (KoMaL B.4378.) Let p be a positive prime number. Solve the equation

x3y3 + x3y2 + x2y3 + x2y2 − x + y = p + 2

in the set of integer numbers.

Solution: The idea of our solution is based on the formula

x3y3 + x3y2 − x2y3 + x2y2 − x + y − 2 = p

Page 30: Problem solving with Computer Algebraic Systems

29

and on the factorization of the polynomial on the left hand side. It is easy to check

that

x3y3 +x3y2−x2y3 +x2y2−x+y−2 = (xy−1)(x2y2 +x2y−xy2 +2xy+x−y+2),

so we get xy−1 = ±1 or xy−1 = ±p, and the other factor is ±p or ±1, respectively.

First case: xy − 1 = 1. Then xy = 2 and we have

x2y2 + x2y − xy2 + 2xy + x− y + 2 = 4 + 2(x− y) + 4 + x− y + 2 = 3(x− y) + 10.

In the case x = 1, y = 2 we obtain 3(x − y) + 10 = 7, and if x = 2, y = 1, then

3(x−y)+10 = 13, further, if x = −1, y = −2, then 3(x−y)+10 = 13, and finally

if x = −2, y = −1, then 3(x − y) + 10 = 7, and we get the pairs

(x, y) = (1, 2), (2, 1), (−1,−2), (−2,−1)

as the solutions of our problems.

Second case: xy − 1 = −1. Now we get xy = 0, that is x = 0 or y = 0. In the first

case −y + 2 = −p, that is y = p + 2, in the second case x + 2 = −p, which implies

x = −p − 2. The corresponding solutions are

(x, y) = (0, p + 2), (−p − 2, 0).

Third case: xy − 1 = p. Then the factor

x2y2 + x2y − xy2 + 2xy + x − y + 2

is 1. However,

x2y2 + x2y − xy2 + 2xy + x − y + 2 = (xy + 1)(xy + 1 + x − y) + 1,

which gives

(xy + 1)(xy + 1 + x − y) = 0

Page 31: Problem solving with Computer Algebraic Systems

30

Since xy = p + 1, we have p + 2 + x − y = 0. Substituting this into the previous

equation gives

x(p + 2 + x) = p + 1

which is impossible.

Finally, if xy − 1 = −p, then

(xy + 1)(xy + 1 + x − y) + 1 = −1,

which shows that

(2 − p)(1 − p + x − y) = −2

and thus p = 3 and (x, y) = (1,−2), or (2,−1).

Solution with CAS: factor(x3 ∗ y3 + x3 ∗ y2 − x2 ∗ y3 + x2 ∗ y2 − x + y − 2);

(y ∗ x − 1) ∗ (x2 ∗ y2 + y ∗ x2 − y2 ∗ x + 2 ∗ y ∗ x + x − y + 2)

Problem (KoMaL K.311.) One can see that the integer

772009 + 772010 + 772011 + 772012

is divisible by 7 and 11. Determine all the prime divisors of this number.

Solution: It is easy to see that

772009 + 772010 + 772011 + 772012 = 772009(1 + 77 + 772 + 773) = 462540 · 772009,

and 462540 is divisible by 3, 4, and 5. A short calculation gives the prime factors

13 and 593. Now, all the prime divisors of our numbers are

{2, 3, 5, 7, 11, 13, 593}.

Page 32: Problem solving with Computer Algebraic Systems

31

Solution with CAS: ifactor (772009 + 772010 + 772011 + 772012);

22 · 3 · 5 · 72009 · 112009 · 13 · 593.

Problem (KoMaL K.18.) Determine the distinct digits a, b, c and d such that

abcd : dcba = 4,

where abcd and dcba denote four-digit numbers.

Solution: From the condition we have

4 · dcba = abcd.

Rewriting this for digits we obtain

1000a + 100b + 10c + d = 4000d + 400c + 40b + 4a

and

332a + 20b = 1333d + 130c.

One can see that d = 1 or d = 2 and (since d is even) we have d = 2. The number

2a − 3d = 2a − 6 is divisible by 10-zel, a − 3 is is divisible by 5, so a = 3 or 8,

however, a is at least 4, finally we get a = 8. These values yield

2656 + 20b = 2666 + 130c,

that is

2b = 1 + 13c.

The unique solution of this equation is (b, c) = (7, 1).

Solution with CAS: for a to 9 do; for b from 0 to 9 do; for c from 0 to

9 do; for d from 1 to 9 do; if 1000 ∗ a + 100 ∗ b + 10 ∗ c + d = 4 ∗ (1000 ∗

Page 33: Problem solving with Computer Algebraic Systems

32

d + 100 ∗ c + 10 ∗ b + a) then print(1000 ∗ a + 100 ∗ b + 10 ∗ c + d) end if; end

do; end do; end do; end do;

Problem (KoMaL C.781.) Determine the positive prime numbers p > q > r, for

which

p2 − (q + r)2 = 136.

Solution: We can factorize the left hand side

(p + q + r)(p − q − r) = 136 = 23 · 17.

Suppose that r > 2, then the factor p+q+r is odd, and thus we have p+q+r = 17

and p − q − r = 8, which is obviously impossible. The contradiction gives r = 2.

Then we obtain two possibilities

p + q + 2 = 34, p − q − 2 = 4,

or

p + q + 2 = 68, p − q − 2 = 8.

In the first case we get p = 19, q = 13, and the second case yields p = 38, q = 28.

Solution with CAS: with(numtheory);

divisors(136);

{1, 2, 4, 8, 17, 34, 68, 136}

Problem (KoMaL C.854.) Prove that the following equation

13 + 33 + 53 + . . . + (2n − 1)3

1 + 3 + 5 + . . . + (2n − 1)= 2n2 − 1

is true for every positive integer n.

Page 34: Problem solving with Computer Algebraic Systems

33

Solution: One can prove by mathematical induction that the formulas

13 + 23 + . . . + n3 =n2(n + 1)2

4,

and

1 + 2 + . . . + n =n(n + 1)

2.

are true for every positive integer n. Using these identities we get

13 + 33 + 53 + . . . + (2n − 1)3 =(2n)2(2n + 1)2

4− 8 · n2(n + 1)2

4,

and

1 + 3 + 5 + . . . + (2n − 1) =2n(2n + 1)

2− 2 · n(n + 1)

2,

further,n2(2n + 1)2 − 2n2(n + 1)2

n(2n + 1) − n(n + 1)=

n2(2n2 − 1)

n2.

Solution with CAS:

factor

(sum((2k − 1)3, k = 1..n)

sum(2k − 1, k = 1..n)

)

= 2n2 − 1.

Problem (KoMaL B.3671.) Solve the equation

(x2 + y)(x + y2) = (x − y)3

in the set of integer numbers.

Solution: If y = 0, then every integer x is a solution of our equation. In the sequel

we assume that y 6= 0. Reordering the equation and dividing it by y we have the

quadratic (in y) equation

2y2 + (x2 − 3x)y + (3x2 + x) = 0

Since y is integer, the discriminant of this quadratic equation is a perfect square,

Page 35: Problem solving with Computer Algebraic Systems

34

i. e.

(x2 − 3x)2 − 4 · 2 · (3x2 + x) = x(x − 8)(x + 1)2

is a perfect square. This expression is a perfect square if and only if x(x − 8) is a

perfect square so we have to solve the equation

x(x − 8) = k2

in unknown integers x, k. From this equation we get

(x − 4)2 − k2 = (x + k − 4)(x − k − 4) = 16

and (x, k) = (−1,±3), (0, 0), (8, 0), (9,±3).

Solution with CAS: factor((x2 + y)(y2 + x) − (x − y)3);

y(yx2 + 2y2 + x + 3x2 − 3yx)

solve(yx2 + 2y2 + x + 3x2 − 3yx = 0, y);

−1

4x2 +

3

4x +

1

4

√x4 − 6x3 − 15x2 − 8x,−1

4x2 +

3

4x − 1

4

√x4 − 6x3 − 15x2 − 8x

factor(x4 − 6x3 − 15x2 − 8x);

x(x − 8)(x + 1)2

Problem (KoMaL C.1087.) The first term of an arithmetic progression is 1, the

second term is n, further, the sum of the first n terms is 33n. Determine n.

Solution: The difference of our arithmetic progression is n− 1. Using the formula

for the sum of the first n terms of an arbitrary arithmetic progression we have

Sn =n(a1 + an)

2=

n(1 + 1 + (n − 1)2)

2= 33n,

Page 36: Problem solving with Computer Algebraic Systems

35

which gives n = 9.

Solution with CAS: solve((n − 1)2 + 2 = 66, n);

9,−7

Problem (KoMaL K.13.) Determine the last two digits of the sum

71 + 72 + . . . + 72005.

Solution: Applying the well-known formula for the sum of first n terms of a geo-

metric progression we obtain

71 + 72 + . . . + 72005 =72006 − 7

6.

The binomial theorem gives

72006 = (50 − 1)1003 = 1000A −(

1003

2

)

2500 + 1003 · 50 − 1 = 1000B + 649,

that is the last two digits of the number

72006 − 7

6

are 42 : 6 = 07.

Solution with CAS: sum (7i, i = 1..2005);

30797610223128525661 . . . 2262083769819607

Problem (KoMaL C.778.) For an arithmetic progression Sm denotes the sum of

Page 37: Problem solving with Computer Algebraic Systems

36

the first m terms. Prove that

Sn+k

n + k=

Sn − Sk

n − k

for every n > k ≥ 1.

Solution: It is known that

Sn+k =(n + k)(a1 + an+k)

2=

(n + k)(2a1 + (n + k − 1)d)

2,

and similarly

Sn =n(2a1 + (n − 1)d)

2, Sk =

k(2a1 + (k − 1)d)

2,

From these relations we have

Sn − Sk =2a1(n − k) + (n(n − 1) − k(k − 1)) d

2.

However,

n(n − 1) − k(k − 1) = (n − k)(n − k − 1),

which proves our statement.

Solution with CAS: f := (2a1 + (n + k − 1)d)(n + k)/(2(n + k)) − ((2a1 + (n −1)d)n − (2a1 + (k − 1)d)k)/(2(n − k)); simplify(f);

0

Problem (KoMaL C.752.) Let a, b, c be consecutive terms of a geometrical prog-

ression. Prove that the numbers

a + b + c,√

3(ab + bc + ca),3√

27abc

are also consecutive terms of another geometrical progression.

Page 38: Problem solving with Computer Algebraic Systems

37

Solution: Since positive numbers a, b, c are consecutive terms of a geometrical

progression we have ac = b2. Now we have to show that

3√

27abc · (a + b + c) = 3(ab + bc + ac).

We know that

27abc = 27b3

and3√

27abc = 3b,

so the right hand side is

3b(a + b + c) = 3(ab + bc + b2) = 3(ab + bc + ac).

Solution with CAS: factor(3b(a + b + c) − 3(ab + bc + ca));

3b2 − 3ca

Problem (KoMaL C.984.) Three, not necessarily consecutive terms of an arith-

metic progression containing only positive numbers are a, b and c. We know that

c − b

a+

a − c

b+

b − a

c= 0.

Determine the difference of the sequence!

Solution: On multiplying through we have

0 = bc(c − b) + ac(a − c) + ab(b − a) = bc2 − b2c + a2c − ac2 + ab(b − a) =

c2(b − a) − c(b2 − a2) + ab(b − a) = (b − a)(c2 − c(a + b) + ab) =

(b − a)(c − a)(c − b).

This yields a = b or a = c or b = c so the difference of our arithmetic sequence is

Page 39: Problem solving with Computer Algebraic Systems

38

0.

Solution with CAS: factor(bc(c − b) + ac(a − c) + ab(b − a));

−(−c + b)(a − c)(−b + a)

Problem (KoMaL C.1064.) The real numbers x, y, z are consecutive terms of a

non-constant arithmetic progression such that

cos x + cos y + cos z = 1,

and

sin x + sin y + sin z =1√2.

Determine the tangent of the twelfth term if the first term is x.

Solution: Squaring the equations we obtain

cos2 x + cos2 y + cos2 z + 2 cos x cos y + 2 cos x cos z + 2 cos y cos z = 1

and

sin2 x + sin2 y + sin2 z + 2 sin x sin y + 2 sin x sin z + 2 sin y sin z =1

2,

then taking their sum and using the formulas

sin2 α + cos2 = 1,

and

cos α cos β + sin α sin β = cos(α − β),

we have

3 + 2 cos(x − y) + 2 cos(x − z) + 2 cos(y − z) =3

2.

Since the numbers x, y, z are consecutive terms of a non-constant arithmetic prog-

Page 40: Problem solving with Computer Algebraic Systems

39

ression, thus

y = x + d, z = x + 2d,

with d 6= 0. Finally, we get

3 + 2 cos(−d) + 2 cos(−2d) + 2 cos(−d) =3

2

which gives

2 cos d + cos 2d = −3

4.

It is known that

cos 2α = 2 cos2 α − 1,

so

2 cos2 d + 2 cos d − 1

4= 0.

There is only one solution of the quadratic equation with the condition cos d ≥ −1

cos d =

3

8− 1

2.

Using x = y − d and z = y + d in the first equation of our problem, we have

cos(y − d) + cos d + cos(y + d) = 1,

and

cos y =1

1 + 2 cos d=

2

3.

From these equations one can calculate the values d and y, and the twelfth term

is y + 10d.

Solution with CAS: solve(2x2 + 2x − 1/4 = 0, x);

−1

2+

1

4

√6,−1

2− 1

4

√6

Problem (KoMaL B.3529.) The sum of the first few terms of a geometrical

Page 41: Problem solving with Computer Algebraic Systems

40

progression is 11, the sum of their squares is 341, and the sum of their cubes is

3641. Determine the terms of geometrical progression.

Solution: From the conditions we have

a1 + a2 + . . . + an = 11,

a21 + a2

2 + . . . + a2n = 341,

and

a31 + a3

2 + . . . + a3n = 3641.

Using the formula for the sum of first n terms of an arbitrary geometrical progr-

ession we obtain

a1qn − 1

q − 1= 11,

a21

q2n − 1

q2 − 1= 341,

and

a31

q3n − 1

q3 − 1= 3641.

We remark that q 6= 1, otherwise

an = 11, a2n = 341,

which yields n = 1131

. Now we divide the the second and the third equation by the

first equation we obtain

a1qn + 1

q + 1= 31,

and

a21

q2n + qn + 1

q2 + q + 1= 331.

Since

a1(qn − 1) = 11(q − 1)

Page 42: Problem solving with Computer Algebraic Systems

41

and

a1(qn + 1) = 31(q + 1),

an easy calculation gives

a1 = 10q + 21,

and

qn =11(q − 1)

10q + 21+ 1 =

21q + 10

10q + 21.

(It is clear that a1 6= 0). Substituting these values into the equation

a21

q2n + qn + 1

q2 + q + 1= 331

we arrive at

2q2 + 5q + 2 = 0,

so q1 = −2, q2 = −12

and

a1 = 1, n = 5

or

a1 = 16, n = 5,

respectively.

Solution with CAS: solve(2q2 + 5q + 2 = 0, q);

−1

2,−2

Problem (KoMaL C.701.) Prove that the number

1 · 2 · . . . · 1001 + 1002 · 1003 · . . . · 2002

is divisible by 2003.

Solution: The remainder of 1002 dividing by 2003 is equal to the remainder of

Page 43: Problem solving with Computer Algebraic Systems

42

1002 − 2003 = −1001 dividing by 2003. The remainder of 1003 dividing by 2003

is equal to the remainder of 1003− 2003 = −1000 dividing by 2003, and so on. So

the remainder of the number

1 · 2 · . . . · 1001 + 1002 · 1003 · . . . · 2002

is equal to the remainder of the number

1 · 2 · . . . · 1001 + (−1001)(−1000)(−999) · . . . · (−1)

dividing by 2003. One can see that this number is 0, so our statement is proved.

Solution with CAS: (product(i, i = 1 .. 1001)+product(i, i = 1002 .. 2002), 2003)

mod 2003

0

Problem (KoMaL C.704.) Determine the positive integers n for which

log2 3 · log3 4 · . . . · logn(n + 1) = 10?

Solution: It is known that

loga b =1

logb a.

Using this formula we have

log2 3 · log3 4 =log3 4

log3 2= log2 4,

log2 3 · log3 4 · log4 5 = log2 4 · log4 5 =log4 5

log4 2= log2 5,

and finally

log2 3 · log3 4 · . . . · logn(n + 1) = log2 n · logn(n + 1) =logn(n + 1)

logn 2= log2(n + 1).

Page 44: Problem solving with Computer Algebraic Systems

43

Now we have to solve the equation

log2(n + 1) = 10

which gives n = 1023 as a solution.

Solution with CAS: evalf(product(log[i](i + 1), i = 2..1023));

10

Problem (KoMaL B.3542.) Prove that a number in the form 1111 . . . 11 is divi-

sible by 7, then is is also divisible by 37.

Solution: From the condition we know that

7|1111 . . . 11 =10n − 1

9.

It shows that the exponent n is divisible by 6, that is the number is divisible by

106 − 1. However,

106 − 1 = 33 · 7 · 11 · 13 · 37,

so our statement is proved.

Solution with CAS: We calculate the exponent n between 1 and 40 such that the

number 10n−19

is divisible by 7. for i to 40 do; if (10i − 1)/9 (mod ) 7 =

0 then print(i) end if; end do; The result: {6, 12, 18, 24, 30, 36}. From this

we can conjecture that the numbers consisting 1’s are divisible by 7 if and only if

the corresponding exponent is divisible by 6. Indeed, in this case the number is

divisible by 37.

Problem (KoMaL B.3522.) Solve the equation

2x4 + x2y2 + 5y2 = y4 + 10x2

Page 45: Problem solving with Computer Algebraic Systems

44

in the set of integer numbers.

Solution: Reordering the equation we have

2x4 + x2y2 + 5y2 − y4 − 10x2.

One can observe that

2x4 + x2y2 + 5y2 − y4 − 10x2 = (2x2 − y2)(x2 + y2 − 5) = 0.

From this 2x2 = y2, and x = y = 0 or x2 + y2 = 5. The last equation possesses 8

integer solutions

x = ±2, y = ±1, x = ±1, y = ±2,

so the original equation has 9 solutions in the set of integer numbers.

Solution with CAS: factor(2x4 + x2y2 + 5y2 − y4 − 10x2);

(2x2 − y2)(x2 + y2 − 5)

Problem (KoMaL B.3530.) Calculate the exact value of the expression

(2002

0

)

−(

2001

1

)

+

(2000

2

)

− . . . −(

1001

1001

)

.

Solution: Let n be a positive integer and let Sn denote the sum

[n/2]∑

i=0

(−1)i

(n − i

i

)

.

We have to calculate S2002. One can prove, by using the identity

(n

k

)

=

(n − 1

k − 1

)

+

(n − 1

k

)

,

Page 46: Problem solving with Computer Algebraic Systems

45

that

Sn = Sn−1 + Sn−2

for every positive integer n ≥ 3. A straightforward calculation gives that

S1 = S6 = 1, S2 = S5 = 0,

and

S3 = S4 = −1.

By mathematical induction we have that

S6k = S6k+1 = 1, S6k+2 = S6k+5 = 0, S6k+3 = S6k+4 = −1,

for every positive integer k. Since 2002 = 6 · 333 + 4, as a final result we obtain

S2002 = −1.

Solution with CAS: sum((−1)ibinomial(2002 − i, i), i = 0..1001);

−1

Problem (KoMaL B.3517.) Prove that 71|61! + 1.

Solution: The Wilson’s Theorem gives that 70!+1 is divisible by 71. To prove our

statement is enough to prove that the number

61! − 70!

is divisible by 71. It is clear that

61! − 70! = 61!(1 − 62 · 63 · 64 . . . · 69 · 70),

and an easy calculation shows

1 − (−9)(−8) · . . . · (−1) = 9! + 1 = 19 · 71 · 269.

Page 47: Problem solving with Computer Algebraic Systems

46

Solution with CAS: ifactor (61! + 1);

71 · 227 · 48795702665964504883 · 645414773564183 . . . 58905144895791

Problem (KoMaL C.648.) What is the exact value of the expression

2log6 18 · 3log6 3?

Solution: Using some well-known identities of the logarithm function we have

log6 18 = log6 3 + log6 6 = log6 3 + 1,

and thus

2log6 18 · 3log6 3 = 2 · 2log6 3 · 3log6 3 = 2 · 6log6 3 = 6.

Solution with CAS: evalf(2log[6](18) ∗ 3log[6](3));

6.000000001

Problem (KoMaL K.252.) We multiply the sum of 6 consecutive integer numbers

by the sum of the next 6 consecutive numbers. Prove that the remainder of the

product dividing by 36 is independent on the choice of the original integer numbers.

Solution: Let

6k, 6k + 1, . . . , 6k + 5,

and

6k + 6, 6k + 7, . . . , 6k + 11

denote the integers. The corresponding sums are 36k+15 and 36k+51, respectively,

and the product is

(36k + 15)(36k + 51) = 362k2 + 66 · 36k + 15 · 51.

Page 48: Problem solving with Computer Algebraic Systems

47

This form yields that the remainder dividing by 36 is 9 for every k.

Solution with CAS: ‘mod‘((36k + 15)(36k + 51), 36);

9

Problem (KoMaL C.595.) Determine all the three-digit numbers such that they

are equal to the sum of factorials of their digits.

Solution: Let N = abc denote an integer with the above mentioned property. Then

we have

100a + 10b + c = a! + b! + c!.

It is clear that the number N does not contain the digits 7, 8, 9, because the

factorial of these digits are greater than 1000. If the number N contains the digit

6 then it contains at least a digit 7, which is impossible. The number N must

contain a digit 5, because 3 · 4! = 72 < 100. If it contains only one digit 5 then

the number is between 5! + 2 · 0! and 5! + 2 · 4!, so the number begins with digit 1,

further, the factorial of the third digit is 1, 2, 6 or 24. The possible candidates are

121 + 1, 121 + 2, 121 + 6, 121 + 24,

and a quick check shows that the unique solution is 145.

If the number contains two digits 5 then the number is between 240 + 0! and

240 + 4! that is it begins with digit 2. The sum of the factorials is 242, however

this number does not contain any digit 5.

Finally, if N contains three digits 5, we have N = 555, however,

3 · 5! 6= 555.

There is only one solution of the problem, namely, 145 = 1 + 4! + 5!.

Remark: There is a straightforward generalization of our problem. Determine the

positive integers such that they are equal to the sum of factorials of their digits.

Page 49: Problem solving with Computer Algebraic Systems

48

Let k be an n-digit number with this property. Then

k ≥ 10n,

on the other hand the sum of factorials of digits is at most

n · 9! = 362800n.

Thus we have

10n ≤ 363800n.

and this gives n ≤ 6.

Solution with CAS: for a to 9 do; for b from 0 to 9 do; for c from 0 to

9 do; if 100∗a+10∗b+c = factorial(a)+factorial(b)+factorial(c) then

print(a, b, c); end if; end do; end do; end do;

1, 4, 5

Problem (KoMaL C.570.) Determine the three-digit prime numbers such that

the product of their digits is 189.

Solution: The canonical form of 189 is 33 · 7. Since we have digits, the prime

numbers with the property mentioned above consist of the digits 3, 7, 9. We have

six possibilities, from these numbers

379, 397, 739, 937

are prime numbers and 793 = 13 · 61 and 973 = 7 · 139 are composite numbers.

Solution with CAS: for a to 9 do; for b from 0 to 9 do; for c from 0 to

9 do; n := 100a + 10b + c; if (isprime(n) = true) and (abc = 189) then

print(n); end if; end do; end do; end do;

Page 50: Problem solving with Computer Algebraic Systems

49

Problem (KoMaL C.573.) Solve the following equation

12 + 22 + . . . + n2 = 1 + 2 + . . . + (2n − 1) + 2n

in the set of positive integers.

Solution: It is known that

12 + 22 + . . . + n2 =n(n + 1)(2n + 1)

6,

and

1 + 2 + . . . + (2n − 1) + 2n =2n(2n + 1

2.

From these formulas we obtain

n(n + 1)(2n + 1)

6= n(2n + 1),

and n = 5.

Solution with CAS: factor(sum(k2, k = 1..n)-(sum(k, k = 1..2n)));

1

6n(2n + 1)(n − 5)

Problem (KoMaL B.3342.) Determine the positive integers n such that the exp-

ression n2 − 19n + 99 is perfect square.

Solution: We have to solve the diophantine equation

n2 − 19n + 99 = m2

On multiplying by 4, we have

4n2 − 76n + 396 = (2n − 18)2 − 324 + 396 = (2n − 18)2 + 72 = (2m)2.

Page 51: Problem solving with Computer Algebraic Systems

50

and after reordering and factorization we get

(2m − 2n + 18)(2m + 2n − 18) = 72,

and

(m − n + 9)(m + n − 9) = 18.

An easy calculation gives n = 1, 9, 10 and 18.

Solution with CAS: for n from 1 to 30 do; if type(sqrt(n2 − 19 ∗ n + 99),

integer) = true then print(n); end if; end do;

1

9

10

18

Problem (HMMT, 2005) We know that the number 27000001 has four distinct

prime divisors. What is their sum?

Solution: Here we use the formula

a3 + b3 = (a + b)(a2 + ab + b2).

It is clear that

27000001 = 3003 + 13 = 301 · (3002 − 300 + 1) =

= 7 · 43 · (3012 − 302) = 7 · 43 · 271 · 331.

Solution with CAS: ifactor(27000001);

{7, 43, 271, 331}

Page 52: Problem solving with Computer Algebraic Systems

51

Problem (ARML, 2002) Let a be an integer number such that

1 +1

2+

1

3+ . . . +

1

23=

a

23!.

What is the remainder of a dividing by 13?

Solution: The equation yields

a = 23!

(

1 +1

2+

1

3+ . . . +

1

23

)

.

It is clear that every summand is divisible by 13, apart from the term 23!13

. The

remainder of this number dividing by 13 is equal to the remainder of the number

1 · 2 · · · · 6 · (−6) · (−5) · (−1) · 1 · 2 · · · · 10

dividing by 13. This is the remainder of

(6!)3 · 7 · 8 · 9 · 10

dividing by 13. Since 6! = 720 = 55 · 13 + 5, the remainder is 7.

Solution with CAS: ‘mod‘(factorial(23)*(sum(1/n, n = 1..23)), 13)

7

Problem (MOSP, 1998) Prove that the sum of 3, 4, 5 or 6 consecutive square is

never square. Give an example that the sum of 11 consecutive squares is square.

Solution: Suppose that the sum of three consecutive squares is square. This means

that the equation

3n2 + 2 = (n − 1)2 + n2 + (n + 1)2 = y2

Page 53: Problem solving with Computer Algebraic Systems

52

has a solution in unknown integers n and y. It is known that the remainder of a

square dividing by 3 is 0 or 1. The left hand side gives 2 as a remainder dividing

by 3, so there is no solution of the equation.

We consider the sum of four consecutive squares, that is consider the equation

(n − 1)2 + n2 + (n + 1)2 + (n + 2)2 = 4n2 + 4n + 6 = y2

in n and y unknown integers. Since the left hand side is even, and thus y2 and y

are even. In this case 4 is a divisor of y2, however, the 2-order of the left hand side

is 1. We arrive at a contradiction, there is no solution.

If we consider the sum of 5 consecutive squares then we get the equation

(n − 2)2 + (n − 1)2 + n2 + (n + 1)2 + (n + 2)2 = 5n2 + 10 = y2

The left hand side is divisible by 5, so 5|y, and 25|y2 = 5(n2+2). This yields 5|n2+

2, however, a square give 0, 1 or 4 as a remainder dividing by 5, a contradiction.

Considering the sum of 6 consecutive squares yields the equation

(n − 2)2 + (n − 1)2 + n2 + (n + 1)2 + (n + 2)2 + (n + 3)2 = 6n2 + 6n + 19 = y2.

It is known that a square gives 0 or 1 as a remainder dividing by 4. The left hand

side is

6n2 + 6n + 19 = 6n(n + 1) + 19.

Since n or n + 1 is even, the left hand side give 3 as a remainder dividing by 4, a

contradiction again.

Finally, the sum of 11 consecutive squares leads to the equation

11n2 + 2(12 + 22 + 32 + 42 + 52) = 11n2 + 110 = y2.

One can see that n = 1, y = 11 is a solution of this equation. Indeed,

(−4)2 + (−3)2 + (−2)2 + (−1)2 + 02 + 12 + 22 + 32 + 42 + 52 + 62 = 121 = 112.

Page 54: Problem solving with Computer Algebraic Systems

53

Solution with CAS: for n from 1 to 1000 do: if type(sqrt(11 ∗ n2 + 110),

integer) = true then print(n): end if; end do;

1

23

43

461

859

Problem (KoMaL B.4449.) How many zeros does the number 456

+ 654

(in base

10) end with?

Solution: Since the number is divisible by 254

, so we consider its 5-order. The

binomial theorem shows

456

= (5 − 1)56

=56

i=0

(56

i

)

5i(−1)56−i

and

654

= (5 + 1)54

=54

i=0

(54

i

)

5i.

It is clear that for i = 0, in the first sum is −1 van, in the second sum is 1, so their

sum is 0. If i = 1, the the corresponding sum is 56 + 55 = 6 · 55. We will prove

that for i > 1, the summands

(56

i

)

5i(−1)56−i

and (54

i

)

5i

Page 55: Problem solving with Computer Algebraic Systems

54

are divisible by 56. This statement is trivial for i ≥ 6. If 2 ≤ i ≤ 4, then we have

(5k

i

)

=5k(5k − 1) · · · (5k − i + 1)

i!,

that is this number is divisible by 5k, and thus

(56

i

)

5i(−1)56−i

and (54

i

)

5i

is divisible by 56. Finally, in the case i = 5, one can see that the binomial

coefficients (56

i

)

,

(54

i

)

are divisible by 5. This yields that the sum is divisible by 55, but it is not divisible

by 56, that is the number ends with 5 zeros.

Solution with CAS: 456

+ 654

;

1539446141412626239132 . . . 484800000

Problem (KoMal C.1160.) What is the remainder of

20122013 + 20132012

dividing by 2012 · 2013?

Solution: Consider the fraction

20122013 + 20132012

2012 · 2013.

Page 56: Problem solving with Computer Algebraic Systems

55

Dividing by terms we have

20122013 + 20132012

2012 · 2013=

20122012

2013+

20132011

2012.

Now we apply the binomial theorem and we get

20122012 = (2013 − 1)2012 = 2013A + (−1)2012 = 2013A + 1,

where A is a positive integer and similarly, we have

20132011 = (2012 + 1)2011 = 2012B + 12011,

where B is a positive integer. Using this notation

20122013 + 20132012

2012 · 2013=

2013A + 1

2013+

2012B + 1

2012=

A +1

2013+ B +

1

2012= A + B +

2013 + 2012

2012 · 2013,

that is the remainder is 4025.

Solution with CAS: 20122013 + 20132012 mod 2012 · 2013;

4025

Remark: A straightforward generalization of our problem is the following. What

is the remainder of the sum

nn+1 + (n + 1)n

dividing by n(n + 1)? Consider the fraction

nn+1 + (n + 1)n

n(n + 1).

Page 57: Problem solving with Computer Algebraic Systems

56

Dividing by terms we have

nn+1 + (n + 1)n

n(n + 1)=

nn

n + 1+

(n + 1)n−1

n.

Since

nn = (n + 1 − 1)n = A(n + 1) + (−1)n

and

(n + 1)n = Bn + 1,

where A and B are positive integers, we obtain

nn

n + 1+

(n + 1)n−1

n= A +

(−1)n

n + 1+ B +

1

n,

so the remainder is

(−1)nn + n + 1.

Problem (KoMal B.4503.) Determine the four-digit perfect square numbers such

that their first and last two digits are equal.

Solution: Our number is four-digit one and its first two and last two digits are

equal, we have to find it in the form aabb, and

x2 = aabb

for some integer x. Since x2 is a four-digit number we have

1000 ≤ x2 ≤ 9999,

thus

21 ≤ x ≤ 99.

It is clear that

x2 = 1000a + 100a + 10b + b = 11(100a + b),

Page 58: Problem solving with Computer Algebraic Systems

57

so we have 11|x2, and 11|x. We obtain 7 possibilities for x

x ∈ {33, 44, 55, 66, 77, 88, 99}

and a quick calculation gives the unique solution 882 = 7744.

Solution with CAS: for a to 9 do; for b from 0 to 9 do; n := a(103+102)+

11b; if type(sqrt(n), integer) = true then print(n); end if; end do;

end do;

88

Problem (KoMal K.356.) Two digits of the six-digit number

2X01X2

are missing. Find the missing digits such that the corresponding six-digit number

is divisible by 36 and 117.

Solution: Since 36 = 4 · 9 and 117 = 9 · 13, our six-digit integer is divisible by 4, 9

and 13. The number is divisible by 4, so the the last two digits in our number is

divisible by 4, and thus the next to last digit (nld) is 1, 3, 5, 7 or 9 lehet. Since the

six-digit number is divisible by 9, the sum of its digits is also divisible by 9. Now,

if nld is 1, then the second digit is 3, if nld is 3, then the second digit is 1, if nld

is 5, then the second digit is 8, if nld is 7, then the second digit is 6, and, finally,

if nld 9, then the second digit is 4. The corresponding numbers are

230112, 210132, 280152, 260172, 240192.

We know that the required number is divisible by 13. After a short calculation we

get the unique solution 210132, so the missing digits are 1 and 3.

Solution with CAS: for a from 0 to 9 do for b from 0 to 9 do; n := 2 ·105 + a · 104 + 100 + 10b + 2; if n mod 36 · 13 = 0 then print(n); end if;

end do; end do;

Page 59: Problem solving with Computer Algebraic Systems

58

Problem (KoMal Gy.3254.) Is there a perfect cube in the form

ababab1

(in base 10)?

Solution: Let n = k3 be an integer number in the form ababab1. Since

106 ≤ n < 107,

so we have

100 ≤ k ≤ 215.

Expanding the form of this number we get

n = 1 + b · 10 + a · 100 + b · 1000 + a · 104 + b · 105 + a · 106 =

= 1 + b(10 + 103 + 105) + a(102 + 104 + 106).

Now we have

n = 1 + (10 + 103 + 105)(b + 10a),

and thus n − 1 is divisible by 30. Since

n − 1 = k3 − 1 = (k − 1)(k2 + k + 1)

is divisible by 30, we will show that k− 1 is also divisible by 30. Because the cube

of this number is odd, we have that k is odd and so k − 1 is even. The cube of

k is in the form 3l + 1, where l is an integer number, so k is in the form 3l + 1.

Indeed, it is clear that k is not divisible by 3, and if it would be in the form 3l +2,

the its cube also would be in the form 3l + 2. If k is divisible by 5, then k3 − 1 is

not divisible by 5, further if k = 5l + 2, then k3 − 1 = (5l + 2)3 − 1 gives 2 as a

remainder dividing by 5, if k = 5l + 3, then k3 − 1 gives 1 as a remainder dividing

5, and finally, if k = 5l + 4, then k3 − 1 yields 3 as a remainder dividing 5. We

Page 60: Problem solving with Computer Algebraic Systems

59

have k = 5l + 1 and from this we have k = 30l + 1. In the interval

100 ≤ k ≤ 215

we get for possibilities for k, namely,

k ∈ {121, 151, 181, 211}.

A final check gives the unique solution

2113 = 9393931.

Solution with CAS: for a from 1 to 9 do; for b from 0 to 9 do n := a ·106 + b · 105 + a · 104 + b · 103 + a · 102 + 10b+ 1; if type(root[3](n), integer)

= true then print(n); end if; end do; end do;

Problem (KoMaL B.4243.) Prove that the number

6564 + 64

is composite.

Solution: Completing the square gives

6564 + 64 = (6532 + 8)2 − 2 · 8 · 6532 = (6532 + 8)2 − (4 · 6516)2.

Applying the identity

a2 − b2 = (a − b)(a + b)

and we get

6564 + 64 = (6532 − 4 · 6516 + 8)(6532 + 4 · 6516),

that is our number is composite.

Page 61: Problem solving with Computer Algebraic Systems

60

Solution with CAS: ifactor(6564 + 64) =

3916733 · 12653×

×848064026205894987841230736413208938269543326969×

×2500297 · 89009 · 136573 · 929501×

×89509365027181240985382554457790961

Problem (KoMaL C.1001.) Determine the positive integer such that it has two

prime divisors, the number of its divisors is 6, and the sum of its divisors is 28.

Solution: We consider the numbers in the form

n = pαqβ,

where p es q are distinct prime numbers,

(α + 1)(β + 1) = 6,

further σ(n) = 28, where σ(n) denotes the sum of positive divisors of n. It is easy

to see that n has the form pq2, so

1 + p + pq + pq2 + q + q2 = 28.

It is clear that q ≤ 3, otherwise the sum above is larger than 28. If q = 2, then

1 + p + 2p + 4p + 2 + 4 = 28,

and this yields p = 3. If q = 3, then

1 + p + 3p + 9p + 3 + 9 = 28,

es from this we have 13p = 15, which is impossible. The solution of our problem

Page 62: Problem solving with Computer Algebraic Systems

61

is n = 12.

Solution wit CAS: with(numtheory); for i from 1 to 27 do; A := divisors(i);

k := nops(A); B := 0; for j from 1 to k do B := B+A[j]; end do; if B

= 28 then print(i, B); end if; end do;

12, 28

Page 63: Problem solving with Computer Algebraic Systems

62

Page 64: Problem solving with Computer Algebraic Systems

Chapter 2

Equations and Inequalities

Problem (KoMaL B.4433.) Solve the equation (1 + x)8 + (1 + x2)4 = 82x4.

Solution: Since x = 0 is not a solution of our equation we can divide by x4. We

obtain (

x +1

x+ 2

)4

+

(

x +1

x

)4

= 82.

We introduce a new variable, let y = x + 1x

+ 1. Rewriting the previous equation

we have

(y + 1)4 + (y − 1)4 = 82,

and expanding it we have the following biquadratic equation

2(y4 + 6y2 − 40) = 0

This gives that y2 = −10 or y2 = 4. It is clear that the first value is impossible

and the second value yields

x +1

x= −3

or

x +1

x= 1.

However, the second case is impossible, because for an arbitrary nonzero real

63

Page 65: Problem solving with Computer Algebraic Systems

64

number x we have

x +1

x≥ 2 orx +

1

x≤ −2,

depending on the sign of x. So the real solutions of our original equations coincide

the solutions of the quadratic equation x2 + 3x + 1 = 0.

Solution with CAS: factor(

(x + 1)8 + (1 + x2)4 − 82 x4

)

;

2(x2 + 3 x + 1

) (x2 − x + 1

) (x4 + 2 x3 + 13 x2 + 2 x + 1

)

Since x2 − x + 1 > 0 and

x4 + 2 x3 + 13 x2 + 2 x + 1 = x2(x + 1)2 + 11x2 + (x + 1)2 > 0

for every real x, we obtain the above mentioned result.

Problem (KoMaL B.4027.) Solve the equation

x2 + 1

x2 + 11=

1

6

11x − 6

6 − x.

Solution: Taking the square of both sides and expanding the expressions we get

the equation

47x5 − 222x4 + 314x3 − 564x2 + 1367x − 942 = 0.

It is easy to see that x = 1, 2 and x = 3 are solutions of the equation, so we can

factorize the polynomial of degree 5. Indeed,

47x5 − 222x4 + 314x3 + 1367x − 942 = (x − 1)(x − 2)(x − 3)(47x2 + 60x + 157).

Now, the discriminant of the quadratic polynomial is negative, that is all potential

real solutions of the equation are 1, 2 es 3. Please check them!

Page 66: Problem solving with Computer Algebraic Systems

65

Figure 2.1: Graph of the function x2+1x2+11

− 16

√11x−66−x

Solution with CAS: factor(47x5 − 222x4 + 314x3 − 564x2 + 1367x − 942);

(x − 1)(x − 2)(x − 3)(47x2 + 60x + 157)

Remark: One can give a graphical solution, see Figure 2.1.

Problem (KoMaL C.1118.) Solve the equation

4x2 +3

4= 2

√x

in the set of real numbers.

Page 67: Problem solving with Computer Algebraic Systems

66

Solution: Squaring and reordering the original equation we have

256x4 + 96x2 − 64x + 9 = 0.

One can see that x = 14

is a solution of the original equation, so we get

256x4 + 96x2 − 64x + 9 = (4x − 1)(64x3 + 16x2 + 28x − 9)

further, 14

is a zero of the polynomial of degree 3, we can factorize

64x3 + 16x2 + 28x − 9 = (4x − 1)(16x2 + 8x + 9).

The quadratic polynomial is positive for every real x, so we have only one solution

x = 14.

Solution with CAS: See Figure 2.2!

Problem (KoMaL B.3403.) Prove that

1

a + b + c=

1

a+

1

b+

1

c

implies1

a5 + b5 + c5=

1

a5+

1

b5+

1

c5.

for every a, b, c.

Solution: Using the condition

1

a + b + c=

1

a+

1

b+

1

c,

we get that the product

(a + b)(a + c)(b + c)

is 0. It means that a = −b or b = −c or a = −c which guarantees our statement.

Page 68: Problem solving with Computer Algebraic Systems

67

Figure 2.2: The graphs of 4x2 + 34

and 2√

x

Page 69: Problem solving with Computer Algebraic Systems

68

Solution with CAS: factor(

1a+b+c

− 1a− 1

b− 1

c

)=

−(c + b)(c + a)(a + b)

(a + b + c)abc,

further,

factor(

1a5+b5+c5

− 1a5 − 1

b5− 1

c5

);

−(c + b)(c + a)(a + b) · · ·(a5 + b5 + c5)a5b5c5

Remark: One can generalize our problem: Suppose that for real a, b, c

1

a + b + c=

1

a+

1

b+

1

c,

then prove that

1

a2k+1 + b2k+1 + c2k+1=

1

a2k+1+

1

b2k+1+

1

c2k+1,

where k is a positive integer.

Problem (KoMaL C.601.) Solve the equation

x2 + x +√

x2 + x + 7 = 5

in the set of real numbers.

Solution: We will introduce a new variable, let y =√

x2 + x + 7 (The expression

under square root is positive for every x). Rewriting our equation we have

y2 − 7 + y = 5,

that is

y2 + y − 12 = 0

which gives y1 = −4, y2 = 3. The negative value is impossible, from the positive

Page 70: Problem solving with Computer Algebraic Systems

69

Figure 2.3: The graph of x2 + x +√

x2 + x + 7 − 5

value gives

x2 + x − 2 = 0

and we get x1 = 1, x2 = −2.

Solution with CAS: solve ((x2 + x − 5)2 − x2 − x − 7 = 0) ;

−2, 1,−1

2− 1

2

√37,−1

2+

1

2

√37

See Figure 2.3!

Problem (KoMaL B.4057.) Solve the equation

x6 − 6x + 5 = 0.

Page 71: Problem solving with Computer Algebraic Systems

70

Solution: It is easy to see that x = 1 is a solution of our equation. Thus we can

factorize the polynomial as

x6 − 6x + 5 = (x − 1)(x5 + x4 + x3 + x2 + x − 5).

Observe that x = 1 is a zero of polynomial x5 + x4 + x3 + x2 + x− 5, so we obtain

x6 − 6x + 5 = (x − 1)2(x4 + 2x3 + 3x2 + 4x + 5).

We show that

x4 + 2x3 + 3x2 + 4x + 5 > 0

for every real x. Indeed,

x4 + 2x3 + 3x2 + 4x + 5 = x2(x + 1)2 + 2(x + 1)2 + 3 ≥ 3.

Solution with CAS: factor(x6 − 6x + 5);

(x − 1)2(x4 + 2x3 + 3x2 + 4x + 5)

and solve(x4 + 2.x3 + 3x2 + 4x + 5);

{.287... + 1.416...I,−1.287... + .857I,−1.2878 − .857I, .287 − 1.416I}

The polynomial has four non-real zeros, and this fact gives that x4 + 2x3 + 3x2 +

4x + 5 > 0 for every real x.

Remark: See Figure 2.4!

Problem (AIME, 1983/3) What is the product of the real roots of the equation

x2 + 18x + 30 = 2√

x2 + 18x + 45?

Solution: We substitute a new variable y, say, for x2 + 18x + 30. Our equation

Page 72: Problem solving with Computer Algebraic Systems

71

Figure 2.4: The graph of x6 − 6x + 5

Page 73: Problem solving with Computer Algebraic Systems

72

becomes

y = 2√

y + 15.

Now we can square and solving for y, we have y = 10 or y = −6. The second

solution is extraneous (since 2√

y + 15 is always positive). Thus we get y = 10 as

the unique solution for y. On substituting

x2 + 18x + 30

back in for y, we obtain

x2 + 18x + 30 = 10

and

x2 + 18x + 20 = 0.

Using the Vieta’s formulas, the product of the roots is 20.

Solution with CAS: solve(x2 + 18x + 30 − 2sqrt(x2 + 18x + 45) = 0, x);

−9 −√

61,−9 +√

61

Problem (AIME, 1983/5) Suppose that the sum of the squares of two complex

numbers x and y is 7 and the sum of the cubes is 10. What is the largest real

value that x + y can have?

Solution: We have

x2 + y2 = (x + y)2 − 2xy = 7

and

x3 + y3 = (x + y)(x2 − xy + y2) = (7 − xy)(x + y) = 10.

Let w = x + y and z = xy. Using these substitutions we get

w2 − 2z = 7

Page 74: Problem solving with Computer Algebraic Systems

73

and

w(7 − z) = 10.

We have to calculate the largest possible (real) value for w, thus we have to find

an expression for z in terms of w. w2 − 7 = 2z implies z = w2−72

, and substituting,

we obtain

w3 − 21w + 20 = 0.

One can factorize the polynomial on the left hand side using the Rational Root

Theorem and

w3 − 21w + 20 = (w − 1)(w + 5)(w − 4) = 0,

and the largest possible solution is therefore x + y = w = 4.

Solution with CAS: factor(x3 − 21x + 20);

(x − 1)(x + 5)(x − 4)

Problem (AIME, 1983/9) Find the minimum value of

9x2 sin2 x + 4

x sin x

for 0 < x < π.

Solution: Let y = x sin x. Using this substitution we can rewrite the original

expression as9y2 + 4

y= 9y +

4

y.

Since x > 0 and sin x > 0 because 0 < x < π, we have y > 0. We can apply the

arithmetical-geometrical mean, and we have

9y +4

y≥ 2

9y · 4

y= 12

Page 75: Problem solving with Computer Algebraic Systems

74

Figure 2.5: The graph of 9x2 sin2 x+4x sin x

The equality holds when

9y =4

y⇐⇒ y2 =

4

9⇐⇒ y =

2

3.

Therefore, the asked minimum value is 12 (when x sin x = 23, since the function

x sin x is continuous and increasing on the interval 0 ≤ x ≤ π2

and its range on

that interval is from 0 ≤ x sin x ≤ π2, by the Intermediate Value Theorem, this

value is attainable).

Solution with CAS: See Figure 2.5!

Problem (AIME, 1984/13) Find the value of

10 cot(cot−1 3 + cot−1 7 + cot−1 13 + cot−1 21).

Page 76: Problem solving with Computer Algebraic Systems

75

Solution: We will use the fact

tan(arctan(x)) = x

and the addition formula,

tan(x + y) =tan(x) + tan(y)

1 − tan(x) tan(y).

Now, let

a = cot−1(3), b = cot−1(7), c = cot−1(13), d = cot−1(21).

We obtain

tan(a) =1

3, tan(b) =

1

7, tan(c) =

1

13, tan(d) =

1

21,

thus

tan(a + b) =13

+ 17

1 − 121

=1

2

and

tan(c + d) =113

+ 121

1 − 1273

=1

8,

so

tan((a + b) + (c + d)) =12

+ 18

1 − 116

=2

3.

Finally, we get

10 cot(cot−1 3 + cot−1 7 + cot−1 13 + cot−1 21) = 10 · 3

2= 15.

Solution with CAS: expand(10ctg(arcctg3 + arcctg7 + arcctg13 + arcctg21));

15

Page 77: Problem solving with Computer Algebraic Systems

76

Problem (AIME, 1986/1) What is the sum of the solutions to the equation

4√

x =12

7 − 4√

x?

Solution: Introduce a new variable, let y = 4√

x. Then we have

y(7 − y) = 12

and, by simplifying,

y2 − 7y + 12 = (y − 3)(y − 4) = 0.

This means that 4√

x = y = 3 or 4 and the asked sum of the possible solutions for

x is 44 + 34 = 337.

Solution with CAS: solve(root[4](x) = 12/(7-root[4](x)), x)

81, 256

Problem (AIME, 1986/4) Determine 3x4 + 2x5 if x1, x2, x3, x4, and x5 satisfy the

system of equations below.

2x1 + x2 + x3 + x4 + x5 = 6

x1 + 2x2 + x3 + x4 + x5 = 12

x1 + x2 + 2x3 + x4 + x5 = 24

x1 + x2 + x3 + 2x4 + x5 = 48

x1 + x2 + x3 + x4 + 2x5 = 96

Solution: Adding all five equations, we have

6(x1 + x2 + x3 + x4 + x5) = 6(1 + 2 + 4 + 8 + 16)

Page 78: Problem solving with Computer Algebraic Systems

77

so

x1 + x2 + x3 + x4 + x5 = 31.

On subtracting this from the fourth and fifth given equation we obtain x4 = 17

and x5 = 65, respectively.

3x4 + 2x5 = 3 · 17 + 2 · 65 = 181.

Solution with CAS: solve(x[1]+x[2]+x[3]+x[4]+2x[5] = 96, x[1]+x[2]+x[3]+

2x[4] + x[5] = 48,

x[1] + x[2] + 2x[3] + x[4] + x[5] = 24, x[1] + 2x[2] + x[3] + x[4] + x[5] = 12,

2x[1] + x[2] + x[3] + x[4] + x[5] = 6, [x[1], x[2], x[3], x[4], x[5]]);

[[x[1] = −25, x[2] = −19, x[3] = −7, x[4] = 17, x[5] = 65]]

Problem (AIME, 1986/11) The polynomial

1 − x + x2 − x3 + · · · + x16 − x17

may be written in the form

a0 + a1y + a2y2 + · · · + a16y

16 + a17y17,

where y = x + 1 and the ai’s are constants. Find the value of a2.

Solution: We know that x = y − 1. So

1 − x + x2 + · · · − x17 =

= 1 − (y − 1) + (y − 1)2 − (y − 1)3 + · · · − (y − 1)17.

We have to find the coefficient of the y2 term of each power of each binomial, which

Page 79: Problem solving with Computer Algebraic Systems

78

by the binomial theorem is

(2

2

)

+

(3

2

)

+ · · · +(

17

2

)

.

The Hockey Stick Identity gives that this quantity is equal to

(18

3

)

= 816.

Solution with CAS: f := sum((−1)ixi, i = 0..17);

f := 1−x+x2−x3+x4−x5+x6−x7+x8−x9+x10−x11+x12−x13+x14−x15+x16−x17

taylor(f, x = −1, 18);

18−153(x+1)+816(x+1)2−3060(x+1)3+8568(x+1)4−18564(x+1)5+31824(x+1)6

−43758(x + 1)7 + 48620(x + 1)8 − 43758(x + 1)9+

31824(x + 1)10 − 18564(x + 1)11 + 8568(x + 1)12 − 3060(x + 1)13

+816(x + 1)14 − 153(x + 1)15 + 18(x + 1)16 − (x + 1)17

Problem (AIME, 1988/3) Find (log2 x)2 if

log2(log8 x) = log8(log2 x).

Solution: Raise both as exponents with base 8,

8log2(log8 x) = 8log8(log2 x).

On the next step we use the definition of logarithms,

23 log2(log8 x) = log2 x.

Page 80: Problem solving with Computer Algebraic Systems

79

Applying the fact that k loga x = loga xk, we have

(log8 x)3 = log2 x

On the next step, we use the change of base formula, which states

loga b =logk b

logk a

for arbitrary k,(

log2 x

log2 8

)3

= log2 x.

Finally, we have

(log2 x)2 = (log2 8)3 = 27.

Solution with CAS: a := solve(log[2](log[8](x)) = log[8](log[2](x)), x); log[2](a)2;

27

Problem (AIME, 1991/1) Find x2 + y2 if x and y are positive integers such that

xy + x + y = 71

x2y + xy2 = 880.

Solution: Let a = x + y and b = xy. Rewriting our original system of eqations we

obtain

a + b = 71

ab = 880.

Solving this system of equations we have a quadratic equation

a2 − 71a + 880 = 0,

Page 81: Problem solving with Computer Algebraic Systems

80

which factors to

(a − 16)(a − 55) = 0.

Now we get either a = 16 and b = 55 or a = 55 and b = 16. For the first case, it is

easy to see that (x, y) can be (5, 11) (or vice versa). In the second case, since all

factors of 16 must be ≤ 16, no two factors of 16 can sum greater than 32, and so

there are no integral solutions for (x, y). The solution is

52 + 112 = 146.

Solution with CAS: solve(x2y + xy2 = 880, xy + x + y = 71, [x, y]);

[[x = 11, y = 5], [x = 5, y = 11],

[x = −RootOf(2Z−55 ∗Z +16) + 55, y = RootOf(2

Z−55 ∗Z +16)]]

Problem (AIME, 1994/4) Find the positive integer n for which

⌊log2 1⌋ + ⌊log2 2⌋ + ⌊log2 3⌋ + · · · + ⌊log2 n⌋ = 1994.

(For real x, ⌊x⌋ is the greatest integer ≤ x.)

Solution: It is easy to see that if

2x ≤ a < 2x+1

for some x ∈ Z, then

⌊log2 a⌋ = log2 2x = x.

Thus, there are 2x+1 − 2x = 2x integers a such that

⌊log2 a⌋ = x.

Page 82: Problem solving with Computer Algebraic Systems

81

Thus the sum of

⌊log2 a⌋

for all such a is x · 2x. Let k be the integer such that

2k ≤ n < 2k+1.

So for each integer j < k, there are exactly 2j integers a ≤ n such that

⌊log2 a⌋ = j,

and there are n − 2k + 1 such integers with

⌊log2 a⌋ = k.

Therefore,

⌊log2 1⌋ + ⌊log2 2⌋ + ⌊log2 3⌋ + · · · + ⌊log2 n⌋ =k−1∑

j=0

(j · 2j) + k(n − 2k + 1) = 1994,

A straightforward computation gives that

7∑

j=0

(j · 2j

)= 1538 < 1994

and8∑

j=0

(j · 2j

)= 3586 > 1994.

Thus, k = 8 and

k−1∑

j=0

(j · 2j) + k(n − 2k + 1) = 1538 + 8(n − 28 + 1) = 1994

which implies n = 312.

Page 83: Problem solving with Computer Algebraic Systems

82

Solution with CAS:

Problem (AIME, 1997/11) Let

x =

∑44n=1 cos n◦

∑44n=1 sin n◦

.

What is the greatest integer that does not exceed 100x?

Solution: Now we have

x =

∑44n=1 cos n◦

∑44n=1 sin n◦

=cos 1◦ + cos 2◦ + . . . + cos 43◦ + cos 44◦

sin 1◦ + sin 2◦ + . . . + sin 43◦ + sin 44◦=

=cos(45 − 1)◦ + cos(45 − 2)◦ + . . . + cos(45 − 43)◦ + cos(45 − 44)◦

sin 1◦ + sin 2◦ + . . . + sin 43◦ + sin 44◦

Using the identity

sin a + sin b = 2 sina + b

2cos

a − b

2

we obtain

sin x + cos x = sin x + sin(90 − x) = 2 sin 45 cos(45 − x) =√

2 cos(45 − x),

so our summation reduces to

x =1√2· (cos 1◦ + cos 2◦ + . . . + cos 44◦) + (sin 1◦ + sin 2◦ + . . . + sin 44◦)

sin 1◦ + sin 2◦ + . . . + sin 43◦ + sin 44◦=

1√2

(

1 +cos 1◦ + cos 2◦ + . . . + cos 43◦ + cos 44◦

sin 1◦ + sin 2◦ + . . . + sin 43◦ + sin 44◦

)

.

We can rewrite this equation as

x =1√2(1 + x).

We get x = 1 +√

2 and ⌊100x⌋ = 241.

Page 84: Problem solving with Computer Algebraic Systems

83

Solution with CAS: evalf(

100cos((1/180)·k·Pi),k=1..44cos((1/180)·k·Pi),k=1..44

)

;

241.42135623730950486

Problem (AIME, 1998/5) Given that

Ak =k(k − 1)

2cos

k(k − 1)π

2,

find

|A19 + A20 + · · · + A98|.

Solution:k(k − 1)

2

always evaluates to an integer, and the cosine of nπ where n ∈ Z is 1 if n is even

and −1 if n is odd, further, k(k−1)2

will be even if 4|k or 4|k−1, and odd otherwise.

So our sum is in the following form:

∣∣∣∣∣

98∑

i=19

Ai

∣∣∣∣∣= −19 · 18

2+

20 · 19

2+

21 · 20

2− 22 · 21

2− 23 · 22

2. . . ,

If we group the terms in pairs, we see that we can apply a formula for

n(n − 1)

2+

(n + 1)n

2=

n

2(n + 1 − (n − 1)) = n.

So the first two fractions add up to 19, the next two to -21, and so forth. If we

pair the terms again now, each pair adds up to −2. There are 98−19+12·2 = 20 such

pairs, so the asked sum is | − 2 · 20| = 040.

Solution with CAS: sum(k(k − 1)cos((1/2)k(k − 1)Pi), k = 19..98);

−80

Page 85: Problem solving with Computer Algebraic Systems

84

Problem (AIME, 2000 II/13) The equation

2000x6 + 100x5 + 10x3 + x − 2 = 0

has exactly two real roots, one of which is

m +√

n

r,

where m,n and r are integers, m and r are relatively prime, and r > 0. Find

m + n + r.

Solution: We can factor the polynomial on the left hand side:

2000x6 + 100x5 + 10x3 + x − 2 = 2(1000x6 − 1) + x(100x4 + 10x2 + 1) =

= 2[(10x2)3 − 1] + x[(10x2)2 + (10x2) + 1] =

= 2[10x2 − 1][(10x2)2 + (10x2) + 1] + x[(10x2)2 + (10x2) + 1] =

[(10x2)2 + (10x2) + 1][2(10x2 − 1) + x] =

(20x2 + x − 2)[(10x2)2 + (10x2) + 1].

One can see that

100x4 + 10x2 + 1 ≥ 1 > 0

for every real value of x. Thus the real roots must be the roots of the equation

20x2 + x − 2 = 0.

By the quadratic formula the roots of this are:

x =−1 ±

12 − 4(−2)(20)

40=

−1 ±√

1 + 160

40=

−1 ±√

161

40.

So we have

r =−1 +

√161

40,

Page 86: Problem solving with Computer Algebraic Systems

85

and the final answer is −1 + 161 + 40 = 200.

Remark. A well-known technique for dealing with symmetric (or as in this case,

nearly symmetric) polynomials is to divide through by a power of x with half of

the polynomial’s degree (in this case, divide through by x3), and then to use one

of the substitutions t = x ± 1x. In this case, the right substitution

t = x√

10 − 1

x√

10

gives

t2 + 2 = 10x2 +1

10x2

and

2√

10(t3 + 3t) = 200x3 − 2

10x3,

which reduces the equation to just

(t2 + 3)(

2√

10t + 1)

= 0.

Solution with CAS: solve(2000x6 + 100x5 + 10x3 + x − 2 = 0, x);

− 1

40+

1

40

√161,− 1

40− 1

40

√161,− 1

10

−5 + 5I√

3,

− 1

10

−5 − 5I√

3,1

10

−5 − 5I√

3

Problem (AIME, 2001, I/3) Find the sum of the roots, real and non-real, of the

equation

x2001 +

(1

2− x

)2001

= 0,

given that there are no multiple roots.

Solution: From Vieta’s formulas, in a polynomial of the form

anxn + an−1x

n−1 + · · · + a0 = 0,

Page 87: Problem solving with Computer Algebraic Systems

86

the sum of the roots is −an−1

an. From the Binomial Theorem, the first term of

(1

2− x

)2001

is −x2001, so the term with the largest degree is x2000. Thus we need the coefficient

of that term, as well as the coefficient of x1999. Using the Binomial Theorem again,

we have (2001

1

)

(−x)2000

(1

2

)1

=2001x2000

2

and (2001

1

)

(−x)1999

(1

2

)2

= −2001 · 2000

8x1999.

By Vieta’s formulas, we obtain that the sum of the roots is

−−2001 · 2502001

2

= 250 · 2 = 500.

Solution with CAS: coeff(x2001 + (1/2 − x)2001, x2000);

2001

2

coeff(x2001 + (1/2 − x)2001, x1999);

−500250

Problem (AIME, 2006 II/12) Find the sum of the values of x such that

cos3 3x + cos3 5x = 8 cos3 4x cos3 x,

where x is measured in degrees and 100 < x < 200.

Page 88: Problem solving with Computer Algebraic Systems

87

Solution: We will use the identity

2 cos 4x cos x = cos 5x + cos 3x

by the sum-to-product formulas. Defining a = cos 3x and b = cos 5x, we have

a3 + b3 = (a + b)3.

From this equation we obtain that ab(a + b) = 0. However,

a + b = 2 cos 4x cos x,

so we get cos x = 0, or cos 3x = 0, or cos 4x = 0, or cos 5x = 0. Hence the solution

set is

A = {150, 126, 162, 198, 112.5, 157.5}

and thus∑

x∈A x = 906.

Solution with CAS: See Figure 2.6!

Problem (AIME, 2008 I/8) Find the positive integer n such that

arctan1

3+ arctan

1

4+ arctan

1

5+ arctan

1

n=

π

4.

Solution: Since we are working with acute angles, we have

tan(arctan a) = a.

Note that

tan(arctan a + arctan b) =a + b

1 − ab,

by tangent addition. Thus we obtain,

arctan a + arctan b = arctana + b

1 − ab.

Page 89: Problem solving with Computer Algebraic Systems

88

Figure 2.6: The graph of cos 3x cos 5x(cos 3x + cos 5x)

Page 90: Problem solving with Computer Algebraic Systems

89

Applying this to the first two terms, we get

arctan1

3+ arctan

1

4= arctan

7

11.

Similarly,

arctan7

11+ arctan

1

5= arctan

23

24.

We now have

arctan23

24+ arctan

1

n=

π

4= arctan 1.

Thus,2324

+ 1n

1 − 2324n

= 1

and simplifying, 23n + 24 = 24n − 23, that is n = 047.

Solution with CAS: a:= tan((1/4)pi-arctan(1/3)-arctan(1/4)-arctan(1/5));

(−23 + 24 ∗ tan((1/4)Pi))/(24 + 23tan((1/4) ∗ Pi))

Problem (AIME, 2011 I/9) Suppose x is in the interval [0, π/2] and

log24 sin x(24 cos x) =3

2.

Find 24 cot2 x.

Solution: Using the definition of logarithm we can rewrite the given expression as

243 sin3 x = 24 cos x.

Square both sides and divide by 242 we get

24 sin3 x = cos2 x.

Using the identity

cos2 x = 1 − sin2 x,

Page 91: Problem solving with Computer Algebraic Systems

90

we have

24 sin3 x + sin2 x − 1 = 0.

The rational root theorem gives sinx = 13

as a root, and sin−1 13

does fall in the first

quadrant so it satisfies the interval. Thus sin2 x = 19

and, using the Pythagorean

Identity gives us cos2 x = 89. Then we use the definition of cot2 x to compute our

final answer.

24 cot2 x = 24cos2 x

sin2 x= 24

( 8919

)

= 24 · 8 = 192.

Solution with CAS: factor(24y3 + y2 − 1);

(3y − 1)(8y2 + 3y + 1)

Problem (AIME, 2013 I/5) The real root of the equation

8x3 − 3x2 − 3x − 1 = 0

can be written in the form3√

a + 3√

b + 1

c,

where a, b, and c are positive integers. Find a + b + c.

Solution: Observe that the equation yields

9x3 = (x + 1)3,

so it follows that3√

9x = x + 1.

Solving for x yields1

3√

9 − 1=

3√

81 + 3√

9 + 1

8,

so the answer is 98.

Page 92: Problem solving with Computer Algebraic Systems

91

Solution with CAS: solve(8x3 − 3x2 − 3x − 1 = 0, x);

3

831/3 +

1

832/3 +

1

8,

...

...

Problem Problem (KoMaL C.826.) Solve the equation

3x3

x3 − 1− x

x − 1= 2.

Solution: We suppose that x 6= 1 and we have

3x3

x3 − 1− x

x − 1=

2x3 − x2 − x

x3 − 1

which gives

x2 + x − 2 = (x + 2)(x − 1) = 0

The solution of the problem is x = −2.

Solution with CAS: solve(

3x3

x3−1− x

x−1= 2, x

)

;

−2

See Figure 2.7!

Problem (KoMaL K.100.) Solve the following equation in the set of real numbers:

x2 + 6 +1

x2= 4x +

4

x.

Solution: Let y = x + 1x. Then our equation leads to

y2 + 4 = 4y

Page 93: Problem solving with Computer Algebraic Systems

92

Figure 2.7: The graph of 3x3

x3−1− x

x−1− 2

Page 94: Problem solving with Computer Algebraic Systems

93

Figure 2.8: The graph of x2 + 6 + 1x2 − 4x − 4

x

and we obtain y = 2 es x = 1.

Solution with CAS: See Figure 2.8!

Problem Problem (KoMaL C.881.) Solve the equation

(x

2

)2

=

(x + 1

3

)3

.

Solution: A straightforward calculation gives

4x3 − 15x2 + 12x + 4 = 0.

Page 95: Problem solving with Computer Algebraic Systems

94

Figure 2.9: The graph of(

x2

)2 −(

x+13

)3

One can see that x = 2 is a solution of this equation, so

4x3 − 15x2 + 12x + 4 = (x − 2)(4x2 − 7x − 2).

The solutions of the original problem are x1 = 2, x2 = 2, x3 = −14.

Solution with CAS: See Figure 2.9!

Problem (KoMaL B.4176.) Solve the equation

(sin x + sin 2x + sin 3x)2 + (cos x + cos 2x + cos 3x)2 = 1.

Page 96: Problem solving with Computer Algebraic Systems

95

Solution: We will use the identities

(a + b + c)2 = a2 + b2 + c2 + 2ab + 2ac + 2bc,

sin α sin β + cos α cos β = cos(β − α)

and we have

3 + 4 cos x + 2 cos 2x = 1.

Since cos 2x = 2 cos2 x − 1, our equation leads to

cos2 x + cos x = 0

This yields cos x = 0 or cos x = −1, that is x = π2

+ kπ or x = π + 2lπ, where k

and l are integer numbers.

Solution with CAS: See Figure 2.10!

Problem (KoMaL B.4156.) Solve the equation

tg x + ctg x + 1 = cos(

x +π

4

)

.

Solution: On comparing the range of functions on the left and right hand side we

have

−1 ≥ tg x + ctg x + 1

or

tg x + ctg x + 1 ≥ 3.

Since

−1 ≤ cos(

x +π

4

)

≤ 1,

and the equality is only in the case

cos(

x +π

4

)

= −1

Page 97: Problem solving with Computer Algebraic Systems

96

Figure 2.10: The graph of cos2 x + cos x

Page 98: Problem solving with Computer Algebraic Systems

97

Figure 2.11: The graph of 1 + sinx cos x − sin x cos x cos(x + Π

4

)

which yields x = 3π4

+ 2kπ, where k is an integer number. Now the value of the

left hand side is −1, so we obtain the solutions of the equation.

Solution with CAS: See Figure 2.11!

Problem (KoMaL B.4157.) Solve the following equation

[x] = x4 − 2x2.

Solution: We consider the solutions x in the form

x = [x] + {x}

Page 99: Problem solving with Computer Algebraic Systems

98

where {x} denotes the fraction parts of x. Then we have

{x} = x − x4 − 2x2,

and thus

0 ≤ x − x4 − 2x2 < 1.

However, if |x| ≥ 2, then we get

x < 2x2, x + 2x2 < 4x2 ≤ x4,

and −2 < x < 2, and [x] = −2,−1, 0, 1. The corresponding quartic equations are

x4 − 2x2 + 2 = 0,

x4 − 2x2 + 1 = 0,

x4 − 2x2 = 0,

x4 − 2x2 − 1 = 0.

Since

x4 − 2x2 + 2 = (x2 − 1)2 + 1,

there is no real solution of the first equation We can rewrite the second equation

as

(x2 − 1)2 = 0

which yields x = ±1 and, by the condition [x] = −1, we have x = −1. We can

factorize the third equation

x4 − 2x2 = x2(x2 − 2) = 0.

The possible solutions are x = 0, x = ±√

2, but the last two values are not solutions

Page 100: Problem solving with Computer Algebraic Systems

99

Figure 2.12: The graph of [x] and x4 − 2x2

(by the condition [x] = 0). Finally, the fourth equation shows

(x2 − 1)2 = 2

and from this

x2 − 1 = ±√

2,

x2 = 1 +√

2,

and

x = ±√

1 +√

2.

Since [x] = 1, we obtain x =√

1 +√

2.

Solution with CAS: See Figure 2.12!

Page 101: Problem solving with Computer Algebraic Systems

100

Problem (KoMaL C.973.) Solve the equation

1 + cos 3x = 2 cos 2x.

Solution: It is known that

cos 3x = 4 cos3 x − 3 cos x,

and

cos 2x = 2 cos2 x − 1.

Using these identities we get

4 cos3 x − 4 cos2 x − 3 cos x + 3 = 0.

One can factorize the cubic expression as

4 cos3 x − 4 cos2 x − 3 cos x + 3 = (cos x − 1)(4 cos2 x − 3).

So we have cos x = 1 or cos x = ±√

32

, which gives x1 = 2kπ, x2 = ±π6

+ lπ, where

k, l ∈ Z.

Solution with CAS: solve(1 + cos(3x) − 2cos(2x) = 0);

0,π

6,5π

6

See Figure 2.13!

Problem (KoMaL B.4138.) Solve the equation

√2(sin x + cos x) = tg x + ctg x.

Solution: For the right side we have

|tg x + ctg x| ≥ 2.

Page 102: Problem solving with Computer Algebraic Systems

101

Figure 2.13: The graph of 1 + cos 3x − 2 cos 2x

Page 103: Problem solving with Computer Algebraic Systems

102

However,

|√

2(sin x + cos x)| = 2 ·√

2

2(| sin x + cos x|) = 2| cos(45◦ − x)| ≤ 2,

so all the solutions x of the equation we get

| cos(45◦ − x)| = 1

and x = 45◦ + k · 180◦. After checking these possible solutions we obtain

x = 45◦ + k · 360◦

as real solutions, where k is an integer number.

Solution with CAS: See Figure 2.14!

Problem (KoMaL C.955.) Solve the equation 10x − 5 = 9[x] in the set of real

numbers (here [x] denotes the integral part of x).

Solution: Let

x = [x] + {x},

where {x} denotes the fractional part of x. Using this notation we have

10[x] + 10{x} − 5 = 9[x]

and

5 − [x] = 10{x}.

It implies that 10{x} is an integer number, so possible values for {x} are k ·0.1, k =

0, 1, 2, . . . , 8, 9. From the previous equation we get [x] and x.

Solution with CAS: See Figure 2.15!

Page 104: Problem solving with Computer Algebraic Systems

103

Figure 2.14: The graph of√

2(sin x + cos x) sin x cos x − 1

Page 105: Problem solving with Computer Algebraic Systems

104

Figure 2.15: The graph of 10x − 9[x] − 5

Page 106: Problem solving with Computer Algebraic Systems

105

Problem (KoMaL B.4323.) Solve the equation

1 + x4

(1 + x)4=

3

4

Solution: Reordering the equation yields

x4 − 12x3 − 18x2 − 12x + 1 = 0

One can observe that this is a symmetric equation and x = 0 is not a solution.

We can divide by x2 and we have

x2 − 12x − 18 − 12

x+

1

x2= 0.

Introducing the new variable y = x + 1x

our equation leads to

y2 − 12y − 20 = 0.

Its solutions are y1,2 = 6 ±√

56. However, the absolute value of the sum of a

non-zero number and its reciprocal value is at least 2, it is enough to solve the

equation

x2 − (6 +√

56)x + 1 = 0

The solutions are

x1,2 = 3 +√

14 ±√

22 + 6√

14.

Solution with CAS: See Figures 2.16 and 2.17!

Problem (KoMaL B.4239.) Solve the equation

8x(2x2 − 1)(8x4 − 8x2 + 1) = 1.

Solution: If |x| > 1 then it it easy to see that the absolute value of the product on

the left hand side is at least 8. Thus for all the solutions x we have |x| ≤ 1. There

Page 107: Problem solving with Computer Algebraic Systems

106

Figure 2.16: The graph of 1+x4

(1+x)4− 3

4with x ∈ [0, 3]

Page 108: Problem solving with Computer Algebraic Systems

107

Figure 2.17: The graph of 1+x4

(1+x)4− 3

4with x ∈ [3, 15]

Page 109: Problem solving with Computer Algebraic Systems

108

exists a real number t for which

x = cos t,

and by using this substitution we get

8 cos t cos 2t cos 4t = 1.

Applying the identity

2 cos α cos β = cos(α + β) + cos(α − β)

we have

2(cos t + cos 3t + cos 5t + cos 7t) − 1 = 0.

It is clear that x = 12

is a solution of the original equation. Applying the trigono-

metric form of the original equation we obtain the solutions

t2 =2π

7, t3 =

7, t4 =

7,

t5 =π

9, t6 =

9, t7 =

9

and the solutions of the original equation are

x1, x2 = cos2π

7, x3 = cos

7, x4 = cos

7,

x5 = cosπ

9, x6 = cos

9, x7 = cos

9.

Since the degree of the original equation is 7 and we have 7 solutions, our problem

is solved.

Solution with CAS: See Figures 2.18 and 2.19!

Page 110: Problem solving with Computer Algebraic Systems

109

Figure 2.18: The graph of 8x(2x2 − 1)(8x4 − 8x2 + 1) − 1 with x ∈ [−0.4, 0]

Page 111: Problem solving with Computer Algebraic Systems

110

Figure 2.19: The graph of 8x(2x2 − 1)(8x4 − 8x2 + 1) − 1 with x ∈ [−1, 1]

Page 112: Problem solving with Computer Algebraic Systems

111

Problem (KoMaL B.4367.) Solve the following equation

3x + 3√x

= 4 +x + 1√

x2 − x + 1.

Solution: First we remark that the domain of this equation is the set of positive

real numbers. It is clear that

x + 1 ≥ 2√

x.

This inequality gives3x + 3√

x≥ 6,

and the equality condition is true if and only if x = 1. We similarly obtain

3(x2 + 1) ≥ 6x,

that is

4(x2 − x + 1) ≥ (x + 1)2,

which shows that

4 +x + 1√

x2 − x + 1≤ 6.

The equality holds if and only if x = 1, so the solution of the problem is x = 1.

Solution with CAS: See Figure 2.20!

Problem (KoMaL B.3320.) Solve the equation

xx1/2

= 1/2.

Solution: We will introduce a new variable, let y = x2. Rewriting our equation we

have

y2y =1

2

One can prove that the function f(y) = y2y is strictly decreasing on the interval

0 < y ≤ 1e

and strictly increasing if y ≥ 1e. This fact gives that we have at most

Page 113: Problem solving with Computer Algebraic Systems

112

Figure 2.20: The graph of 3x+3√x

− 4 − x+1√x2−x+1

Page 114: Problem solving with Computer Algebraic Systems

113

Figure 2.21: The graph of xx1/2

two solutions and after substitution we obtain exactly two solutions for y, 12

and14

and 14

es 116

for x.

Solution with CAS: See Figure 2.21!

Problem (KoMaL C.688.) Solve the equation

[x/2] + [x/4] = x.

([x] denotes the integral part of x)

Solution: There is an integer number on the left hand side, so x is an integer

number. The remainder of x dividing by 4 is 0, 1, 2 or 3. In the first case x = 4k,

where k is an integer. Then 2k + k = 4k, which yields k = 0. If x = 4k + 1

then 2k + k = 4k + 1, and k = −1. In the third case x = 4k + 2, now we have

Page 115: Problem solving with Computer Algebraic Systems

114

Figure 2.22: The graph of [x/2] + [x/4] − x

3k = 4k + 2, k = −2, and finally, x = 4k + 3 gives k = −3. The solutions of the

original problem are x = 0,−3,−6 and −9.

Solution with CAS: See Figure 2.22!

Problem (KoMaL B.3572.) Solve the equation

[x/2] + [x/4] = [x],

where [x] denotes the integral part of x.

Solution: Let [x] = n. Now we have

[x

2

]

=[n

2

]

,

Page 116: Problem solving with Computer Algebraic Systems

115

and[x

4

]

=[n

4

]

.

We distinguish four cases. If n = 4k then

4k = 2k + k,

and k = 0, n = 0. In the second case n = 4k + 1, then we get

4k + 1 = 2k + k,

and k = −1, n = −3. In the next case n = 4k + 2, we have

4k + 2 = (2k + 1) + k,

and k = −1, n = −2. Finally, if n = 4k + 3, then

4k + 3 = (2k + 1) + k,

and so k = −2, n = −5.

The solutions are real numbers with integral part 0,−2,−3 or −5.

Solution with CAS: See Figure 2.23!

Problem (KoMaL B.3577.) Solve the equation

sin 3x + 3 cos x = 2 sin 2x(sin x + cos x).

Solution: We will introduce new variables. Let

a = cos x, b = sin x.

Using this notation we obtain

sin 2x = 2 sin x cos x = 2ab,

Page 117: Problem solving with Computer Algebraic Systems

116

Figure 2.23: The graph [x/2] + [x/4] − [x]

Page 118: Problem solving with Computer Algebraic Systems

117

cos 2x = a2 − b2 = 1 − 2b2 = 2a2 − 1,

sin 3x = sin 2x cos x + cos 2x sin x = 3a2b − b3.

Applying the previous formulas our equation leads to

3a2b − b3 + 3a = 4a2b + 4ab2.

This yields

3a = a2b + 4ab2 + b3 = b(a2 + b2) + 4ab2.

Since a2 + b2 = 1, we have the equations

3a = b + 4ab2 = b + 4a(1 − a2),

and

b = a(4a2 − 1).

Taking the square we get

b2 = 1 − a2 = a2(16a4 − 8a2 + 1).

Now this is a cubic equation (in a2), and introducing the new variable A = a2 we

obtain

16A3 − 8A2 + 2A − 1 = (2A − 1)(8A2 + 1) = 0.

This yields A = 12, a = cos x = ± 1√

2and x = π

4+kπ, where k is an integer number.

Solution with CAS: Solution with CAS: See Figure 2.24!

Problem (KoMaL B.3579.) Solve the following equation

x =

−3 + 4

−3 + 4√−3 + 4x.

Page 119: Problem solving with Computer Algebraic Systems

118

Figure 2.24: The graph of sin 3x + 3 cos x − 2 sin 2x(sin x + cos x)

Page 120: Problem solving with Computer Algebraic Systems

119

Solution: Taking square (several times) we have

x8 + 12x6 + 150x4 + 684x2 − 16384x + 15537 = 0.

We can factorize the polynomial as

x8 + 12x6 + 150x4 + 684x2 − 16384x + 15537 =

(x − 1)(x − 3)(x6 + 4x5 + 25x4 + 88x3 + 427x2 + 1444x + 5179),

thus the solutions of the problem are x1 = 1 and x2 = 3. Further, x ≥ 34, so the

factor

x6 + 4x5 + 25x4 + 88x3 + 427x2 + 1444x + 5179

is positive for every x.

Solution with CAS: See Figure 2.25!

Problem (KoMaL A.291.) Solve the equation

x =

2 +

2 −√

2 + x.

Solution: It is easy to see that we have to find the solution(s) x in the interval

[−2, 2]. Then there exists an angle y for which 0 ≤ y ≤ π and x = 2 cos y. We

obtain r√

2 + x =√

2 + 2 cos y =

2 + 4cos2y

2− 2 = 2 cos

y

2,

2 −√

2 + x =

2 − 2 cosy

2= 2 sin

y

4= 2 cos

2− y

4

)

,

and √

2 +

2 −√

2 + x = 2 cos(π

4− y

8

)

,

Page 121: Problem solving with Computer Algebraic Systems

120

Figure 2.25: The graph of x −√

−3 + 4√

−3 + 4√−3 + 4x

Page 122: Problem solving with Computer Algebraic Systems

121

Figure 2.26: The graph x −√

2 +√

2 −√

2 + x

that is we have the trigonometric equation

cos y = cos(π

4− y

8

)

.

Its solution is y = 2π9

and we get x = 2 cos 2π9

.

Solution with CAS: See Figure 2.26!

Problem (KoMaL B.3536.) Determine the minimum value of the function

x2

8+ x cos x + cos 2x.

Page 123: Problem solving with Computer Algebraic Systems

122

Solution: We will apply the identity

cos 2x = 2 cos2 x − 1.

Then we have

x2

8+ x cos x + cos 2x =

x2

8+ x cos x + 2 cos2 x − 1 =

1

8(x + 4 cos x)2 − 1 ≥ −1,

and the equality holds if and only if

f(x) = x + 4 cos x = 0.

The value of f at x = 0 is 4, at x = π is π−4, so there is a point x0 in the interval

[0, π] such that f(x0) = 0. Then the minimum value of our function is −1.

Solution with CAS: See Figures 2.27 and 2.28!

Problem (KoMaL B.3524.) The sum of the real numbers x and y is 1. Determine

the maximum value of

xy4 + x4y.

Solution: As a preparatory step we factorize our function

xy4 + x4y = xy((x + y)3 − 3xy(x + y)) = xy(1 − 3xy).

This is a quadratic function in xy, its maximum point is at xy = 16, and the value

is 112

. Now we have that the maximum value of the original function is at most 112

and the possible maximum points are the solution of the system of equations

x + y = 1, xy =1

6.

An easy calculation gives the maximum points

x1,2 =1

2± 1

2√

3.

Page 124: Problem solving with Computer Algebraic Systems

123

Figure 2.27: The graph of x2

8+ x cos x + cos 2x with −10 < x < 10

Page 125: Problem solving with Computer Algebraic Systems

124

Figure 2.28: The graph of x2

8+ x cos x + cos 2x with −2 < x < 5

Page 126: Problem solving with Computer Algebraic Systems

125

Figure 2.29: The graph of x(1 − x)4 + x4(1 − x)

Solution with CAS: See Figure 2.29!

Problem (KoMaL B.4275.) Solve the following equation

x6 − x3 − 2x2 − 1 = 2(x − x3 + 1)√

x.

Solution: It is clear that the domain of the equation is the set of nonnegative real

numbers. Let y =√

x. Using this new variable our equation leads to

y12 + 2y7 − y6 − 2y4 − 2y3 − 2y − 1 = 0.

Observe that

y12 − y6 − 2y3 − 1 = y12 − (y3 + 1)2 = (y6 − y3 − 1)(y6 + y3 + 1),

Page 127: Problem solving with Computer Algebraic Systems

126

and since

2y7 − 2y4 − 2y = 2y(y6 − y3 − 1),

we can factorize

y12 + 2y7 − y6 − 2y4 − 2y3 − 2y − 1 = (y6 − y3 − 1)(y6 + y3 + 2y + 1) = 0.

Since the summands in the second factor are positive or non-negative it is enough

to deal with the zeros of the first factor. Let z = y3, then we have

z2 − z − 1 = 0

and (z is non-negative!), z = 1+√

52

, which yields

y =

(

1 +√

5

2

) 1

3

,

and

x =

(

1 +√

5

2

) 2

3

.

Solution with CAS:factor (y12 + 2y7 − y6 − 2y4 − 2y3 − 2y − 1);

(y6 − y3 − 1)(y6 + y3 + 2y + 1)

See Figure 2.30!

Problem (KoMaL B.4263.) Solve the following system of equations

x3 + 4y = y3 + 16x,

1 + x2

1 + y2= 5.

Page 128: Problem solving with Computer Algebraic Systems

127

Figure 2.30: The graph of x6 − x3 − 2x2 − 1 − 2(x − x3 + 1)√

x

Page 129: Problem solving with Computer Algebraic Systems

128

Solution: From the first equation we have

x(x2 − 16) = y(y2 − 4),

and the second equation gives

y2 − 4 = 5x2.

Now we obtain

x(x2 − 16) = 5x2y.

If x = 0, then y = ±2, otherwise we get

y =x2 − 16

5x,

which yields the equation

5x2 + 4 =

(x2 − 16

5x

)2

.

Introducing the new variable z = x2 we have

124z2 + 132z − 256 = 0.

We have two solutions of this quadratic equation, however, the first one is negative

and the other one is z = 1. This gives x = ±1 and y = ±3. After checking we get

the solutions

(0, 2), (0,−2), (1,−3), (−1, 3).

Solution with CAS: See Figures 2.31 and 2.32!

Problem (KoMaL C.689.) Solve the equation

xlog2(16x2) − 4xlog2(4x)+1 − 16log2(4x)+2 + 64x3 = 0.

Page 130: Problem solving with Computer Algebraic Systems

129

Figure 2.31: The graph of 5x2 + 4 −(

x2−165x

)2

with 0.5 ≤ x ≤ 3

Page 131: Problem solving with Computer Algebraic Systems

130

Figure 2.32: The graph of 5 ∗ x2 + 4 −(

x2−165x

)2

with −3 ≤ x ≤ −0.5

Page 132: Problem solving with Computer Algebraic Systems

131

Solution: Our first observation is that x > 0. Divide by 64x3 and introduce the

new variable y = log2 x. Then we have x = 2y, and using this notation the original

equation leads to

22y2−y−6 − 2y2−4 − 2y2−y−2 + 1 = 0.

Now the factorization of the left hand side is

22y2−y−6 − 2y2−4 − 2y2−y−2 + 1 = (2y2−4 − 1)(2y2−y−2 − 1) = 0.

and we get

y1 = 1, y2 = −2, y3 = 2,

and

x1 = 2, x2 = 4, x3 =1

4.

Solution with CAS: See Figures 2.33 and 2.34!

Problem (KoMaL B.4535.) Solve the equation

(x2 − x − 1)2 − x3 = 5.

Solution: The proof is based on the simple observation 5 = 22 + 13. Reordering

the original equation we get

(x2 − x − 1)2 − 22 = x3 + 1.

After factorization we obtain

(x2 − x − 3)(x2 − x + 1) = (x + 1)(x2 − x + 1),

and

(x2 − x + 1)(x2 − 2x − 4) = 0.

It is easy to see that the first factor (x2 − x + 1 = (x − 12)2 + 3

4of the product

is positive for every real x, and the zeros of the second factor are 1 ±√

5. These

Page 133: Problem solving with Computer Algebraic Systems

132

Figure 2.33: The graph of xlog2(16x2) − 4xlog2(4x)+1 − 16log2(4x)+2 + 64x3 with 0.2 ≤x ≤ 0.3

Page 134: Problem solving with Computer Algebraic Systems

133

Figure 2.34: The graph of xlog2(16x2) − 4xlog2(4x)+1 − 16log2(4x)+2 + 64x3 with 0.3 ≤x ≤ 4.02

Page 135: Problem solving with Computer Algebraic Systems

134

Figure 2.35: The graph of (x2 − x − 1)2 − x3 − 5

solutions yield the solutions of the original equation.

Solution with CAS: factor((x2 − x + 1)2 − x3 − 5);

(x2 − x + 1)(x2 − 2x − 4)

See Figure 2.35!

Problem (KoMaL B.4467.) Solve the equation

√x = x2 − 3x + 1 + |x − 1|.

Solution: The domain of our equation is the set of non-negative real numbers. We

Page 136: Problem solving with Computer Algebraic Systems

135

distinguish two cases according to the sign of x − 1. If x > 1, then we have :

√x = x2 − 2x,

which gives

x4 − 4x3 + 4x2 − x = 0.

One can factorize the quartic polynomial

x4 − 4x3 + 4x2 − x = x(x − 1)(x2 − 3x + 1),

however, x > 1, so the possible solutions are the zeros of the third factor x2−3x+1,

that is

x1,2 =3 ±

√5

2.

After checking we a have 3+√

52

as a solution with x > 1.

Suppose that x ≤ 1. Then we have

√x = x2 − 4x + 2

and we get a quartic equation

x4 − 8x3 + 20x2 − 17x + 4 = 0.

It is easy to see that 1 and 4 are zeros of the polynomial, so

x4 − 8x3 + 20x2 − 17x + 4 = (x − 1)(x − 4)(x2 − 3x + 1) = 0.

After short calculation we obtain one solution x = 3−√

52

with x ≤ 1 (x = 1 is not

a solution).

Solution with CAS: See Figure 2.36! solve(x2 − 3x + 1 + |x − 1| − √x = 0);

3

2+

1

2

√5,

1

4(−1 +

√5)2.

Page 137: Problem solving with Computer Algebraic Systems

136

Figure 2.36: The graph of x2 − 3x + 1 + |x − 1| − √x

Problem (KoMaL Gy.3145.) Prove the inequality

1

x+

1

x3+

1

x5+

1

x7+

1

x9+

1

x11+

1

x13≤ 7

x7.

Solution: Let y = 1x. Now we have

y13 + y11 + y9 − 6y7 + y5 + y3 + y ≤ 0.

One can see that y = 0 and y = 1 are zeros of the polynomial on the left hand

side. So the factorization is

y13 + y11 + y9 − 6y7 + y5 + y3 + y =

Page 138: Problem solving with Computer Algebraic Systems

137

= y(y − 1)(y11 + y10 + 2y9 + 2y8 + 3y7 + 3y6 − 3y5 − 3y4 − 2y3 − 2y2 − y − 1),

In the next step we have the factorization of the polynomial of degree 11

y11+y10+2y9+2y8+3y7+3y6−3y5−3y4−2y3−2y2−y−1 = (y−1)(y+1)2(y8+3y6+6y4+3y2+1).

Thus we get

y13 + y11 + y9 − 6y7 + y5 + y3 + y = y(y− 1)2(y + 1)2(y8 + 3y6 + 6y4 + 3y2 + 1) ≤ 0.

Since

y8 + 3y6 + 6y4 + 3y2 + 1

is positive for every y we have the set of solutions is y = 1, y = −1 or y < 0, i. e.

x = 1, x = −1 or x < 0.

Solution with CAS: factor(y13 + y11 + y9 − 6y7 + y5 + y3 + y);

y(y8 + 3y6 + 6y4 + 3y2 + 1)(y − 1)2(y + 1)2

Remark: See Figure 2.37!

Problem (KoMaL B.3948.) What is the maximum value of 3a5b− 40a3b3 +48ab5

if a2 + 4b2 = 4?

Solution: Let c = a/2. The our condition is

c2 + b2 = 1,

and

3a5b − 40a3b3 + 48ab5 =

96c5b − 320c3b3 + 96cb5 = 32cb(3c4 − 10c2b2 + 3b4) =

= 32cb(3(c2 + b2)2 − 16c2b2) = 32cb(3 − 16c2b2).

Introducing the variable x = 4bc we have to consider the maximum value of the

Page 139: Problem solving with Computer Algebraic Systems

138

Figure 2.37: The graph of y13 + y11 + y9 − 6y7 + y5 + y3 + y

Page 140: Problem solving with Computer Algebraic Systems

139

Figure 2.38: The graph of 8x(3 − x2)

function

8x(3 − x2),

where |x| ≤ 2, noting that

±bc ≤ b2 + c2.

Let

f(x) = 24x − 8x3.

Now the polynomial may have the maximum point at x = ±2 or at solutions of the

equation f ′(x) = 0, that is at points x = ±1. The second derivation of f is −48x,

so the function has (local) maximum point at x = 1 and has (local) minimum

point at x = −1.

Solution with CAS: See Figure 2.38!

Page 141: Problem solving with Computer Algebraic Systems

140

Problem (KoMaL C.542.) Prove the following inequality

(n − 2)(2 + 22 + . . . + 2n) < n · 2n

in the set of positive integers.

Solution: Using the formula for the sum of geometric progression we obtain

2 + 22 + . . . + 2n = 2n+1 − 2,

so we have to solve the inequality

(n − 2)(2n+1 − 2) < n · 2n.

Expanding the left hand side it follows

n · 2n+1 − 2n+2 − 2n + 4 < n · 2n,

and

n · 2n + 4 < 2n+2 + 2n

We will apply the well-known inequality 2n ≤ 2n, n = 1, 2, 3, . . . and we have

n · 2n + 4 < 2n+2 + 2n = 5 · 2n,

and the values n = 1, 2, 3, 4 as possible solutions.

Solution with CAS: See Figure 2.39!

Problem (KoMaL C.873.) What is the maximum point of the function

√2 sin x − sin x.

Solution: We introduce a new variable. Let

y =√

2 sin x

Page 142: Problem solving with Computer Algebraic Systems

141

Figure 2.39: The graph of 2x+2 + 2x − x · 2x − 4

Page 143: Problem solving with Computer Algebraic Systems

142

and rewriting the original function we have

y − 1

2y2.

The maximum point of this quadratic function is y = 1, so

sin x =1

2.

Thus we obtain that the maximum points of our function are

π

6+ 2kπ,

6+ 2lπ

and this maximum value is 12.

Solution with CAS: See Figure 2.40!

Page 144: Problem solving with Computer Algebraic Systems

143

Figure 2.40: The graph of√

2 sin x − sin x

Page 145: Problem solving with Computer Algebraic Systems

144

Page 146: Problem solving with Computer Algebraic Systems

Chapter 3

Other problems

Problem (AIME, 1988/13) Find a if a and b are integers such that x2 − x − 1 is

a factor of ax17 + bx16 + 1.

Solution: Let

F (x) = ax17 + bx16 + 1

and let P (x) be the polynomial such that

P (x)(x2 − x − 1) = F (x).

First, the constant term of P (x) must be −1. Now, we have

(x2 − x − 1)(c1x15 + c2x

14 + · · · + c15x − 1),

where c15 is some coefficient. However, since F (x) has no x term, it must be true

that c15 = 1. We have to find c14 now. Notice that all we care about in finding c14

is that

(x2 − x − 1)(· · · + c14x2 + x − 1) = something + 0x2 + something.

On the other hand, the coefficient of x2 is (−c14 − 1 − 1. Therefore, c14 = −2.

145

Page 147: Problem solving with Computer Algebraic Systems

146

Following a similar process,

c13 = 3, c12 = −5, c11 = 8,

so the coefficients of P (x) are just the Fibonacci sequence with alternating signs.

Therefore,

a = c1 = F16,

where

F16

denotes the 16th Fibonacci number and a = 987.

Solution with CAS: A := solve(x2 − x − 1 = 0, x);

A :=1

2+

1

2

√5,

1

2− 1

2

√5

solve(aA[1]17 + bA[1]16 + 1 = 0, aA[2]17 + bA[2]16 + 1 = 0, [a, b]);

[[a = 987, b = −1597]]

Problem (AIME, 1989) Compute

√31 · ·30 · 29 · 28 + 1.

Solution: Let us denote our four consecutive integers n− 1, n, n + 1, n + 2. Notice

that

(n − 1)n(n + 1)(n + 2) + 1 = (n2 + n)2 − 2(n2 + n) + 1 = (n2 + n − 1)2.

Thus, we have √31 · ·30 · 29 · 28 + 1 = 869.

Page 148: Problem solving with Computer Algebraic Systems

147

Solution with CAS: sqrt(n(n + 1)(n + 2)(n + 3) + 1);

(1 + 3n + n2)2

Problem (AIME, 1990/2) Find the value of

(52 + 6√

43)3/2 − (52 − 6√

43)3/2.

Solution: Suppose that 52 + 6√

43 is in the form of (a + b√

43)2. Expanding it we

have

52 + 6√

43 = a2 + 43b2 + 2ab√

43.

This implies that a and b equal one of ±1,±3. The possible pairs are (3, 1) and

(−3,−1), the latter case can be discarded since the square root must be positive.

This means that

52 + 6√

43 = (√

43 + 3)2.

Repeating this for 52−6√

43, the only feasible possibility is (√

43−3)2. Rewriting

the original problem, we get

(√

43 + 3)3 − (√

43 − 3)3.

Using the difference of cubes, we obtain that

[√

43+3 −√

43+3] [(43+6√

43+9)+(43−9)+(43−6√

43+9)] = (6)(3·43+9) = 828.

Solution with CAS: simplify((52 + 6√

43)3/2 − (52 − 6√

43)3/2);

828

Problem (AIME, 1993/5) Let

P0(x) = x3 + 313x2 − 77x − 8.

Page 149: Problem solving with Computer Algebraic Systems

148

For integers n ≥ 1, define

Pn(x) = Pn−1(x − n).

What is the coefficient of x in P20(x)?

Solution: First notice that

P20(x) = P19(x − 20) = P18((x − 20) − 19) = P17(((x − 20) − 19) − 18) . . . .

Applying the formula for the sum of the first n numbers,

1 + 2 + · · · + 20 =20(20 + 1)

2= 210.

Therefore, we get

P20(x) = P0(x − 210).

On substituting x − 210 into the function definition, we get

P0(x − 210) = (x − 210)3 + 313(x − 210)2 − 77(x − 210) − 8.

We only need the coefficients of the linear terms, which we can find by the binomial

theorem. (x − 210)3 will have a linear term of

(3

1

)

2102x = 630 · 210x.

313(x − 210)2 will have a linear term of

−313 ·(

2

1

)

210x = −626 · 210x,

and finally, −77(x− 210) will have a linear term of −77x. Adding up the coeffici-

ents, we obtain

630 · 210 − 626 · 210 − 77 = 763.

Page 150: Problem solving with Computer Algebraic Systems

149

Solution with CAS: expand(subs(x = x − 210, x3 + 313x2 − 77x − 8));

x3 − 317x2 + 763x + 4558462

Problem (AIME, 2000 I/3) In the expansion of (ax + b)2000, where a and b are

relatively prime positive integers, the coefficients of x2 and x3 are equal. Find

a + b.

Solution: Applying the binomial theorem, we obtain

(2000

2b1998a

)

=

(2000

3

)

b1997a2

which gives b = 666a. Since a and b are positive relatively prime integers, a =

1, b = 666, and a + b = 667.

Solution with CAS: coeff((a ∗ x + b)2000, x2);coeff((a ∗ x + b)2000, x3);

factor(1331334000b1997a3 − 1999000b1998a2)

Problem (AIME, 2000 II/1) The number

2

log4 20006+

3

log5 20006

can be written as mn

where m and n are relatively prime positive integers. Find

m + n.

Solution: It is easy to see that

2

log4 20006+

3

log5 20006=

log4 16

log4 20006+

log5 125

log5 20006

andlog4 16

log4 20006=

lg 16

lg 20006,

log5 125

log5 20006=

125

lg 20006.

Page 151: Problem solving with Computer Algebraic Systems

150

Thus we getlg 16

lg 20006+

125

lg 20006=

lg 2000

lg 20006=

1

6,

and m + n = 7.

Solution with CAS: simplify(2/log[4](20006) + 3/log[5](20006));

1

6

Problem (AIME, 2000 II/7) Given that

1

2!17!+

1

3!16!+

1

4!15!+

1

5!14!+

1

6!13!+

1

7!12!+

1

8!11!+

1

9!10!=

N

1!18!.

Find the greatest integer that is less than N100

.

Solution: The terms of the sum are strongly related to the binomial coefficients.

So, on multiplying by 19! we have

19!

2!17!+

19!

3!16!+

19!

4!15!+

19!

5!14!+

19!

6!13!+

19!

7!12!+

19!

8!11!+

19!

9!10!=

19!N

1!18!,

and

(19

2

)

+

(19

3

)

+

(19

4

)

+

(19

5

)

+

(19

6

)

+

(19

7

)

+

(19

8

)

+

(19

9

)

= 19N.

Recall the identity19∑

n=0

(19

n

)

= 219

and the property of the binomial coefficients

(19

n

)

=

(19

19 − n

)

,

Page 152: Problem solving with Computer Algebraic Systems

151

it follows that9∑

n=0

(19

n

)

=219

2= 218.

Thus,

19N = 218 −(

19

1

)

−(

19

0

)

= 218 − 19 − 1 = (29)2 − 20 = (512)2 − 20 = 262124.

So, N = 26212419

= 13796 and⌊

N100

⌋= 137.

Solution with CAS: (1/19)*(sum(binomial(19, i), i = 10..17));

13796

Problem (AIME, 2004, I/7) Let C be the coefficient of x2 in the expansion of the

product

(1 − x)(1 + 2x)(1 − 3x) · · · (1 + 14x)(1 − 15x).

Find |C|.

Solution: Set

P (x) = (1 − x)(1 + 2x)(1 − 3x) · · · (1 + 14x)(1 − 15x).

It is clear that the coefficient of x in P (x) is

−1 + 2 − 3 + . . . + 14 − 15 = −8,

so

P (x) = 1 − 8x + Cx2 + Q(x),

where Q(x) is some polynomial divisible by x3. Then

P (−x) = 1 + 8x + Cx2 + Q(−x)

Page 153: Problem solving with Computer Algebraic Systems

152

and so

P (x) · P (−x) = 1 + (2C − 64)x2 + R(x),

where R(x) is some polynomial divisible by x3. However, we also know

P (x) · P (−x) = (1 − x)(1 + x)(1 + 2x)(1 − 2x) · · · (1 − 15x)(1 + 15x) =

= (1 − x2)(1 − 4x2) · · · (1 − 225x2) = 1 − (1 + 4 + . . . + 225)x2 + R(x).

On equating coefficients, we have

2C − 64 = −(1 + 4 + . . . + 225) = −1240,

so −2C = 1176 and |C| = 588.

Solution with CAS: coeff(mul(1 + (−1)i · i · x, i = 1..15), x2);

−588

Problem (AIME, 2005, I/6) Let P be the product of the non real roots of

x4 − 4x3 + 6x2 − 4x = 2005.

Find ⌊P ⌋.

Solution: It is easy to see that

x4 − 4x3 + 6x2 − 4x + 1 = (x − 1)4,

that is our equation lead to

(x + 1)4 − 2006 = 0.

Page 154: Problem solving with Computer Algebraic Systems

153

One can factorize the polynomial on the left-hand side, which is

((x − 1)2 +√

2006)((x − 1)2 −√

2006) = 0.

If you think of each part of the product as a quadratic, then

((x − 1)2 +√

2006)

is bound to hold the two non-real roots since the other definitely crosses the x-axis

twice since it is just x2 translated down and right. Therefore the products of the

roots of

((x − 1)2 +√

2006)

is

P = 1 +√

2006

so

⌊P ⌋ = 1 + 44 = 45.

Solution with CAS: a:=solve(x4 − 4x3 + 6x2 − 4x − 2005, x);

a := 20061/4 + 1, I · 20061/4 + 1,−20061/4 + 1,−I · 20061/4 + 1

expand(a[2]a[4]) √2006 + 1

Problem (AIME, 2007, I/3) The complex number z is equal to 9 + bi, where b is

a positive real number and i2 = −1. Given that the imaginary parts of z2 and z3

are the same, what is b equal to?

Solution: Squaring, we find that

(9 + bi)2 = 81 + 18bi − b2.

Page 155: Problem solving with Computer Algebraic Systems

154

Cubing and ignoring the real parts of the result, we find that

(81 + 18bi − b2)(9 + bi) = . . . + (9 · 18 + 81)bi − b3i.

Setting these two equation, we get that

18bi = 243bi − b3i,

so

b(b2 − 225) = 0

and the possible values for b are −15, 0, 15. Since b > 0, the solution is 15.

Solution with CAS: expand((9 + I · b)3 − (9 + I · b)2); factor(225b − b3)

−b(b − 15)(b + 15)

Problem (AIME, 2007, I/7) Let

N =1000∑

k=1

k(⌈log√2 k⌉ − ⌊log√

2 k⌋).

Find the remainder when N is divided by 1000. (⌊k⌋ is the greatest integer less

than or equal to k, and ⌈k⌉ is the least integer greater than or equal to k.)

Solution: It is easy to see that ceiling of a number minus the floor of a number is

either equal to zero (if the number is an integer),otherwise, it is equal to 1. Thus,

we need to find when or not

log√2 k

is an integer. The change of base formula shows that

log k

log√

2=

2 log k

log 2.

For the log 2 term to cancel out, k is a power of 2. Thus, N is equal to the sum of

Page 156: Problem solving with Computer Algebraic Systems

155

all the numbers from 1 to 1000, excluding all powers of 2 from 20 = 1 to 29 = 512.

The formula for the sum of an arithmetic sequence and the sum of a geometric

sequence yields that our answer is

(1000 + 1)1000

2− (1 + 2 + 22 + . . . + 29) (mod 1000).

Simplifying, we get

10001000 + 1

2− 1023 (mod 1000) ≡ 500 − 23 (mod 1000) ≡ 477 (mod 1000),

so the answer is 477.

Solution with CAS:

Problem (AIME, 2007, I/8) The polynomial P (x) is cubic. What is the largest

value of k for which the polynomials

Q1(x) = x2 + (k − 29)x − k

and

Q2(x) = 2x2 + (2k − 43)x + k

are both factors of P (x)?

Solution: One can see that Q1 and Q2 must have a common zero to both be factors

of the same cubic polynomial. Let this root be a. We then know that a is a root

of

Q2(x) − 2Q1(x) = 2x2 + 2kx − 43x + k − 2x2 − 2kx + 58x + 2k = 15x + 3k = 0,

so x = −k5

. We then know that −k5

is a root of Q1 so we get that

k2

25+ (k − 29)

(−k

5

)

− k = 0 =

= k2 − 5(k − 29)(k) − 25k = k2 − 5k2 + 145k − 25k

Page 157: Problem solving with Computer Algebraic Systems

156

which implies

k2 = 30k,

so k = 30 is the highest. We can trivially check into the original equations to find

that k = 30 produces a zero in common, so the answer is 30.

Solution with CAS: resultant(x2 + (k − 29)x − k, 2x2 + (2k − 43)x + k, x);

1080k − 36k2

factor(1080k − 36k2);

−36k(−30 + k)

Problem (AIME, 2008 II/1) Let

N = 1002 + 992 − 982 − 972 + 962 + · · · + 42 + 32 − 22 − 12,

where the additions and subtractions alternate in pairs. Find the remainder when

N is divided by 1000.

Solution: Since we have to find the remainder when N is divided by 1000, we may

ignore the 1002 term. Then, applying the difference of squares factorization to

consecutive terms,

(99−98)(99+98)−(97−96)(97+96)+(95−94)(95+94)+ · · ·+(3−2)(3+2)−1 =

197 − 193︸ ︷︷ ︸

4

+ 189 − 185︸ ︷︷ ︸

4

+ · · · + 5 − 1︸ ︷︷ ︸

4

=

= 4 ·(

197 − 5

8+ 1

)

= 100.

Solution with CAS: sum((4k)2 + (4k − 1)2 − (4k − 2)2 − (4k − 3)2, k = 1..25);

10100

Page 158: Problem solving with Computer Algebraic Systems

157

Problem (AIME, 2010 I/6) Let P (x) be a quadratic polynomial with real coeffi-

cients satisfying

x2 − 2x + 2 ≤ P (x) ≤ 2x2 − 4x + 3

for all real numbers x, and suppose P (11) = 181. Find P (16).

Solution: Let

Q(x) = x2 − 2x + 2,

and

R(x) = 2x2 − 4x + 3.

Completing the square, we have

Q(x) = (x − 1)2 + 1,

and

R(x) = 2(x − 1)2 + 1,

so it follows that

P (x) ≥ Q(x) ≥ 1

for all x. Also,

1 = Q(1) ≤ P (1) ≤ R(1) = 1,

so P (1) = 1, and P obtains its minimum at the point (1, 1). Then P (x) must be

of the form c(x−1)2 +1 for some constant c, after substituting P (11) = 181 yields

c = 95. Finally, a straightforward calculation gives

P (16) =9

5· (16 − 1)2 + 1 = 406.

Solution with CAS: See Figure 3.1!

Problem (KoMaL B3426.) What is the remainder of the polynomial x2001 dividing

by (x + 1)2?

Solution: We know that the remainder is constant or a linear polynomial a · x + b,

Page 159: Problem solving with Computer Algebraic Systems

158

Figure 3.1: The graphs of x2 − 2x + 2 and 2x2 − 4x + 3

say. Then we can rewrite

x2001 = f(x)(x + 1)2 + a · x + b.

Substituting x = −1-et, we have b− a = −1. After derivation of both sides we get

2001x2000 = f ′(x)(x + 1)2 + 2(x + 1)f(x) + a,

And substituting x = −1 again we have 2001 = a, and thus the remainder is

2001x + 2000.

Solution with CAS: taylor (x2001, x = −1, 2002) = −1+2001(x+1)−2001000(x+

1)2+1333333000(x+1)3−. . .−1333333000(x+1)1998+2001000(x+1)1999−2001(x+

1)2000 + (x + 1)2001.

Problem (KoMaL B.3446.) Determine the polynomial q(x) such that

p2(x) − 2p(x)q(x) + q2(x) − 4p(x) + 3q(x) + 3 ≡ 0,

where p(x) = x2 + x + 1.

Page 160: Problem solving with Computer Algebraic Systems

159

Solution: We rewrite the original equation as

(p(x) − q(x))2 ≡ 4p(x) − 3q(x) − 3.

If the degree of q(x) is greater than or equal to 3, the the degree of the polynomial

on the left hand side is 2 deg q, and the degree of the polynomial on the right hand

side is deg q, which is impossible. Now if the degree of q(x) is smaller than 2, the

the right hand side is a quartic and the left hand side is a quadratic polynomial,

we arrive a contradiction again. Thus we have deg q(x) = 2, and let

q(x) = ax2 + (b + 1)x + c + 1.

If the leading coefficient a in not equal to 1, then we have a quartic polynomial

for the right hand side, and a quadratic for the left hand side. so a = 1. In the

sequel we have to find the polynomial q(x) in the form

q(x) = x2 + (b + 1)x + c + 1.

Then

(p(x) − q(x))2 = (bx + c)2,

and

4p(x)−3q(x)−3 = 4x2+4x+4−3x2−3(b+1)x−3(c+1)−3 = x2+(1−3b)x−2−3c,

further, on comparing the corresponding coefficients, we get

(b, c) = (1,−1), (−1,−2),

and

q1(x) = x2 + 2x, q2(x) = x2 − 1.

Solution with CAS: We are owing the argument above to prove that q(x) is a

Page 161: Problem solving with Computer Algebraic Systems

160

quadratic polynomial, so q(x) = ax2+bx+c. p := x2+x+1; q := a∗x2+b∗x+c;

p := x2 + x + 1

q := a ∗ x2 + bx + c

collect(expand(p2 − 2pq + q2 − 4p + 3q + 3), x);

(a2−2a+1)x4+(2ab−2b+2−2a)x3+(−1+2ac−2b−2c+b2+a)x2+(−2c−2+b+2bc)x+c2+c

solve{c2 + c = 0, a2 − 2a + 1 = 0,−2c − 2 + b + 2bc = 0,}{2ab − 2b + 2 − 2a = 0,−1 + 2ac − 2b − 2c + b2 + a = 0}, [a, b, c];

[[a = 1, b = 0, c = −1], [a = 1, b = 2, c = 0]]

Page 162: Problem solving with Computer Algebraic Systems

Chapter 4

Exercises

Exercise 1 (IMOLL, 1969) Expand the expression(cos π

4+ i sin π

4

)10in two dif-

ferent ways, and using these expansions prove that

(10

1

)

−(

10

3

)

+1

2

(10

5

)

= 24.

Exercise 2 (IMOLL, 1966) How many real solutions are there to the equation

x = 1964 sin x − 189.

Exercise 3 (IMOLL, 1966) Consider the consecutive a1, a2, . . . , a99, a100 positive

integers. What are the last two digits of the sum

a81 + a8

2 + . . . + a8100.

Exercise 4 (IMOLL, 1971) It is known that there is a solution (x, y, z) of the

system of equations

x + y + z = 3,

x3 + y3 + z3 = 15,

161

Page 163: Problem solving with Computer Algebraic Systems

162

x4 + y4 + z4 = 35

with x2 + y2 + z2 < 10. Calculate the sum x5 + y5 + z5.

Exercise 5 (IMOLL, 1972) Determine the solutions of the equation

1 + x + x2 + x3 + x4 = y2

in the set of integer numbers.

Exercise 6 (IMOLL, 1972) The decimal number 13101 is given. It is instead

written as a ternary number. What are the two last digits of this ternary number?

Exercise 7 (IMOLL, 1973) Is the number

3

√√5 + 2 +

3

√√5 − 2

is rational or irrational?

Exercise 8 (IMOLL, 1974) Prove that 2147 − 1 is divisible by 343.

Exercise 9 (IMOLL, 1974) Let n be a positive integer, n ≥ 2, and consider the

polynomial equation

xn − xn−2 − x + 2 = 0.

For each n, determine all complex numbers x that satisfy the equation and have

modulus |x| = 1.

Exercise 10 (IMOLL, 1974) Determine an equation of third degree with integral

coefficients having roots

sinπ

14, sin

14, sin

−3π

14.

Exercise 11 (IMOLL, 1976) Prove that the number 191976 + 761976 is divisible by

the (Fermat) prime number F4 = 224

+ 1 and is divisible by at least four distinct

primes other than F4.

Page 164: Problem solving with Computer Algebraic Systems

163

Exercise 12 (IMOLL, 1976) Let a, b, c, d be nonnegative real numbers. Prove that

a4 + b4 + c4 + d4 + 2abcd ≥ a2b2 + a2c2 + a2d2 + b2c2 + b2d2 + c2d2.

Exercise 13 (IMOLL, 1976) Let

x =√

a +√

b,

where a and b are natural numbers, x is not an integer, and x < 1976. Prove that

the fractional part of x exceeds 10−19.76!

Exercise 14 (IMOLL, 1976) Solve the following system of equations:

3x1 − x2 − x3 − x5 = 0,

−x1 + 3x2 − x4 − x6 = 0,

−x1 + 3x3 − x4 − x7 = 0,

−x2 − x3 + 3x4 − x8 = 0,

−x1 + 3x5 − x6 − x7,

−x2 − x3 + 3x4 − x8 = 0,

−x1 + 3x5 − x6 − x7 = 0,

−x3 − x5 + 3x7 − x8 = 0,

−x4 − x6 − x7 + 3x8 = 0.

Exercise 15 (IMOLL, 1978) Simplify the following expression:

1

loga(abc)+

1

logb(abc)+

1

logc(abc),

where a, b, c are positive real numbers.

Page 165: Problem solving with Computer Algebraic Systems

164

Exercise 16 (IMOLL, 1978) Find all numbers α for which the equation

x2 − 2x[x] + x − α = 0

has two nonnegative roots. ([x] denotes the largest integer less than or equal to

x.)

Exercise 17 (IMOLL, 1978) A is a 2m-digit positive integer each of whose digits

is 1. B is an m-digit positive integer each of whose digits is 4. Prove that A+B+1

is a perfect square.

Exercise 18 (IMOLL, 1978) If

Cpn =

n!

p!(n − p)!

where p ≥ 1. Prove the identity

Cpn = Cp−1

n−1 + Cp−1n−2 + . . . + Cp−1

p + Cp−1p−1 ,

and then evaluate the sum

1 · 2 · 3 + 2 · 3 · 4 + . . . + 97 · 98 · 99.

Exercise 19 (BW, 2010) For which k do there exist k pairwise distinct primes

p1, p2, . . . pk such that

p21 + p2

2 + . . . + p2k = 2010?

Exercise 20 (IMOLL, 1979) Prove the following inequality:

20

60< sin 20◦ <

21

60

Page 166: Problem solving with Computer Algebraic Systems

165

Exercise 21 (IMOLL, 1979) Prove that

1

2·√

4 sin2 36◦ − 1 = cos 72◦

Exercise 22 (BW, 1979) Find all triples (a, b, c) of integers satisfying

a2 + b2 + c2 = 20122012.

Exercise 23 (BW, 2008) How many pairs (m,n) of positive integers with m < n

fulfill the equation3

2008=

1

m+

1

n?

Exercise 24 (BW, 2006) A 12-digit positive integer consisting only of digits 1, 5

and 9 is divisible by 37. Prove that the sum of its digits is not equal to 76.

Exercise 25 (INMO (Second Round), 1986) Let f be a function such that

f(x) =(x2 − 2x + 1) sin 1

x−1

sin πx.

Find the limit of f in the point x0 = 1.

Exercise 26 (IMOLL, 1979) If p and q are positive integers with

p

q= 1 − 1

2+

1

3− 1

4+ . . . − 1

1318+

1

1319

then prove that p is divisible by 1979.

Exercise 27 (IMOLL, 1979) Prove that

1

2

4 · sin2 36◦ − 1 = cos 72◦.

Page 167: Problem solving with Computer Algebraic Systems

166

Exercise 28 (IMOLL, 1980) Solve the equation

x3 + x2y” + xy2 + y3 = 8(x2 + xy + y2 + 1),

where x and y are unknown real numbers.

Exercise 29 (INMO (Second Round), 1986) Prove that

arctan1

2+ arctan

1

3=

π

4.

Exercise 30 (IMOLL, 1982) Solve the equation

x3 − y3 = 2xy + 8

in the set of integer numbers.

Exercise 31 (IMOLL, 1982) Determine all real values of the parameter a for which

the equation

16x4 − ax3 + (2a + 17)x2 − ax + 16 = 0

has exactly four distinct real roots that form a geometric progression.

Exercise 32 (IMOLL, 1982) Let p(x) be a cubic polynomial with integer coeffi-

cients with leading coefficient 1 and with one of its roots equal to the product of

the other two. Show that 2p(−1) is a multiple of

p(1) + p(−1) − 2(1 + p(0)).

Exercise 33 (IMOLL, 1983) If α is the real root of the equation E(x) = x3−5x−50 = 0 such that xn+1 = (5xn + 50)1/3 and x1 = 5, where n is a positive integer,

prove that

x3n+1 − α3 = 5(xn − α)

Page 168: Problem solving with Computer Algebraic Systems

167

and

α < xn+1 < xn.

Exercise 34 (IMOLL, 1983) Let (Fn)n≥1 be the Fibonacci sequence

F1 = F2 = 1, Fn+2 = Fn+1 + Fn(n ≥ 1),

and P (x) the polynomial of degree 990 satisfying

P (k) = Fk,

for k = 992, . . . , 1982. Prove that

P (1983) = F1983 − 1.

Exercise 35 (IMOLL, 1983) Which of the numbers 1, 2, . . . , 1983 has the largest

number of divisors?

Exercise 36 (IMOLL, 1984) Prove that the product of five consecutive positive

integers cannot be the square of an integer.

Exercise 37 (IMOLL, 1984) Let a, b, c be positive numbers with

a + b + c =

√3

2

Prove that the system of equations

√y − a +

√z − a = 1,

√z − b +

√x − b = 1,

√x − c +

√y − c = 1

Page 169: Problem solving with Computer Algebraic Systems

168

has exactly one solution (x, y, z) in real numbers.

Exercise 38 (IMOLL, 1984) Consider all the sums of the form

1985∑

k=1

εkk5

where ε ∈ {−1, 1}. What is the smallest nonnegative value attained by a sum of

this type?

Exercise 39 (IMOLL, 1985) Solve the following system of equations

√x − 1

y− 2w + 3z = 1,

x +1

y2− 4w2 − 9z2 = 3,

x√

x − 1

y3− 8w3 + 27z3 = −5,

x2 +1

y4− 16w4 − 81z4 = 15.

Exercise 40 (IMOLL, 1985) Solve the following equation in the set of positive

integers1

x+

1

y+

1

z=

4

5.

Exercise 41 (IMOLL, 1985) Are there integers m and n such that

5m2 − 6mn + 7n2 = 1985.

Exercise 42 (IMOLL, 1985) Let a, b, and c be real numbers such that

1

bc − a2+

1

ca − b2+

1

ab − c2= 0.

Page 170: Problem solving with Computer Algebraic Systems

169

Prove thata

(bc − a2)2+

b

(ca − b2)2+

c

(ab − c2)2= 0.

Exercise 43 (IMOLL, 1985) Factorize 51985 − 1 as a product of three integers,

each greater than 5100.

Exercise 44 (IMOLL, 1985) Let n ≥ 1 be a positive integer and

An =n∑

k=1

k6

2k.

Evaluate

limn→∞

An.

Exercise 45 (IMOLL, 1985) Let x, y, and z be real numbers satisfying

x + y + z = xyz.

Prove that

x(1 − y2)(1 − z2) + y(1 − z2)(1 − x2) + z(1 − x2)(1 − y2) = 4xyz.

Exercise 46 (IMOLL, 1986) Find the last eight digits of the binary development

of 271986.

Exercise 47 (IMOLL, 1986) Find four positive integers each not exceeding 70000

and each having more than 100 divisors.

Exercise 48 (IMOLL, 1986) Prove the inequality

(−a + b + c)2(a − b + c)2(a + b − c)2 ≥ (−a2 + b2 + c2)(a2 − b2 + c2)(a2 + b2 − c2)

for all a, b, c.

Page 171: Problem solving with Computer Algebraic Systems

170

Exercise 49 (IMOLL, 1986) Find all integers x, y, z such that

x3 + y3 + z3 = x + y + z = 8.

Exercise 50 (IMOLL, 1987) Determine the least possible value of the natural

number n such that n! ends in exactly 1987 zeros.

Exercise 51 (IMOLL, 1987) Find, with argument, the integer solutions of the

equation

3z2 = 2x3 + 385x2 + 256x − 58195.

Exercise 52 (IMOLL, 1988) Let n be a positive integer. Find the number of odd

coefficients of the polynomial

un(x) = (x2 + x + 1)n.

Exercise 53 (IMOLL, 1988) Let a be the greatest positive root of the equation

x3 − 3 · x2 + 1 = 0. Show that [a1788] and [a1988] are both divisible by 17. Here [x]

denotes the integer part of x.

Exercise 54 (IMOLL, 1988) Let

g(x) = x5 + x4 + x3 + x2 + x + 1.

What is the remainder when the polynomial g(x12) is divided by the polynomial

g(x)?

Exercise 55 (IMOLL, 1988) Find all positive integers x such that the product of

all digits of x is given by x2 − 10 · x − 22.

Exercise 56 (IMOLL, 1988) Show that the solution set of the inequality

70∑

k=1

k

x − k≥ 5

4

Page 172: Problem solving with Computer Algebraic Systems

171

is a union of disjoint intervals, the sum of whose length is 1988.

Exercise 57 (IMOLL, 1988) (i) Calculate x if

x =(11 + 6 ·

√2) ·

11 − 6 ·√

2 − (11 − 6 ·√

2) ·√

11 + 6 ·√

2

(√√

5 + 2 +√√

5 − 2) − (√√

5 + 1)

(ii) For each positive number x, let

k =

(x + 1

x

)6 −(x6 + 1

x6

)− 2

(x + 1

x

)3 −(x3 + 1

x3

)

Calculate the minimum value of k.

Exercise 58 (IMOLL, 1988) The Fibonacci sequence is defined by

an+1 = an + an−1, n ≥ 1, a0 = 0, a1 = a2 = 1.

Find the greatest common divisor of the 1960-th and 1988-th terms of the Fibo-

nacci sequence.

Exercise 59 (IMOLL, 1989) It is known that y

cos x + cos y + cos z

cos(x + y + z=

sin x + sin y + sin z

sin(x + y + z)= a.

Prove that

cos(y + z) + cos(x + z) + cos(x + y) = a.

Exercise 60 (IMOLL, 1990) Find the minimal value of the function

f(x) =√

15 − 12 cos x+

4 − 2√

3 sin x+

7 − 4√

3 sin x+

10 − 4√

3 sin x − 6 cos x

Exercise 61 (IMOLL, 1980) Find the digits left and right of the decimal point in

Page 173: Problem solving with Computer Algebraic Systems

172

the decimal form of the number

(√

2 +√

3)1980.

Exercise 62 (IMOLL, 1980) Prove that

tan 730′ =√

6 +√

2 −√

3 − 2.

Exercise 63 (IMOLL, 1989) Solve the equation

3x3 − [x] = 3

in the set of real numbers.

Exercise 64 (IMOLL, 1989) A sequence of real numbers x0, x1, x2, . . . is defined

as follows: x0 = 1989 and for each n ≥ 1

xn = −1989

n

n−1∑

k=0

xk.

Calculate the value of1989∑

n=0

2nxn.

Exercise 65 (IMOLL, 1989) Let

f(x) = a sin2 x + b sin x + c,

where a, b, and c are real numbers. Find all values of a, b and c such that the

following three conditions are satisfied simultaneously:

(i) f(x) = 381 if sin x = 12.

(ii) The absolute maximum of f(x) is 444.

(iii) The absolute minimum of f(x) is 364.

Page 174: Problem solving with Computer Algebraic Systems

173

Exercise 66 (IMOLL, 1989) Let S1, S2 be squares. Solve the equation S2 − S1 =

1989.

Exercise 67 (IMOLL, 1989) Prove the following identity

1 +1

2− 2

3+

1

4+

1

5− 2

6+ . . . +

1

478+

1

479− 2

480= 2

159∑

k=0

641

(161 + k)(480 − k).

Exercise 68 (IMOLL, 1990) Prove that the number

√2 +

√3 +

√1990

is irrational.

Exercise 69 (IMOLL, 1990) Prove the following equality

995∑

k=0

(−1)k

1991 − k

(1991 − k

k

)

=1

1991.

Exercise 70 (IMOLL, 1990) Let f(0) = f(1) = 0 and

f(n + 2) = 4n+2f(n + 1) − 16n+1f(n) + n · 2n2

, n = 0, 1, 2, . . . .

Prove that f(1989), f(1990) es f(1991) are divisible by 13.

Exercise 71 (IMOLL, 1990) Let a, b, c be arbitrary real numbers. Prove that

(a2 + ab + b2)(b2 + bc + c2)(c2 + ac + a2) ≥ (ab + ac + bc)3.

Exercise 72 (IMOLL, 1990) Solve the following system of equations

x3 + y3 = 1,

Page 175: Problem solving with Computer Algebraic Systems

174

x5 + y5 = 1

in the set of real numbers.

Exercise 73 (IMOLL, 1990) What is the minimum value of the expression

√15 − 12 cos x +

4 − 2√

3 sin x +

7 − 4√

3 sin x +

10 − 4√

3 sin x − 6 cos x.

Exercise 74 (IMOSL, 2009) Let a, b, c be positive numbers with

1

a+

1

b+

1

c= a + b + c.

Prove that

1

(2a + b + c)2+

1

(a + 2b + c)2+

1

(a + b + 2c)2≤ 3

16.

Exercise 75 (IMOSL, 1996) Let a, b, c be positive numbers with abc = 1. Prove

thatab

ab + a5 + b5+

bc

bc + b5 + c5+

ca

ac + a5 + c5≤ 1.

Exercise 76 (IMOSL, 2000) Let a, b, c be positive real numbers with abc = 1.

Prove that (

a − 11

b

)(

b − 1 +1

c

)(

c − 1 +1

a

)

≤ 1.

Exercise 77 (IMOSL, 1975) Let x0 = 5 and xn+1 = xn + 1xn

. Prove that

45 < x1000 < 45.1.

Exercise 78 (IMOSL, 1995) Let a, b, c be positive real numbers with abc = 1.

Show that1

a3(b + c)+

1

b3(a + c)+

1

c3(a + b)≥ 3

2.

Page 176: Problem solving with Computer Algebraic Systems

175

Exercise 79 (IMOSL, 1975) Determine

[109

n=1

n−2/3

]

.

Exercise 80 (IMOSL, 1960) Solve the following inequality

4x2

(1 −√

2x + 1)2< 2x + 9.

Exercise 81 (IMOSL, 1960) Determine all three-digit numbers N having the

property that N is divisible by 11, and N11

is equal to the sum of the squares of the

digits of N .

Exercise 82 (IMOSL, 1967) Solve the following system of equations

x2 + x − 1 = y,

y2 + y − 1 = z,

z2 + z − 1 = x.

Exercise 83 (IMOSL, 1967) Solve the following system of equations

|x + y| + |1 − x| = 6,

|x + y + 1| + |1 − y| = 4.

Exercise 84 (IMOSL, 1967) Prove that

cos x < 1 − x2

2+

x4

16

for every real x ∈(0, π

2

)

Page 177: Problem solving with Computer Algebraic Systems

176

Exercise 85 (JMOP, 2012) Determine the positive integers n for which the pro-

duct of their divisors is 24240.

Exercise 86 (JMOP, 2012) How many positive integers n are there such that

[1000000

n

]

−[1000000

n + 1

]

= 1.

Exercise 87 (TITEE, 2012) Find the number of digits of

99∑

n=0

3n.

Exercise 88 (TITEE, 2012) For real number a denote by [a] the greatest integer

not exceeding a. How many positive integers n ≤ 10000 are there which is [√

n] is

a divisor of n?

Exercise 89 (TITEE, 2012) Let n be positive integer. Define a sequence {ak} by

a1 =1

n(n + 1), ak+1 = − 1

k + n + 1+

n

k

k∑

i=1

ai (k = 1, 2, 3, · · ·).

Let

bn =n∑

k=1

√ak.

Prove that

limn→∞

bn = ln 2.

Exercise 90 (FTST, 2006) Let a, b, c be positive real numbers with abc = 1. Prove

thata

(a + 1)(b + 1)+

b

(b + 1)(c + 1)+

c

(c + 1)(a + 1)≥ 3

4.

Page 178: Problem solving with Computer Algebraic Systems

177

Exercise 91 (ARO, 2009) Let a, b, c real numbers with

(a + b)(b + c)(c + a) = abc,

and

(a3 + b3)(b3 + c3)(c3 + a3) = a3b3c3.

Prove that abc = 0.

Exercise 92 (IZO, 2005) Let a, b, c be positive real numbers. Prove that

c

a + 2b+

a

b + 2c+

b

c + 2a≥ 1.

Exercise 93 (IZO, 2005) Let a, b, c, d be positive real numbers. Prove that

c

a + 2b+

d

b + 2c+

a

c + 2d+

b

d + 2a≥ 4

3.

Exercise 94 (IZO, 2006) Let a, b, c, d be real numbers with

a + b + c + d = 0

Prove that

(ab + ac + ad + bc + bd + cd)2 + 12 ≥ 6(abc + abd + acd + bcd).

Exercise 95 (IZO, 2006) Solve in positive integers the equation

n = ϕ(n) + 402,

where ϕ(n) is the number of positive integers less than n having no common prime

factors with n.

Page 179: Problem solving with Computer Algebraic Systems

178

Exercise 96 (RNO, 2001) Show that there exist no integers a and b such that

a3 + a2b + ab2 + b3 = 2001.

Exercise 97 (RNO, 2001) Solve the equation

2x2+x + log2 x = 2x+1

in the set of real numbers.

Exercise 98 (USAIMTS, 1992) For an arbitrary positive integer n let P (n) denote

the number of its divisors. Determine the smallest n with

P (P (P (n))) > 1012.

Exercise 99 (HMMT, 2008) Let x, y be positive real numbers with

x2 + y2 = 1, x4 + y4 =17

18.

Determine xy.

Exercise 100 (HMMT, 2008) Let f(x) = x3 + x + 1. Suppose g is a cubic

polynomial such that g(0) = −1, and the roots of g are the squares of the roots of

f . Find g(9).

Exercise 101 (HMMT, 2008) Evaluate:

∞∑

n=1

n−1∑

k=1

k

2n+k.

Exercise 102 (HMMT, 2008) Find p so that

limx→∞

xp(

3√

x + 1 + 3√

x − 1 − 2 3√

x)

Page 180: Problem solving with Computer Algebraic Systems

179

is some non-zero real number.

Exercise 103 (HMMT, 2008) Let

f(x) = sin6(x

4

)

+ cos6(x

4

)

.

for all real numbers x. Determine f (2008)(0) (i.e., f differentiated 2008 times and

then evaluated at x = 0).

Exercise 104 (HMMT, 2008) Let

T =

∫ ln 2

0

2e3x + e2x − 1

e3x + e2x − ex + 1dx.

Determine exp{T}.

Exercise 105 (HMMT, 2008) Determine all pairs (a, b) of real numbers such that

10, a, b, ab

is an arithmetic progression.

Exercise 106 (HMMT, 2008) Find the real solution(s) to the equation

(x + y)2 = (x + 1)(y − 1).

Exercise 107 (HMMT, 2008) Given that

x + sin y = 2008,

and

x + 2008 cos y = 2007,

where 0 ≤ y ≤ π2. Find the value of x + y.

Page 181: Problem solving with Computer Algebraic Systems

180

Exercise 108 (HMMT, 2008) Determine

∞∑

n=1

n

n4 + 4.

Exercise 109 (HMMT, 2008) Solve the following equation

√√√√

x +

4x +

16x +

. . . +√

42008x + 3 −√

x = 1

in the set of real numbers.

Exercise 110 (HMMT, 2008) Let P (x) be a polynomial with degree 2008 and

leading coefficient 1 such that

P (0) = 2007, P (1) = 2006, P (2) = 2005, . . . , P (2007) = 0.

Determine the value of P (2008). You may use factorials in your answer.

Exercise 111 (HMMT, 2008) Let (x, y) be a pair of real numbers satisfying

56x + 33y = − y

x2 + y2,

33x − 56y =x

x2 + y2.

Determine the value of |x| + |y|.

Exercise 112 (HMMT, 2008) Let a, b, c be nonzero real numbers such that

a + b + c = 0, a3 + b3 + c3 = a5 + b5 + c5.

Find the value of a2 + b2 + c2?

Page 182: Problem solving with Computer Algebraic Systems

181

Exercise 113 (HMMT, 2008) Compute

arctg (tg 65◦ − 2 tg 40◦)?

Exercise 114 (HMMT, 2008) Evaluate:

∞∑

n=0

(2n

n

)1

5n.

Exercise 115 (HMMT, 2004) Find the largest number n such that (2004!)! is

divisible by ((n!)!)!.

Exercise 116 (HMMT, 2004) Compute

[20053

2003 · 2004− 20033

2004 · 2005

]

.

Exercise 117 (HMMT, 2004) Solve the equation

x4 + (2 − x)4 = 34

in the set of real numbers.

Exercise 118 (HMMT, 2004) Let x be a real number such that

x3 + 4x = 8.

Determine the value of x7 + 64x2.

Exercise 119 (HMMT, 2004) There exists a polynomial P of degree 5 with the

following property: if z is a complex number such that

z5 + 2004z = 1,

Page 183: Problem solving with Computer Algebraic Systems

182

then P (z2) = 0. Calculate the quotient

P (1)

P (−1).

Exercise 120 (HMMT, 2004) Let k, x, y be positive real numbers with

3 = k2

(x2

y2+

y2

x2

)

+ k

(x

y+

y

x

)

.

What is the maximum value of k.

Exercise 121 (SMT, 2010) How many zeros are there at the end of(200124

)?

Exercise 122 (SMT, 2010) What is the sum of the solutions to the following

equation1

x2 − 1+

2

x2 − 2+

3

x2 − 3+

4

x2 − 4= 2010x − 4.

Exercise 123 (SMT, 2006) Find the smallest nonnegative integer n for which

(2006

n

)

is divisible by 73.

Exercise 124 (SMT, 2006) Let a, b, c be real numbers satisfying:

ab − a = b + 119,

bc − b = c + 59,

ca − c = a + 71.

Determine all possible values of a + b + c.

Page 184: Problem solving with Computer Algebraic Systems

183

Exercise 125 (SMT, 2006) Let a and b be non zero digits. Solve the equation

aabb = n4 − 6n3.

Exercise 126 (SMT, 2006) Evaluate:

∞∑

k=1

1

k√

k + 2 + (k + 2)√

k

Exercise 127 (SMT, 2006) Evaluate:

∞∑

n=1

arctg

(1

n2 − n + 1

)

Exercise 128 (SMT, 2006) What is the minimum value of the expression

2x2 + 2y2 + 5z2 − 2xy − 4yz − 4x − 2z + 15

where x, y, z are real numbers.

Exercise 129 (SMT, 2006) Determine the following sum

10∑

x=2

1

x(x2 − 1).

Exercise 130 (PUMC, 2009) What is the common zero of the following three

polynomials?

x3 + 41x2 − 49x − 2009,

x3 + 5x2 − 49x − 245,

x3 + 39x2 − 117x − 1435.

Page 185: Problem solving with Computer Algebraic Systems

184

Exercise 131 (PUMC, 2009) For what positive integer k is

(200

k

)

·(

100

k

)

maximal?

Exercise 132 (PUMC, 2009) You are given that

17! = 355687ab809600

for some digits a and b. Find the two-digit number ab that is missing above.

Exercise 133 (PUMC, 2010) Find the sum of the coefficients of the polynomial

(63x − 61)4.

Exercise 134 (PUMC, 2010) Calculate

∞∑

n=1

([n√

2010]

− 1)

,

where ⌊x⌋ is the largest integer less than or equal to x.

Exercise 135 (PUMC, 2010) Let S be the sum of all real x such that

4x = x4.

Find the nearest integer to S.

Exercise 136 (PUMC, 2010) Define

f(x) = x +

x +

x +

x +√

x + . . ..

Page 186: Problem solving with Computer Algebraic Systems

185

Find the smallest integer x such that

f(x) ≥ 50√

x.

Exercise 137 (PUMC, 2010) Let α, β, γ denote the roots of the equation

3x3 − 5x2 + 2x − 6 = 0.

Calculate the expression

(1

α − 2

)2

+

(1

β − 2

)2

+

(1

γ − 2

)2

.

Exercise 138 (PUMC, 2010) Let

15√

2 − 1= a + b

5√

2 + c5√

4 + d5√

8 + e5√

16,

where a, b, c, d, e are integer numbers. Determine a2 + b2 + c2 + d2 + e2?

Exercise 139 (PUMC, 2010) Find the largest positive integer n such that

σ(n) = 28,

where σ(n) is the sum of the divisors of n, including n.

Exercise 140 (PUMC, 2010) Simplify the following fraction

1010

2011digitones︷ ︸︸ ︷

11 . . . 11 0101

1100 11 . . . 11︸ ︷︷ ︸

2011ones

0011.

Page 187: Problem solving with Computer Algebraic Systems

186

Exercise 141 (PUMC, 2010) Let f(n) be the sum of the digits of n. Find

99∑

n=1

f(n).

Exercise 142 (AIME, 1984) Determine ab, if ha

log8 a + log4 b2 = 5

and

log8 b + log4 a2 = 7?

Exercise 143 (KoMaL B.3740.) Let

a0 = 1, a1 =1

3, an+1 =

2an

3− an−1, (n ≥ 1).

Prove that there is positive integer n for which an > 0, 9999.

Exercise 144 (KoMaL B.3451.) Solve the following equation

arcsin x + arcsin√

15x =π

2.

Exercise 145 (KoMaL B.3863.) Prove that the number

12005 − 22006 + 32006 − 42006 + . . . − 20042006 + 20052006

is divisible by 1003.

Exercise 146 (KoMaL B.3846.) Solve the following equation

4√

2 − x + 4√

15 + x = 3.

Page 188: Problem solving with Computer Algebraic Systems

187

Exercise 147 (KoMaL C.1048.) Show that

2 cos 40◦ − cos 20◦

sin 20◦=

√3.

Exercise 148 (KoMaL K.267.) We know that

ab + acb = 2 · ba,

where ab, ba are two-digit numbers and acb is a three-digit number. Determine the

digits a and b if c = 0.

Exercise 149 (KoMaL C.729.) Solve the equation

2x lg x + x − 1 = 0

in the set of real numbers.

Exercise 150 (KoMal B.4531.) Solve the equation

(x2 + 100)2 = (x3 − 100)3.

Exercise 151 (KoMaL A.358.) Let a, b, c be positive numbers with abc = 1.

Prove the foillowing inequality

1

a+

1

b+

1

c− 3

a + b + c≥ 3

(1

a2+

1

b2+

1

c2

)

· 1

a2 + b2 + c2.

Exercise 152 (KoMaL Gy.3175.) Let a, b be positive real number. Prove the

following inequality

(a − b)2

2(a + b)≤√

a2 + b2

2−

√ab ≤ (a − b)2

√2(a + b)

.

Page 189: Problem solving with Computer Algebraic Systems

188

Exercise 153 (KoMaL B.4556.) Solve the system of equations

x3 = 5x + y,

y3 = 5y + x.

Page 190: Problem solving with Computer Algebraic Systems

Chapter 5

Some useful theorems

Theorem 1 (Binomial theorem) Let a, b real numbers and let n be a positive

integer. Then we have

(a + b)n =

(n

0

)

an +

(n

1

)

an−1b +

(n

2

)

an−2b2 + . . . +

(n

n − 1

)

abn−1 +

(n

n

)

bn

Proof. See [2].

Theorem 2 (Euler-Fermat Theorem) If n and a are coprime positive integers,

then

aϕ(n) ≡ 1 (mod n)

where ϕ(n) is the Euler’s totient function.

Proof. See [1].

Theorem 3 (Wilson’s Theoewm) Let p be a prime number. Then we have

(p − 1)! ≡ −1 (mod p).

Proof. See [1].

189

Page 191: Problem solving with Computer Algebraic Systems

190

Theorem 4 (Moivre’s formula) Let n be a positive integer. If the complex number

z = |z|(cos α + i sin α)

then we get

zn = |z|n(cos nα + i sin nα).

Proof. See [2].

Theorem 5 (Legendre’s formula) Let p be a prime number and let ordp(n) denote

the p-order of n. Then we get

ordp(n!) =∞∑

i=1

[n

pi

]

.

Proof. See [1].

Page 192: Problem solving with Computer Algebraic Systems

Bibliography

[1] Gyarmati Edit es Turan Pal, Szamelmelet, Tankonyvkiado, Budapest,

1989.

[2] Szendrei Janos, Algebra es szamelmelet, Nemzeti Tankonyvkiado, Buda-

pest, 1996.

[3] www.komal.hu.

[4] www.artofproblemsolving.com.

191

Page 193: Problem solving with Computer Algebraic Systems

Contents

1 Algebra and Number Theory . . . . . . . . . . . . . . . . . . . . . 5

2 Equations and Inequalities . . . . . . . . . . . . . . . . . . . . . . 63

3 Other problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

5 Some useful theorems . . . . . . . . . . . . . . . . . . . . . . . . . 189

192