1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
TEA [102]
3 years ago
13

g Write a recursive function, seq_of_mult_3, which models the recursive function that generates the sequence = {2, 6, 18, 54, 16

2 ...}. The function should take in the one input parameter that represents the nth value to calculate.
Computers and Technology
1 answer:
Harlamova29_29 [7]3 years ago
7 0

Explanation:

In computer programming, a recursive function is one that calls itself and breaks when a certain condition is met, otherwise it keeps on running.

IN the given scenario, the recursive formula would be;

an = 3an - 1

Here n is nth term, an is the An value of function for nth term and An-1 is for one previous value.

global

int nth_val

int curr_val

int output = 2

def recursive(nth_val):

{

While ( curr_val < nth_val)

          Print (Output)

           Output = Output x 3;

curr_val++;

recursive(nth_val):

break

}

Int main void

{

Int number;

number = input("Please input the nth number of series: ")

nth_val = number

recursive(nth_value):

}

You might be interested in
What of the following can a cell contain? A number a word a function of these
EastWind [94]
A function of these
8 0
3 years ago
Type your response in the box. Imagine you purchased a new computer and you plan to install one operating system and a few appli
faltersainse [42]

Answer:

Yes

Explanation:

As long as they were legally copied

5 0
2 years ago
Read 2 more answers
Explain the steps you take to complete an Internet search. Do you use a particular search engine every time or do you alternate?
Levart [38]
While proceeding with an internet search I find google to be the best source considering its high accuracy. When asking your question keep it minimal yet descriptive. After having found a few sources cross reference them with each other and throw out any sources that may hold false information. After having narrowed them down look to see how recent they are because since their publication new information may have been brought to light. Look to see if they have links to where they got their information. All in all just be diligent.
5 0
3 years ago
If a wheel is adjustable to move caster forward is considered which type
Yuki888 [10]

Maybe axle i think so

8 0
4 years ago
Given a line of text as input, output the number of characters excluding spaces, periods, or commas. If the input is:
enot [183]

In python 3.8:

print(len([x for x in input("Enter your text: ") if x not in "., "]))

I hope this helps!

3 0
3 years ago
Other questions:
  • Processing is handled by the computer’s central processing unit (cpu).​ <br> a. True <br> b. False
    6·1 answer
  • Write a method named lastFirst that accepts a string as its parameter representing a person's first and last name. The method sh
    13·1 answer
  • Which of the following is NOT a view which can be chosen for a presentation?
    15·1 answer
  • which of these should be reportable diseases to protect public health? A. Obesity B. Diabetes C.Measles D. Lung Cancer
    10·2 answers
  • Which of the following is NOT true about functions? They go below the main program in the source code file. They do a single tas
    10·1 answer
  • which of the following is the term used for a set of programs that acts as an interface between the applications that are runnin
    7·1 answer
  • Convert the following C program to C++.
    9·1 answer
  • Computers were originally invented to
    12·2 answers
  • How can using Prezi software for a presentation allow the presenter to better respond to audience needs?
    10·1 answer
  • The US government appropriates less than one million dollars in funding each year to STEM education programs. True False
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!