# Type your text here
print("Bonjour dans mon programe pour les suite geometrique ")print("")print("")print("Chose importante le terme 'rang' fait reference au 'n' terme de la suite ex :")print(" le rang de U0 est 0")print(" le rang de U1 est 1")print(" le rang de U55 est 55")print("")print("")r=float(input("Raison : "))rang1=float(input("Rang 1er terme : "))valeur1=float(input("Valeur 1er terme : "))print("")print("")print("1 - Calculer un terme de la suite ")print("2 - Forme explicite suite (Un en fonction de n)")print("3 - Forme de recurence suite (Un+1 en fonction de Un)")print("4 - Variation de la suite ")print("5 - Somme dans la suite ")print("")choix=input("Tu veux faire quoi : ")ifchoix=="1":U=int(input("Tu veux quelle U ( Quelle rang ) :"))resultat=valeur1*(r**(U-rang1))print(resultat)elifchoix=="3":print("Un est une suite geometrique de raison ",r,"et de premier terme U",rang1," = ",valeur1," donc elle admet une forme de recurence du type :")print("")print("Un+1 = Un * q = Un * ",r)elifchoix=="2":ifrang1>0:print("Un est une suite geometrique de raison ",r,"et de premier terme U",rang1," = ",valeur1," donc elle admet une forme explicite du type :")print("")print("Un = ",valeur1,"*",r,"**( n - ",rang1,")")print("Un = ",valeur1,"*",r,"**n/",r**rang1)else:print("Un = ",valeur1,"*",r,"**n")elifchoix=="4":print("Un est une suite geometrique de raison ",r,"et de premier terme U",rang1," = ",valeur1," donc ")ifr>1andvaleur1>0:print("la suite est croissante car q = ",r," > 0 et U",rang1," = ",valeur1,"> 0 ")elifr>1andvaleur1<0:print("la suite est décroissante car q = ",r," > 0 et U",rang1," = ",valeur1,"< 0 ")elif0<r<1andvaleur1>0:print("la suite est decroissante car 1 > q = ",r," > 0 et U",rang1," = ",valeur1,"> 0 ")elifr>1andvaleur1<0:print("la suite est croissante car 1 > q = ",r," > 0 et U",rang1," = ",valeur1,"< 0 ")else:print("Las suite n'est pas monotone car q = ",r," < 0")elifchoix=="5":rang1somme=int(input("Rang du premier terme de la somme : "))rangmoin1somme=int(input("Rang du dernier terme de la somme : "))nb_terme=rangmoin1somme-rang1somme+1u1somme=valeur1*(r**(rang1somme-rang1))umoin1somme=valeur1*(r**(rangmoin1somme-rang1))print("S = U",rang1somme,"*(1-",r,"**",nb_terme,")/(1 - ",r,")")print("S = ",u1somme,"*(1-",r,"**",nb_terme,")/(1 - ",r,")")print("S = ",u1somme*(1-r**nb_terme)/(1-r))
During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:
Ensure the proper functioning of the site (essential cookies); and
Track your browsing to send you personalized communications if you have created a professional account on the site and can be contacted (audience measurement cookies).
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.