suites1re.py

Created by jean-luc-poncin

Created on October 10, 2021

634 Bytes

Corrigés des programmes Python de certains exercices du chapitre “Suites” de spécialité de 1re générale


from math import *

# Ex. 2.15 et 2.16
def sr(n):
  u=6
  for k in range(1,n+1):
    u=3*u-4
  return(u)

# Ex. 2.23
# seuil suite croissante lim + inf
def seuil(A):
  n=0
  u=0
  while(u<A):
    n=n+1
    u=n**3+n
  return(n)

# Ex. 2.25
# liste 1ers termes suite recurrente
def lt(n):
  u=10
  liste=[10]
  for k in range(1,n+1):
    u=2*u+5
    liste.append(u)
  return(liste)

# Ex. 2.26
def lst(n):
  u=4
  liste=[4]
  for k in range(1,n+1):
    u=3*u-10
    liste.append(u)
  return(liste)

# Ex. 2.27
# somme des 1ers termes 
# d'une suite 
def som(n):
  s=0
  for i in range(1,n+1):
    s=s+i**2
  return(s)

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.