When the digit is placed at the beginning and end of a positive integer N, the new number is 99*N.
Find the smallest value of N.
(In reply to
We're going to need more precision (spoiler) by Steve Herman)
If d is the digit in question and p is one more than the length of N:
99*N = d*(10^p + 1) + 10*N
so N=d*(10^p+1)/89
10 for P=2 to 99
20 for D=1 to 9
30 N=D*(10^P+1)//89
40 if N=int(N) then print P,D,N
50 next
60 next
produces values of N that work if the length of its representation is p - 1.
The table below shows the smallest value of N is 112359550561797752809.
p d N
22 1 112359550561797752809
22 2 224719101123595505618
22 3 337078651685393258427
22 4 449438202247191011236
22 5 561797752808988764045
22 6 674157303370786516854
22 7 786516853932584269663
22 8 898876404494382022472
x 22 9 1011235955056179775281
66 1 11235955056179775280898876404494382022471910112359550561797752809
66 2 22471910112359550561797752808988764044943820224719101123595505618
66 3 33707865168539325842696629213483146067415730337078651685393258427
66 4 44943820224719101123595505617977528089887640449438202247191011236
66 5 56179775280898876404494382022471910112359550561797752808988764045
66 6 67415730337078651685393258426966292134831460674157303370786516854
66 7 78651685393258426966292134831460674157303370786516853932584269663
66 8 89887640449438202247191011235955056179775280898876404494382022472
x 66 9 101123595505617977528089887640449438202247191011235955056179775281
Those marked with x do not work as the length of N is too great (i.e., equal to p).
Edited on July 11, 2015, 9:40 am
|
Posted by Charlie
on 2015-07-11 09:36:36 |