The phrase "find the output when the input is n" is one of the most repeated instructions in algebra, computer science, and discrete mathematics, yet it trips up learners more often than almost any other task. And whether n appears inside a function like f(n) = 3n + 7, as the position of a term in a sequence, or as the argument passed into a loop, the underlying skill is the same: trace a rule forward from a general input to a general output. This guide walks through exactly how to do that, with worked examples, the reasoning behind each step, and the traps that cause wrong answers And that's really what it comes down to..
What the Question Is Really Asking
When a problem says "find the output when the input is n," it is almost never asking for a single number. The letter n is a placeholder for an arbitrary value, so the answer must also be an expression containing n Nothing fancy..
Consider the difference:
- f(4) = 3(4) + 7 = 19 → a specific output.
- f(n) = 3n + 7 → a general rule that produces the correct output for any input.
Recognizing this distinction is the first real step. Students who try to "solve for n" have misread the task; n is not an unknown to be uncovered, it is a parameter that stays in the answer.
The Function Machine Model
The clearest mental picture is a function machine. Numbers go in one side, the machine applies a fixed set of operations, and results come out the other side.
For f(n) = 3n + 7, the machine does three things in order:
- Multiply the input by 3.
- Add 7.
- Release the result.
Feeding in n instead of a number changes nothing about the machine. The output is simply the same sequence of operations performed on the symbol: 3n + 7 Took long enough..
This model matters because it separates the rule from the input. The rule is fixed; the input varies. That is precisely why functions are so useful in modeling real systems, from calculating taxi fares to predicting population growth.
Reading Function Notation Correctly
The notation f(n) can be misread in two ways, both wrong:
- It does not mean f times n.
- It does not mean "solve for n."
It means "the output of function f when the input is n.So " The letter inside the parentheses is the input; the whole expression is the output. So writing f(n) = n² − 4n is simply a complete sentence in mathematical shorthand: *the output equals the input squared, minus four times the input Worth keeping that in mind..
A Reliable Step-by-Step Method
Use this sequence every time, and the process becomes almost mechanical.
- Identify the rule. Locate the function definition, formula, recurrence, or code block that transforms input into output.
- Locate every occurrence of the input variable. In f(n) = 2(n + 1)², the input appears twice: once inside the parentheses and once as the base of the square.
- Substitute n into every position. Replace each input slot with n, keeping the structure intact.
- Apply the order of operations. Parentheses, then exponents, then multiplication and division, then addition and subtraction — remembered as PEMDAS.
- Simplify, but do not eliminate n. Combine like terms; leave the variable in place.
- Check with a test value. Substitute a convenient number such as n = 2 into both the original rule and your final expression. If the outputs match, the simplification is sound.
That last step is the one most learners skip, and it catches the majority of algebra errors instantly.
Worked Examples
Example 1: A Linear Function
Given f(n) = 5n − 2, find the output when the input is n.
The input is already n, so the output is 5n − 2. Nothing to compute — the task here is to confirm you understand that the general output is the rule itself. Testing with n = 3: 5(3) − 2 = 13, which matches.
This is where a lot of people lose the thread Small thing, real impact..
Example 2: A Quadratic Function
Given g(n) = (n + 3)², find the output Simple, but easy to overlook..
Square the entire quantity, not just the n:
- Correct: (n + 3)² = n² + 6n + 9
- Incorrect: n² + 9
The error above is the single most common mistake in this topic. Squaring a sum requires the middle term 2ab Turns out it matters..
Example 3: A Piecewise Function
A piecewise function uses different rules over different intervals:
- h(n) = n² if n < 0
- h(n) = 2n + 1 if n ≥ 0
Because n could be either negative or non-negative, the honest answer is stated in cases: the output is n² when n < 0 and 2n + 1 when n ≥ 0. You cannot collapse a piecewise rule into one expression without extra information about the input.
Example 4: A Recursive Sequence
For a sequence defined by a(n) = a(n − 1) + 4 with a(1) = 3, the output depends on the previous term. Unrolling the recursion gives the closed form:
- a(n) = 4n − 1
Verification: a(1) = 3, a(2) = 7, a(3) = 11 — all consistent. Converting a recursive definition into an explicit formula is often what "find the output" really demands.
Example 5: An Algorithm or Code Block
Suppose a function receives n and executes:
- Set total to 0.
- Repeat n times, adding 2 to total each pass.
- Return total.
Tracing the loop shows total increases by 2 on each of n iterations, so the output is 2n. This is algorithm tracing: simulating execution by hand with a symbolic input rather than a numeric one Simple as that..
The Reasoning Behind Why Substitution Works
Substitution is valid because a function is a mapping from a domain to a range. Each input