Stop Microsoft

Miscellaneous => Programming & Networking => Topic started by: TheQuirk on 1 November 2005, 23:55

Title: Challenge n: Fun with numbers!
Post by: TheQuirk on 1 November 2005, 23:55
This one can be solved using a computer or a pen and paper.

n is a six-digit natural number. n's first digit is 2. If n's first digit is removed and placed at the front of the number, then the new number is three times larger than n.

What's n?
Title: Re: Challenge n: Fun with numbers!
Post by: piratePenguin on 2 November 2005, 00:20
.
Title: Re: Challenge n: Fun with numbers!
Post by: piratePenguin on 2 November 2005, 02:35
w00t!, made a program to do this, here's the C source code:
http://illhostit.com/files/4811330734929765/n.c (http://illhostit.com/files/4811330734929765/n.c)
 
Quote
piratepenguin@pcdeclan:~/stuff/programming/c/n$ ./n | grep yes
Checking: 285714... yes!
The answer is 285714 :)