Le Monde puzzle [41]

October 17, 2010
By

(This article was first published on Xi'an's Og » R, and kindly contributed to R-bloggers)

The current puzzle in Le Monde this week is again about prime numbers:

The control key on a credit card is an integer η(a) associated with the card number a such that, if the card number is c=ab, its key η(c) satisfies η(c)=η(a)+η(b)-1. There is only one number with a key equal to 1 and the keys of 160 and 1809 are 10 and 7, respectively. What is the key of 2010?

The key of 1 is necessarily 1 since

η(a1)=η(a)+η(1)-1=η(a).

So this eliminates 1. Now, the prime number decompositions of 160, 1809, and 2010 are given by

> prime.factor(160)
[1] 2 2 2 2 2 5
> prime.factor(1809)
[1]  3  3  3 67
> prime.factor(2010)
[1]  2  3  5 67

using a function of the (still bugged!) schoolmath package. We thus have the decompositions

5η(2)+η(5)=11

3η(3)+η(67)=8

Since η(2) cannot be 1 and is an integer, we necessarily have η(2)=2 but then this implies η(5)=1 (!), unless 0 is also a valid key (?), which would imply that η(5)=11. With the same constraint on 1, the second sum also leads to the unique solution η(3)=2 and η(67)=2. I thus wonder if there is a bug in the key of 160…

Filed under: R, University life Tagged: Le Monde, mathematical puzzle, schoolmath

To leave a comment for the author, please follow the link and comment on their blog: Xi'an's Og » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , , , ,

Comments are closed.

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)