Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- sys.float_info.max
- print('yy = int(Y, 2)' )
- print('For a binary string equal to the input value in terms of length')
- print('Does this binary string (yy) has an exact factor for M?')
- print('I will show that the binary string is equal to creating tallies')
- value = int(input('Enter an integer >6: : '))
- if value > 6:
- print('ok')
- else:
- print('must be > 6')
- quit()
- print('Tallies')
- ask = value
- # Here asktally performs simple arthemtic in the geometric sequencing.
- # If you read the prior posts. You will the understand the purpose.
- askTally = int(ask) -6
- # Here the variable s adds the missing elements needed to create a binary
- # string that WILL always be equal to the input value.
- s = "0" * askTally
- seq = ("11111","0");
- # Here Y joins the two strings together s and seq and creates a binary string
- Y= s.join( seq )
- # The variable yy converts the binary string into int
- yy = int(Y, 2)
- bitlength = len(Y)
- tally = str.replace(Y, "0", "1")
- print(tally, bitlength, 'Tallies')
- print(yy, '=', '124*','_',yy//124)
- n = yy
- m = int(input('enter target integer: '))
- if n % m == 0:
- print("yes,", m, "is a factor of", n)
- else:
- print("no,", m, "is not a factor of", n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement