Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

151 problem solution

def power_crisis(n,k):
    if n == 1:
        return 1
    else:
        return (power_crisis(n-1,k)+k-1)%n+1

while True:
    n = int(input())
    if n == 0:
        break
    i = 1
    while power_crisis(n-1,i) != 12:
        i += 1
    print(i)
Comment

PREVIOUS NEXT
Code Example
Python :: quotation marks n string 
Python :: embeds discord.py 
Python :: change edit last line python 
Python :: speak by a discord bot in python 
Python :: create instances of a class in a for loop 
Python :: convert pdf to word doc in python 
Python :: length of dictionary python 
Python :: python selenium check if browser is open 
Python :: get last x elements of list python 
Python :: Using replace() method to remove newlines from a string 
Python :: interface in python 
Python :: pandas if nan, then the row above 
Python :: tensorflow euclidean distance 
Python :: get raster corners python 
Python :: python write data to file with permissions 
Python :: python linear search 
Python :: discord embed python 
Python :: python remove first element of list 
Python :: how to get all 5 letter words in python 
Python :: python maximum product subarray 
Python :: python - sending mail 
Python :: index.py:14: RuntimeWarning: invalid value encountered in true_divide return np.dot(user, user2) / (norm(user) * norm(user2)) 
Python :: check if variable is defined in python 
Python :: clear all value in set on python 
Python :: How to Join list element into a string in python 
Python :: open python not write file 
Python :: python sounddevice stop recording 
Python :: @foreach 1 numper 
Python :: python check if string is in a list 
Python :: pandas show all dataframe method 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =