Here you will find daily news and tutorials about R, contributed by over 750 bloggers.
There are many ways to follow us - By e-mail:On Facebook: If you are an R blogger yourself you are invited to add your own R content feed to this site (Non-English R bloggers should add themselves- here)

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

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…