1.38. To see if a number, say 562437487, is divisible by 3, you just add up the digits of its decimalrepresentation, and see if the result is divisible by role="math" localid="1658402816137" 3.

( 5+6+2+4+3+7+4+8+7=46, so it is not divisible by 3).

To see if the same number is divisible by 11, you can do this: subdivide the number into pairs ofdigits, from the right-hand end(87,74,43,62,5) , add these numbers and see if the sum is divisible by11 (if it's too big, repeat).

How about 37? To see if the number is divisible by 37, subdivide it into triples from the end(487,437,562) add these up, and see if the sum is divisible by37 .


This is true for any prime pother than2 and 5. That is, for any prime p≠2,5, there is an integer rsuch that in order to see ifp divides a decimal number n, we breakn into r-tuples of decimal digits (starting from the right-hand end), add up these r-tuples, and check if the sum is divisible by p.

(a) What is the smallest rsuch for p=13? Forp=13 ?

(b) Show thatr is a divisor of p-1.

Short Answer

Expert verified
  1. The smallest “r” forp=13 and forp=17 are12,16 .
  2. "r" is a divisor of "p-1" is depicted.

Step by step solution

01

Step 1: Introduction to the Concept

A tuple is an ordered list (sequence) of elements with a finite number of elements. A sequence (or ordered list) of n elements is called an n-tuple, where n is a non-negative integer. Only one 0-tuple exists, which is referred to as the empty tuple.

02

Step 2: Solution Explanation

a)

Consider the following example where a decimal number "N" is required to divide up into "r" tuples:

Integer value is,NkNk1...N1

  • The above value is the same as multiplying each term by "10" to the power of "r" and then summing the results.

ThenN=N1+N2×10r+...+Nk×(10r)k-1

  • While takingNmodp

Nmodp=(N1+N2×10r+...+Nk×(10r)k-1)modp=N1+N2+...+Nk

Observation:10r=1modp-----(1)

  • By on "Fermat's Little Theorem"

10p1=1modp-----(2)

When comparing equations (1) and (2), the value of "r" is comparable to "p-1",

For p=13, the smallest "r" is:

r=p1=131=12

For p=17, the smallest "r" is:

r=p1=171=16

Hence, the smallest “r” for p=13 is 12and for p=17 is16 .

03

Step 3: Solution Explanation

b)

Take the integer "562437487" and the value of "p" to be "37".

  • If the value of "p" is "37" divide the integer value into triples from right to left, according to the stated statement.
  • As a result,562437487={487,437,562}; consequently, the "r" value is "3" in this case.
  • "r" denotes the number of tuples for which the decimal digits have been broken.

p1=371=36

  • Then "role="math" localid="1658403981019" 36mod3=0" indicating that "3" is the divisor of "36".

As a result, it can be seen that "r" is a divisor of "p-1".

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

The algorithm for computing abmodCby repeated squaring does not necessarily lead to the minimum number of multiplications. Give an example of b>10where the exponentiation can be performed using fewer multiplications, by some other method.

Compute GCD(210,588)two different ways: by finding the factorization of each number, and by using Euclid’s algorithm.

RSA and digital signatures. Recall that in the RSA public-key cryptosystem, each user has a public key P=(N,e) and a secret key d. In a digital signature scheme, there are two algorithms, sign and verify. The sign procedure takes a message and a secret key, then outputs a signature σ. The verify procedure takes a public key (N,e), a signature σ, and a message M, then returns “true” if σcould have been created by sign (when called with message M and the secret key (N, e) corresponding to the public key ); “false” otherwise.

(a)Why would we want digital signatures?

(b) An RSA signature consists of sign, (M,d)=Md(modN)where d is a secret key and N is part of the public key . Show that anyone who knows the public key (N,e)can perform verify ((N,e),Md,M), i.e., they can check that a signature really was created by the private key. Give an implementation and prove its correctness.

(c) Generate your own RSA modulus, N=pq public key e, and private key d (you don’t need to use a computer). Pick p and q so you have a 4-digit modulus and work by hand. Now sign your name using the private exponent of this RSA modulus. To do this you will need to specify some one-to-one mapping from strings to integers in [0,N-1]. Specify any mapping you like. Give the mapping from your name to numbers m1,m2,...mk,then sign the first number by giving the value md1(modN), and finally show that .

(md1)e=m1(modN)

(d) Alice wants to write a message that looks like it was digitally signed by Bob. She notices that Bob’s public RSA key is (17,391). To what exponent should she raise her message?

Suppose that instead of using a compositeN=pqin the RSA cryptosystem (Figure 1.9), we simply use a prime modulus p . As in RSA, we would have an encryption exponent e, and the encryption of a message mmodpwould be memodp.Prove that this new cryptosystem is not secure, by giving an efficient algorithm to decrypt: that is, an algorithm that given and p,e,andmemodp as input, computes . Justify the correctness and analyze the running time of your decryption algorithm.

Show that any binary integer is at most four times as long as the corresponding decimal integer. For very large numbers, what is the ratio of these two lengths, approximately?

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free