Question

A sequence is a list of numbers that are calculated based on a certain rule. For...

A sequence is a list of numbers that are calculated based on a certain rule. For instance, the progression described by the rule An = 2 ∗ n results in the numbers: 0 2 4 6 8 10 ··· 2 ∗ n. The sum of this sequence can be calculated as Sn = 0+2+4+6+8+10+···+2 ∗ n. Write a function that takes as input the number n and calculates the sum of the sequence up to the nth term (inclusive) for each sequence shown below.

• An = 1 n 2 , for n > 0 such that Sn = 1 1 + 1 4 + 1 9 + 1 16 +···+ 1 n 2 .

• An = (−1) n (n+1)! , for n ≥ 0 such that Sn = 1 1 − 1 2 + 1 6 − 1 24 +···+ (−1) n (n+1)!

Note: By default, Racket does not use floating point notation to do arithmetic. To force it to use floating point you have to write a #i in front of at least one number that is involved in the computation. You can also write your numbers as a floating point by writing 1.0 instead of 1.

Homework Answers

Answer #1

It is not mentioned in question ,In which language you want code, so I prefered python , over all other programming languages, beause python is very popular and very common.
if you want solution in any other language,then pls comment ...i will provide you solution asap :)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ARM Assembly Code The Fibonacci Sequence is a series of integers. The first two numbers in...
ARM Assembly Code The Fibonacci Sequence is a series of integers. The first two numbers in the sequence are both 1; after that, each number is the sum of the preceding two numbers. 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... For example, 1+1=2, 1+2=3, 2+3=5, 3+5=8, etc. The nth Fibonacci number is the nth number in this sequence, so for example fibonacci(1)=1, fibonacci(2)=1, fibonacci(3)=2, fibonacci(4)=3, etc. Do not use zero-based counting; fibonacci(4)is 3, not...
Claim: If (sn) is any sequence of real numbers with ??+1 = ??2 + 3?? for...
Claim: If (sn) is any sequence of real numbers with ??+1 = ??2 + 3?? for all n in N, then ?? ≥ 0 for all n in N. Proof: Suppose (sn) is any sequence of real numbers with ??+1 = ??2 + 3?? for all n in N. Let P(n) be the inequality statements ?? ≥ 0. Let k be in N and suppose P(k) is true: Suppose ?? ≥ 0. Note that ??+1 = ??2 + 3?? =...
Java please. Given a sequence of unsorted numbers, determine how badly out of order they are....
Java please. Given a sequence of unsorted numbers, determine how badly out of order they are. Write a program that, for any given sequence of unique natural numbers, will compute the 'distance' between that original ordering and the same set of numbers sorted in ascending order. The distance should be computed by calculating how far displaced each number is in the original ordering from its correct location in the sorted list and summing those results. For instance, given the list...
Write a Java program that gets a 4x4 array of numbers and that calculates the sum...
Write a Java program that gets a 4x4 array of numbers and that calculates the sum and average of numbers on the main diagonal, ie the diagonal that goes from the left corner down to the right corner. Examples of resulting programs are: Enter a 4x4 matrix row by row: 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 The sum of numbers in the diagonal is: 16 The average of numbers in...
IN C++ The Catalan numbers are an integer sequence Cn that appears in tree-enumeration problems. The...
IN C++ The Catalan numbers are an integer sequence Cn that appears in tree-enumeration problems. The first Catalan numbers for n = 1, 2, 3, ... are 1, 2, 5, 14, 42, 132, .... A formula generating Cn is: Cn=(1÷(n+1))=(2n)!÷(n+1)!n! Design two programs that communicate with shared memory using the Win32 API as outlined in Section 8.7.2. The producer process will generate the Catalan sequence and write it to a shared memory object. The consumer process will then read and...
Define a recursive rangeSum(from, to) method that calculates and prints the sum of numbers between the...
Define a recursive rangeSum(from, to) method that calculates and prints the sum of numbers between the two values inclusive. IN JAVA. OUTPUT rangeSum(1,5) -> 15 rangeSum(1,5) -> 1+2+3+4+5=15 rangeSum(-3,4) -> 4 rangeSum(-3,4) -> -3+-2+-1+0+1+2+3+4=4 rangeSum(-5, 7) -> 13 rangeSum(-5, 7) -> -5+-4+-3+-2+-1+0+1+2+3=-9 please write main method as well as output for three above methods.
In mathematical terms, the sequence Fn of Fibonacci numbers is 0, 1, 1, 2, 3, 5,...
In mathematical terms, the sequence Fn of Fibonacci numbers is 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, …….. Write a function int fib(int n) that returns Fn. For example, if n = 0, then fib() should return 0, PROGRAM: C
1 .Answer the following questions about the arithmetic sequence 2, 5, 8, 11, .... . Find...
1 .Answer the following questions about the arithmetic sequence 2, 5, 8, 11, .... . Find n if the series 2 + 5 + 8 + 11 + ⋯ + 119 = 2420. 2. Answer the following questions about the geometric sequence 3, 12, 48, 192. Which term in the sequence is 12288? 3. Find the sum of the series 106 + 103 + 100 + 97 + ⋯ − 41. 4.Find S7 and S∞ for the series 6 +...
1. Use mathematical induction to show that, ∀n ≥ 3, 2n2 + 1 ≥ 5n 2....
1. Use mathematical induction to show that, ∀n ≥ 3, 2n2 + 1 ≥ 5n 2. Letting s1 = 0, find a recursive formula for the sequence 0, 1, 3, 7, 15,... 3. Evaluate. (a) 55mod 7. (b) −101 div 3. 4. Prove that the sum of two consecutive odd integers is divisible by 4 5. Show that if a|b then −a|b. 6. Prove or disprove: For any integers a,b, c, if a ∤ b and b ∤ c, then...
In mathematics, the Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci...
In mathematics, the Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and characterized by the fact that every number after the first two is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, … The sequence Fn of Fibonacci numbers is defined by the recurrence relation: Fn = Fn-1 + Fn with seed values F1 = 1 F2 = 1 For more information on...