## Easy as 123451

Posted by Zorglub on December 19, 2014 – 3:08 pm

A function f takes a positive integer and returns another one by moving the leftmost digit to the right.

For example f(12345) = 23451

What is the smallest strictly positive integer n such that f(n) = 1.5 n

December 27th, 2014 at 2:26 am

n = 352,941,176,470,588

Let n = (10^r)*d + A, then f(n) = 10A + d = 1.5[(10^r)*d + A)

So 17A = d[3*(10^r) – 2) where d < 10

So 17 must divide into one of 28, 298, 2998, . . .

After a minute or two on the calculator we eventually get A/d = 176,470,588,235,294

d = 3 leads us to the answer

December 30th, 2014 at 5:12 am

Ans: 1,176,470,588,235,294

Let N be an n digit string and D be a single digit. We want to find ND = 1.5*DN

So 10*N + D = 1.5 * (D*10ⁿ + N)

20*N + 2*D = 3*D*10ⁿ + 3*N

17*N = D(3*10ⁿ – 2)

As 1 ≤ D ≤ 9, we must have D ≠ 0 (mod 17), so 3*10ⁿ = 2 (mod 17)

Multiplying by 9 => 27*10ⁿ = 18 (mod 17) => 10^(n+1) = 1 (mod 17)

Fermat’s little theorem says n+1 = 16 = 2^4 satisfies that equation. A quick check shows that n+1 = 8 fails to satisfy it, so n+1 = 16 is the smallest power that satisfies the equation. So n = 15.

Substituting that into 17*N = D(3*10ⁿ – 2) =>

17*N = 2,999,999,999,999,998*D =>

N = 176,470,588,235,294*D

We also need ND = 1.5*DN => (2/3)*ND = DN

i.e. (2/3)*1,764,705,882,352,94D = D,176,470,588,235,294

But (2/3)*176,470,588,235,294 = 117,647,058,823,529.333….

so D = 1. Check: 1,764,705,882,352,941 = 1.5*1,176,470,588,235,294

So the required number is 1,176,470,588,235,294 and either Wiz or I has had too much to drink.

December 30th, 2014 at 9:39 pm

Hi Chris, I plead guilty to the disorderly part of being drunk and disorderly. I failed to notice in checking my answer that 1.5*n was out by just 1 in the last digit for my version of n. So, as usual, you’ve confounded me again and shown up my carelessness.

Must do better is my new years resolution. Have a happy new year. You too Zorglub – nice problem.

January 16th, 2015 at 2:24 pm

Good job. And nice touch with Fermat’s little Theorem.

January 17th, 2015 at 6:05 am

Hi Zorglub. This problem is very similar to the very first one that I did on ToM (it used a factor of 2 rather than 1.5). I loved it because of the ridiculously large number that resulted. It caused me to learn about modulo arithmetic. I was a bit naughty in not stating that because 17 is prime, that gcd(D,17) = 1 was assumed. Thanks for posting it.

Hi Wiz. I’m relieved that it wasn’t me who’d goofed.