Javatpoint Logo
Javatpoint Logo

Additive Numbers in Java

In the realm of mathematics and computer science, certain number sequences possess intriguing properties that captivate the minds of enthusiasts and professionals alike. One such sequence is the additive sequence, a fascinating set of numbers that exhibit a remarkable property: each number in the sequence can be formed by the sum of two preceding numbers. In this section, we delve into the concept of additive numbers and explore how to implement them in Java.

What are Additive Numbers?

Additive numbers, also known as sum-additive sequences or Waring sequences, are sequences of integers where each number is the sum of two previous numbers in the sequence. Mathematically, if a and b are two consecutive numbers in the sequence, then the next number c is given by c= a + b.

The property leads to some intriguing patterns and characteristics within the sequence. Additive sequences have been studied extensively in the field of combinatorial mathematics and have applications in various areas such as number theory, cryptography, and even music composition.

Implementing Additive Numbers in Java

Now, let's explore how we can implement additive numbers in Java. We will start with a simple program to generate the first n terms of the additive sequence.

File Name:

In this Java program, we define a method generateAdditiveSequence that takes an integer n as input and returns a list containing the first n terms of the additive sequence. We then demonstrate the usage of this method in the main function by generating and printing the first 10 terms of the sequence.


First 10 terms of the additive sequence:
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]

Properties of Additive Sequences

Additive sequences possess several interesting properties that make them worthy of exploration. One such property is the relationship between consecutive terms in the sequence. As mentioned earlier, each term in the sequence is the sum of the two preceding terms. The property creates a recursive structure within the sequence, akin to the Fibonacci sequence.

Additionally, additive sequences exhibit exponential growth. The rate of growth depends on the initial terms of the sequence and the underlying mathematical properties governing the sequence's generation.


Additive numbers represent a captivating aspect of combinatorial mathematics, offering insights into recursive patterns and exponential growth. In this article, we've explored the concept of additive sequences and demonstrated how to implement them in Java. By delving into the properties and behavior of additive sequences, we gain a deeper appreciation for the elegance and complexity of mathematical structures embedded within seemingly simple number sequences. Whether for mathematical exploration, algorithmic analysis, or creative pursuits, additive numbers continue to intrigue and inspire curiosity in the minds of mathematicians, computer scientists, and enthusiasts alike.

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA