About 19,400 results
Open links in new tab
  1. Simplifying recursive formula in geometric (or arithmetic) series

    Mar 27, 2019 · I am trying to implement a recursive function, but that is too computationally intensive. I think there are certain ways to simplify recursive functions into geometric (or arithmetic) series. If i...

  2. python - recursive geometric sequence - Stack Overflow

    Dec 8, 2020 · I need to write a recursive function geometric_recursive The formula is My Problem is that i can't stop the loop. Also the function should have the same parameters as the iterative version def …

  3. Geometric series sum recursively in Python - Stack Overflow

    Mar 4, 2023 · def recursiveSum(a, r, n): if n == 0: return a else: return a + recursiveSum(a, r, n - 1) * r It's also worth noting that there exists a closed form for the sum of the first n terms in a geometric series, …

  4. Creating a recursive geometric sequence function python

    Mar 28, 2018 · With any recursive function you need a base case and a general (recursion) case. Let's start with your current code to get the inputs, but instead of calculating the value immediately we'll …

  5. Computational complexity of Fibonacci Sequence - Stack Overflow

    I understand Big-O notation, but I don't know how to calculate it for many functions. In particular, I've been trying to figure out the computational complexity of the naive version of the Fibonacci

  6. Python program to calculate harmonic series - Stack Overflow

    May 11, 2013 · Function Prototype: harmonic_recursive(n) Function Parameters: n - the n-th Harmonic number Base case: If n equals 1 return 1. Recur step: If not the base case, call harmonic_recursive …

  7. Why is the complexity of computing the Fibonacci series 2^n and not …

    Oct 16, 2013 · I am trying to find complexity of Fibonacci series using a recursion tree and concluded height of tree = O(n) worst case, cost of each level = cn, hence complexity = n*n=n^2 How come it is …

  8. Calculating the Harmonic Mean and Geometric Mean Recursively

    Aug 21, 2012 · Does anyone have a good example on how to calculate the Harmonic Mean and Geometric Mean Recursively. Is it possible to use a Tail Recursive function? Thanks!

  9. Using recursion to find sum of geometric sequence - Stack Overflow

    Jan 21, 2018 · You don't need variable sum. Let's look the last call of recursion. The parameters will be sumGeo(32, 2, 1) and you will return sum + sumGeo() and that is 0 + 32. And that will be the value …

  10. Basic Java Recursion Method - Stack Overflow

    Feb 9, 2012 · I am having a lot of trouble with this basic recursion problem in java; any pointers would be great. "Write a static recursive method to print out the nth term of the geometric sequence: 2, 6,...