List of Symbols Symbol Z x∈S x∈ /S Z+ N W ab a≤b a≥b min{x, y} max{x, y} |x| x x i=m = i=k m Meaning set of integers x belongs to set S x does not belong to set S set of positive integers set of positive integers set of whole numbers a is less than b a is greater than b a < b or a = b a > b or a = b the minimum of x and y the maximum of x and y the absolute value of x the floor of the real number x the ceiling of the real number x = i=k m ak + ak+1 + · · · + am Page (3) (3) (3) (3) (3) (4) (4) (4) (5) (5) (5) (5) (5) (6) (6) (9) k the sum of the values of as i runs over the various values in I (11) aij the sum of the values of aij , where i and j satisfy properties P (11) ak ak+1 · · · am (13) n factorial (13) binomial coefficient (33) triangular number square number pentagonal number hexagonal number tetrahedral number square pyramidal number pentagonal pyramidal number hexagonal pyramidal number the quotient when a is divided by b the remainder when a is divided by b (40) (44) (46) (48) (49) (50) (51) (51) (71) (71) i∈I P i=m = i=k n! n r tn sn pn hn Tn Sn Pn Hn a div b a mod b m i=k = m k Symbol a|b a b |A| A∪B A∩B A N = (ak ak−1 a1 a0 )b Rn π(x) Fn Ln |A| fn (a, b) (a1 , a2 , , an ) pa n [a, b] [a1 , a2 , , an ] a ≡ b (mod m) a ≡ b (mod m) [r] a−1 ρ(n) In n# ϕ(n) τ (n) σ (n) Mp μ(n) λ(n) ordm a ψ(d) indα a (a/p) (a/m) (a/n) Meaning a is a factor of b a is not a factor of b the number of elements in set A the union of sets A and B the intersection of sets A and B the complement of set A base-b representation of N repunit with n ones the number of primes ≤ x the nth Fibonacci number the nth Lucas number the determinant of matrix A the nth Fermat number the greatest common factor of a and b the greatest common factor of a1 , a2 , , and an pa exactly divides n the least common multiple of a and b the least common multiple of a1 , a2 , , and an a is congruent to b modulo m a is not congruent to b modulo m the congruence class represented by r an inverse of a modulo m the digital root of n the identity matrix of order n the product of primes ≤ n Euler’s phi function the number of positive factors of n the sum of the positive factors of n Mersenne number 2p − Möbius function Liouville function the order of a modulo m the number of incongruent residues of order d modulo p the index of a to the base α Legendre symbol Jacobi symbol Kronecker symbol Page (74) (74) (76) (76) (76) (76) (83) (96) (110) (129) (136) (138) (139) (155) (162) (183) (184) (187) (212) (212) (216) (234) (291) (316) (325) (342) (365) (366) (381) (398) (405) (456) (470) (483) (501) (527) (549) Elementary Number Theory with Applications Second Edition Elementary Number Theory with Applications Second Edition Thomas Koshy AMSTERDAM • BOSTON • HEIDELBERG • LONDON NEW YORK • OXFORD • PARIS • SAN DIEGO SAN FRANCISCO • SINGAPORE • SYDNEY • TOKYO Academic Press is an imprint of Elsevier Academic Press is an imprint of Elsevier 30 Corporate Drive, Suite 400, Burlington, MA 01803, USA 525 B Street, Suite 1900, San Diego, California 92101-4495, USA 84 Theobald’s Road, London WC1X 8RR, UK This book is printed on acid-free paper ∞ Copyright © 2007, Elsevier Inc All rights reserved No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopy, recording, or any information storage and retrieval system, without permission in writing from the publisher Permissions may be sought directly from Elsevier’s Science & Technology Rights Department in Oxford, UK: phone: (+44) 1865 843830, fax: (+44) 1865 853333, E-mail: permissions@elsevier.com You may also complete your request on-line via the Elsevier homepage (http://elsevier.com), by selecting “Support & Contact” then “Copyright and Permission” and then “Obtaining Permissions.” Library of Congress Cataloging-in-Publication Data Koshy, Thomas Elementary number theory with applications / Thomas Koshy – 2nd ed p cm Includes bibliographical references and index ISBN 978-0-12-372487-8 (alk paper) Number theory I Title QA241.K67 2007 512.7–dc22 2007010165 British Library Cataloguing-in-Publication Data A catalogue record for this book is available from the British Library ISBN: 978-0-12-372487-8 For information on all Academic Press publications visit our Web site at www.books.elsevier.com Printed in the United States of America 07 08 09 10 Dedicated to my sister, Aleyamma Zachariah, and my brother, M K Tharian; and to the memory of Professor Edwin Weiss, Professor Donald W Blackett, and Vice Chancellor A V Varughese Contents Preface A Word to the Student xiii xxi Fundamentals 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 Fundamental Properties 15 26 32 39 49 52 57 60 62 65 66 Divisibility 69 The Summation and Product Notations Mathematical Induction Recursion The Binomial Theorem Polygonal Numbers Pyramidal Numbers Catalan Numbers Chapter Summary Review Exercises Supplementary Exercises Computer Exercises Enrichment Readings 2.1 2.2 2.3 2.4 2.5 2.6 2.7 The Division Algorithm Base-b Representations (optional) Operations in Nondecimal Bases (optional) Number Patterns Prime and Composite Numbers Fibonacci and Lucas Numbers Fermat Numbers Chapter Summary Review Exercises Supplementary Exercises Computer Exercises Enrichment Readings 69 80 89 98 103 128 139 143 146 148 151 153 vii ... coefficient (33) triangular number square number pentagonal number hexagonal number tetrahedral number square pyramidal number pentagonal pyramidal number hexagonal pyramidal number the quotient when... (456) (470) (483) (501) (527) (549) Elementary Number Theory with Applications Second Edition Elementary Number Theory with Applications Second Edition Thomas Koshy AMSTERDAM • BOSTON • HEIDELBERG... Data Koshy, Thomas Elementary number theory with applications / Thomas Koshy – 2nd ed p cm Includes bibliographical references and index ISBN 978-0-12-372487-8 (alk paper) Number theory I Title