All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
How many zeros does this end in? (Posted on 2024-04-05) Difficulty: 3 of 5
How many consecutive zeros does:
111000 - 1
end in?

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
expanding | Comment 2 of 4 |
clearvars
v=sym(11); ct=0; prev=0; mx=0;
for i=2:50000
  v=v*11;
  tst=char(v-1);
  ct=0;
  j=length(tst);
  while tst(j)=='0'
    ct=ct+1;
    j=j-1;
  end
  if ct>=mx 
    disp([i,ct])
    mx=ct;
  end
  prev=ct;
end  


>> howManyZerosAtEnd
           2           1
           3           1
           4           1
           5           1
           6           1
           7           1
           8           1
           9           1
          10           2
          20           2
          30           2
          40           2
          50           3
         100           3
         150           3
         200           3
         250           3
         300           3
         350           3
         400           3
         450           3
         500           4
        1000           4
        1500           4
        2000           4
        2500           4
        3000           4
        3500           4
        4000           4
        4500           4
        5000           5
       10000           5
       15000           5
       20000           5
       25000           5
       30000           5
       35000           5
       40000           5
       45000           5
       50000           6


All results have at least one trailing zero.

Multiples of 10 have at least two.

Multiples of 50 have at least three.

Multiples of 500 have at least four.

Multiples of 5000 have at least five.

Multiples of 50,000 have at least six.

etc.

Manual testing:

>> powermod(sym(11),100000,100000000)
ans =
46000001
>> powermod(sym(11),500000,100000000)
ans =
30000001
>> 


  Posted by Charlie on 2024-04-05 12:51:10
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (13)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information