Multiply-by-11 Series Pattern in JavaScript

Beginner
⏱️ 5 min read
📚 Updated: Aug 2025
🎯 2 Code Examples
Loops + multiplication

What You’ll Learn

How to print the number pattern 1, 11, 121, 1331, 14641 in JavaScript.

Each line is generated by multiplying the previous value by 11, which is a simple and memorable loop exercise.

⭐ Pattern Output

For lines = 5, the pattern looks like this:

Output
1
11
121
1331
14641
1

Complete JavaScript Program

We start with 1, print it, then multiply by 11 for the next line. This version uses BigInt so it scales safely if you increase the line count.

JavaScript
const lines = 5;
let value = 1n;

for (let i = 1; i <= lines; i++) {
  console.log(String(value));
  value *= 11n;
}

🧠 How It Works

1

Set the number of lines

lines = 5 controls how many values to print.

Setup
2

Start from 1

value = 1n is the first printed line.

Initial value
3

Print the current value

We convert BigInt to string: String(value), then print it.

Output
4

Multiply by 11 for the next line

value *= 11n; transforms 1 into 11, then 121, then 1331…

Rule
=

Simple multiply-by-11 pattern

One loop, one multiplication rule, clean output.

2

Variation — Browser (document.write) Version

Print the same values directly in an HTML page using document.write:

HTML
<!DOCTYPE html>
<html>
<body>
<script>
var lines = 5;
var value = 1n;

for (var i = 1; i <= lines; i++) {
  document.write(String(value));
  document.write("<br>");
  value = value * 11n;
}
</script>
</body>
</html>

💡 Tips for Enhancement

Try These

  • Increase lines to print more values (BigInt helps prevent overflow)
  • Compare the output with Pascal’s triangle for the first few rows
  • Use arrays to store the sequence for later use in your program
  • Format values with commas for readability if you print many lines

Avoid

  • Expecting the pattern to match Pascal’s triangle for large lines (carries appear)
  • Using Number for huge values if you increase lines a lot (precision loss)
  • Mixing BigInt with Number in arithmetic without converting types

Key Takeaways

1

The sequence is generated by repeatedly multiplying by 11.

2

For a few lines, values resemble Pascal’s triangle rows.

3

BigInt helps you scale without losing precision.

4

This is an O(n) pattern: one loop, one print per line.

❓ Frequently Asked Questions

It keeps output clean and consistent. Some environments display BigInt with a trailing n when logged directly.
Yes for small line counts (like 5). Use Number and value *= 11. BigInt is recommended when values get large.
Roughly, the number of digits increases gradually as you multiply by 11. Growth is logarithmic in the value, but the values themselves grow exponentially.
Yes—the nth printed value (starting from 1) is \(11^{n-1}\).

Explore More JavaScript Number Patterns!

Next, try building Pascal’s triangle directly, then compare it with powers of 11 to see where the carry starts.

All Number Patterns →
Did you know?

The identity “powers of 11 resemble Pascal’s triangle” is a fun math trick for small rows, but it breaks once coefficients exceed 9 and carrying begins.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful