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

Home > Numbers
Divisible and not Divisible 2 (Posted on 2023-08-05) Difficulty: 3 of 5
Determine the minimum value of a positive integer N such that N divides 3N-3, but N does NOT divide 2N-2.

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 Solution Comment 1 of 1
The first several solutions:
6 (is the minimum value)
66
91
121
286
671
703
726
949
1541
1891
2665
3281
3367
3751
4961
------------
def divides(n,d):
    """ bool   Does d evenly divide N?  """
    import math
    result = n
    while result > d:
        result =  result - d * 10**int(math.log(result,10) - math.log(d,10))
    return result%d == 0

big = 5500
for n in range(1,big):
    if divides(3**n-3,n) and not divides(2**n-2,n):
        print(n)
  Posted by Larry on 2023-08-05 09:35:36
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 (10)
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