Write a public static method named static long tribonacci


programming language is JAVA:

Write a public static method named static long tribonacci(int n, long a, long b, long c) that returns the nth "tribonacci number" when initialially called with tribonacci(n, 0, 1, 1).

Tribonacci numbers start with 0, 1, 1, for tribonacci(0), tribonacci(1), tribonacci(2).

Then each subsequent number is the sum or the previous three numbers.

That means the first ten elements in the sequence are 0, 1, 1, 2, 4, 7, 13, 24, 44, 81.

Solution Preview :

Prepared by a verified Expert
Computer Engineering: Write a public static method named static long tribonacci
Reference No:- TGS02901396

Now Priced at $10 (50% Discount)

Recommended (94%)

Rated (4.6/5)