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

Home > Just Math
Consecutive Deletion (Posted on 2015-04-22) Difficulty: 3 of 5
N is a five-digit base ten positive integer formed entirely by nonzero digits.

Find the total number of values of N such that such that deleting consecutively the digit of the left, in each step, we obtain a divisor of the previous number.

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.)
Solution computer solution | Comment 1 of 8
 For n = 11111 To 99999
   ns = Str$(n)
   If InStr(ns, "0") = 0 Then
    prev = n
    good = 1
    For i = 1 To 4
      ns = Mid(ns, 2)
      newn = Val(ns)
      If prev Mod newn <> 0 Then
       good = 0: Exit For
      End If
      prev = newn
    Next
    If good Then Text1.Text = Text1.Text & Str(n) & crlf: goodCt = goodCt + 1
   End If
 Next
 
finds 

 53125
 91125
 95625
3

so there are 3 such values.

  Posted by Charlie on 2015-04-22 14:20:58
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 (3)
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