mpo119.py

Created by schraf

Created on July 28, 2023

277 Bytes


from math import *

def f(n): return int(193.5 - 89 * sin(radians(77 * n)))

def pas_floyd(f, n):
  a = []
  while n not in a:
    a.append(n)
    n = f(n)
  t = a.index(n)
  return t, n, len(a) - t

while True:
 n = int(input('n ? '))  
 print(n,pas_floyd(f,n))

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.