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

Home > Logic
The Ten Statements II (Posted on 2014-05-08) Difficulty: 3 of 5
There are 10 statements written on a piece of paper:
  1. At least one of statements 9 and 10 is true.
  2. This either is the first true or the first false statement.
  3. There are three consecutive statements, which are false.
  4. The difference between the serial numbers of the last true and the first true statement divides the positive integer that is to be found.
  5. The sum of the numbers of the true statements is the positive integer that is to be found.
  6. This is not the last true statement.
  7. The number of each true statement divides the positive integer that is to be found.
  8. The positive integer that is to be found is the percentage of true statements.
  9. The number of divisors of the number that is to be found, (apart from 1 and itself) is greater than the sum of the numbers of the true statements.
  10. There are no three consecutive true statements.
What is the smallest possible value of the positive integer that is to be found?

See The Solution Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution re(2): Solution | Comment 3 of 7 |
(In reply to re: Solution by Jer)

The paradox is averted by statement 1 being false:

pos.     truth values
integ. stmts. 1 thru 10
 420  0 1 1 1 0 1 1 0 0 0
 840 0 1 1 1 0 1 1 0 0 0
 1260 0 1 1 1 0 1 1 0 0 0
 1680 0 1 1 1 0 1 1 0 0 0
 2100 0 1 1 1 0 1 1 0 0 0
 2520 0 1 1 1 0 1 1 0 0 0
 2940 0 1 1 1 0 1 1 0 0 0
 3360 0 1 1 1 0 1 1 0 0 0
 3780 0 1 1 1 0 1 1 0 0 0
 4200 0 1 1 1 0 1 1 0 0 0
 4620 0 1 1 1 0 1 1 0 0 0
 5460 0 1 1 1 0 1 1 0 0 0
 5880 0 1 1 1 0 1 1 0 0 0
 6720 0 1 1 1 0 1 1 0 0 0
 7140 0 1 1 1 0 1 1 0 0 0
 7980 0 1 1 1 0 1 1 0 0 0
 9240 0 1 1 1 0 1 1 0 0 0
 9660 0 1 1 1 0 1 1 0 0 0
DefDbl A-Z
Dim crlf$, tval(10)
Dim fct(20, 1)


Private Sub Form_Load()
 Text1.Text = ""
 crlf$ = Chr(13) + Chr(10)
 Form1.Visible = True
 DoEvents
 For target = 1 To 10000
 For a = 0 To 1
   tval(1) = a
 For b = 0 To 1
   tval(2) = b
 For c = 0 To 1
   tval(3) = c
 For d = 0 To 1
   tval(4) = d
 For e = 0 To 1
   tval(5) = e
 For f = 0 To 1
   tval(6) = f
 For g = 0 To 1
   tval(7) = g
 For h = 0 To 1
   tval(8) = h
 For i = 0 To 1
   tval(9) = i
 For j = 0 To 1
   tval(10) = j
   
   good = 1
   If a <> Abs(i Or j) Then good = 0
   If b <> Abs(a <> b) Then good = 0
   cons3 = 0
   For ix = 1 To 8
     If (tval(ix) = 0 And tval(ix + 1) = 0 And tval(ix + 2) = 0) Then cons3 = 1: Exit For
   Next
   If c <> cons3 Then good = 0
   true1 = 0
   For ix = 1 To 10
    If tval(ix) = 1 And true1 = 0 Then true1 = ix
    If tval(ix) = 1 Then truelast = ix
   Next
   diff = truelast - true1
   If diff = 0 Then
     texpect = 0
   Else
     If target Mod diff = 0 Then texpect = 1 Else texpect = 0
   End If
   If d <> texpect Then good = 0
   sumtrue = 0
   For ix = 1 To 10
     sumtrue = sumtrue + tval(ix)
   Next
   If e <> Abs(sumtrue = target) Then good = 0
   If f = 0 Then
     texpect = 1
   Else
     If g + h + i + j > 0 Then texpect = 1 Else texpect = 0
   End If
   If f <> texpect Then good = 0
   texpect = 1
   For ix = 1 To 10
    If tval(ix) = 1 Then If target Mod ix > 0 Then texpect = 0: Exit For
   Next
   If g <> texpect Then good = 0
   cons3 = 0
   For ix = 1 To 8
     If tval(ix) And tval(ix + 1) And tval(ix + 2) Then cons3 = 1: Exit For
   Next
   If h = Abs(target <> sumtrue * 10) Then good = 0
   If j = cons3 Then good = 0
   If good Then
     pfact = factor(target)
     nf = 1
     For ix = 1 To pfact
      nf = nf * (fct(ix, 1))
     Next
     nf = nf - 2
     If i <> Abs(nf > sumtrue) Then good = 0
     If good Then
       Text1.Text = Text1.Text & Str(target)
       For ix = 1 To 10
        Text1.Text = Text1.Text & Str(tval(ix))
       Next
       Text1.Text = Text1.Text + crlf$
       DoEvents
     End If
   End If
 Next
 Next
 Next
 Next
 Next
 Next
 Next
 Next
 Next
 Next
 Next target
 
End Sub
Function factor(num)
 diffCt = 0: good = 1
 n = Abs(num): If n > 0 Then limit = Sqr(n) Else limit = 0
 If limit <> Int(limit) Then limit = Int(limit + 1)
 dv = 2: GoSub DivideIt
 dv = 3: GoSub DivideIt
 dv = 5: GoSub DivideIt
 dv = 7
 Do Until dv > limit
   GoSub DivideIt: dv = dv + 4 '11
   GoSub DivideIt: dv = dv + 2 '13
   GoSub DivideIt: dv = dv + 4 '17
   GoSub DivideIt: dv = dv + 2 '19
   GoSub DivideIt: dv = dv + 4 '23
   GoSub DivideIt: dv = dv + 6 '29
   GoSub DivideIt: dv = dv + 2 '31
   GoSub DivideIt: dv = dv + 6 '37
   If INKEY$ = Chr$(27) Then s$ = Chr$(27): Exit Function
 Loop
 If n > 1 Then diffCt = diffCt + 1: fct(diffCt, 0) = n: fct(diffCt, 1) = 1
 factor = diffCt
 Exit Function

DivideIt:
 cnt = 0
 Do
  q = Int(n / dv)
  If q * dv = n And n > 0 Then
    n = q: cnt = cnt + 1: If n > 0 Then limit = Sqr(n) Else limit = 0
    If limit <> Int(limit) Then limit = Int(limit + 1)
   Else
    Exit Do
  End If
 Loop
 If cnt > 0 Then
   diffCt = diffCt + 1
   fct(diffCt, 0) = dv
   fct(diffCt, 1) = cnt
 End If
 Return
End Function


  Posted by Charlie on 2014-05-09 00:03:11
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 (17)
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