Question: please use r studio and provide the code. Part3) Functions - 20 points Using a for loop or a while loop, write your own Fl
please use r studio and provide the code.

Part3) Functions - 20 points Using a for loop or a while loop, write your own Fl function, sum_of_first_N_odd_squares (n), that returns the sum of the squares of the first n odd numbers. For example, if n = 5, the first five odd numbers are 1, 3, 5, 7, 9 and the required result is 12+32+52+72+92=165 Test your function as follows: > sum_of_first_N_odd_squares(2) [1] 10 > sum_oF_First_N_odd_squaresC5) [1] 165 > sum_of_First_N_odd_squares(10) [1] 1330 Now, without using any loop, write your own Fl function, sum_of_first_N_odd_squares_V2 (n), that returns the sum of the squares of the first n odd numbers. Test your function as follows: > sum_of_first_N_odd_squares_V2(2) [1] 19 > sum_of_first_N_odd_squares_V2(5) [1] 165 > sum_of_ftrst_N_odd_squares_V2(1@) [1] 1330
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
