Search code examples
pythonjupyter-notebooksequencelimit

Finding the limit of a sequence in python, jupyter notebook


I’ve got a sequence a(n)=(5-77sin(n)+8n^2)/(1-4n^2) and I’m trying to find a candidate for the limit of this sequence. How do I do this? I’ve tried using a code below but that didn’t work so any ideas?enter image description here


Solution

  • As discussed here, for sympy you need to use ** for raising to a power and not ^.

    This will work:

    from sympy import limit, sin, Symbol, oo
    from sympy.abc import x ,n
    r = limit((5-77*sin(n)+8*n**2)/(1-4*n**2),n , oo)
    r
    

    Adaptation of OP code based on: