- 代碼:
找出具有下列各性質的最小正整數n:
(a)他的十進位表示法的最後一位數(即個位數)為6
(b)如果把最後的位數6擦掉,並放在其他位數之前,則結果所得為原數n的四倍
設原數=10x+6
新數=6*10^y+x
4(10x+6)=6*10^y+x(註:
6*10^y+x表示6×10y+x )
39x+24=6*10^y
Let y=1,2,3,..... 代入
y=1,2,3,4(不是整數,不合)
....
t=5, x=15384
n=153846
(速算法,原理尚不知,懂了再回覆你)
用 6除以79,看看循環節就會找到了。
6/39=0.15384615384615384615384615384615
類似題:
- 代碼:
(1)已知一正整數的最左一位是8。將最左一位移到個位數,得一新
數。如果原數是新數的8倍,求原數的最小值
8*10^k+a=8(10a+8)
8*10^k=79a+64
a=(8*10^k-64)/79
令 K=1,2,3,4........代入
第1個整數是 k= 9 ,(8*10^9-64)/79 =101265822
∴原數= 8101265822
- 代碼:
(2)已知一正整數的最左一位是4。將最左一位移到個位數,得一新
數。如果原數是新數的4倍,求原數的最小值?
Carunty 回覆於: 2003/10/9 下午 11:54:13
--------------------------------------------------------------------------------
Let the orginal number = 4*10m+x
where m,x are integer and m>=1,x>=0 and log(x)< m
So,
(4*10m+x) =4(10x+4)
x=(4*10m-16)/39
So,min(x) get when m is min.
Consider m=1
(4*10m-16)/39 is not integer ,Reject
Consider m=2
(4*10m-16)/39 is not integer ,Reject
Consider m=3
(4*10m-16)/39 is not integer ,Reject
Consider m=4
(4*10m-16)/39 is not integer ,Reject
Consider m=5
(4*10m-16)/39 =10256
So, min(x)=10256 at m=5
therefore ,orginal number = 410256