Skip Navigation

Posts
2
Comments
9
Joined
3 yr. ago

  • Fixed it now!

     
        
    def Fmmin():
        for n in range(2, number):
            if number % n == 0:
                return n
            if n == number - 1 and number - 1 % n != 0:
                return 0
    def Fmmax():
        for n in range(number-1, 1, -1):
            if number % n == 0:
                return n
            if n == 2 and number % n != 0:
                return 0
    
      
  • I figured it out! I just needed to use break.

     
        
    num = []
    Ms = []
    def Fmmin(va):
        while va == 0:
            for n in range(2, number):
                if number % n == 0:
                    va = n
                    break
                if n == number - 1 and number - 1 % n != 0:
                    va = '0'
        return va
    def Fmmax(va):
        while va == 0:
            for n in range(number-1, 1, -1):
                if number % n == 0:
                    va = n
                    break
                if n == 2 and number % n != 0:
                    va = '0'
        return va
    
    for f in range(1,10000000):
        number = 452021 + f
        mmin = 0
        mmax = 0
        mmin = Fmmin(mmin)
        mmax = Fmmax(mmax)
        if int(mmax) > 0 and int(mmin) > 0:
            M = mmax + mmin
            if M % 7 == 3:
                num.append(number)
                Ms.append(M)
        if len(num) >= 5:
            break
    print(Ms)
    print(num)
    
      
  •  
        
    num = []
    Ms = []
    while len(num) <= 5:
        for f in range(1,1000000):
            a = 452021 + f
            mmin = 0
            mmax = 0
            while mmin == 0:
                for n in range(2,a-1):
                    if a % n == 0:
                        mmin = n
                    if n == a-1 and a % n != 0:
                        mmin = '0'
            while mmax == 0:
                for n in range(a-1,2,-1):
                    if a % n == 0:
                        mmax = n
                    if n == 2 and a % n !=0:
                        mmax = '0'
            M = int(mmax) + int(mmin)
            if M % 7 == 3:
                num.append(a)
                Ms.append(M)
    print(Ms)
    print(num)
    
      
  • What did I do wrong? I could look up proper solution to this exercise but I would still like to know what exactly is off. I feel like its something super obvious and stupid.

  • GenZedong @lemmygrad.ml

    Can you list and give date to every major/notable event and social topics throughout 2016 to 2023? I would like to start keeping track of changes in the world by writing them down.

  • I wonder what war looks like in their heads. Is it a fps shooter? A HOI campaign perhaps? Do they seriously believe soldiers just charge at each other?

  • What is the source of your carnal desire for nuclear annihilation??

  • WTF North Korea really does violate human rights?!? 😱

  • GenZedong @lemmygrad.ml

    Where is Lukashenko on the basedness scale?

  • Lol the comments going like "what are we, a bunch of commies?" are cracking me up