Film, Media & TV12 mins ago
Long Number With Special Property
9 Answers
If we start with 2 and build up one digit at a time creating the smallest number with a certain property we get the number 20120456708436008 before we have to stop. What do we get if we start with the number one?
Answers
Best Answer
No best answer has yet been selected by kuiperbelt. Once a best answer has been selected, it will be shown here.
For more on marking an answer as the "Best Answer", please visit our FAQ.I looked this up, because I was curious if this were a well-known problem. It possibly isn't, but in any case I now know the solution and won't contribute an answer in case anybody else wants a go. But I will give a hint, or possibly just a clarification: the "build up one digit at a time" part means that we're generating a sequence 2, 20, 201, 2012 etc., and just adding a digit at the end until we "have to stop".
I looked this up as well. I would never have got it. Here's a Fortran program starting with 1 to 9:
program nums
integer(16)::j,n,k
do i=1,9
j=i
n=2
write(*,"(1i1)",advance="no") j
k=0
do while(k .ne. 10)
if(mod(j*10+k,n)==0) then
write(*,"(1i1)",advance="no") k
j=j*10+k
k=0
n=n+1
else
k=k+1
end if
end do
print *
end do
end program nums
it can be run here:
https:/ /www.tu torials point.c om/comp ile_for tran_on line.ph p
program nums
integer(16)::j,n,k
do i=1,9
j=i
n=2
write(*,"(1i1)",advance="no") j
k=0
do while(k .ne. 10)
if(mod(j*10+k,n)==0) then
write(*,"(1i1)",advance="no") k
j=j*10+k
k=0
n=n+1
else
k=k+1
end if
end do
print *
end do
end program nums
it can be run here:
https:/
The question appears here ("Mindset by 700", bottom of page 4), as does the answer I provided (page 9):
https:/ /extras .thetim es.co.u k/web/p dfs/fb5 f9c02c1 639d636 39a4ccd d687577 6.pdf
https:/
Thank you to all contributors on this thread. Your honesty is admirably refreshing and without exception each and everyone of you are a credit to the AB forum!! I am not going to award BA as you have all behaved with such probity and I am unable to single out any one particular individual. Once again many thanx to you all!!
Related Questions
Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.