We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

# Project Euler #225: Tribonacci non-divisors

# Project Euler #225: Tribonacci non-divisors

Contest ends in

#### Sort by

recency

#### |

#### 24 Discussions

#### |

Please Login in order to post a comment

Hints:

What is

`'S mod N'`

when N is a divisor of S?Learn that modulo arithmetic means:

`(a + b + c) mod N == (a mod N + b mod N + c mod N) mod N`

Do you need to calculate the full values of large tribonacci numbers?

A non-divisor cannot go on forever without repeating. Can you detect a cycle?

Let me know if these give away too much!

according to the example the first term which is not divisible by any term in series is 13 next is 23 and third term is 27 but how did he say that first term is 27

first of all we need to know till how many terms do we need to check but they didn't mention it naaaa....

How many terms needs to generate to check for the divisibility? I didn't see it mentioned anywhere. Please help!

Scanner obj = new Scanner(System.in); int t1= obj.nextInt(); int t2 = obj.nextInt(); int t3 = obj.nextInt(); // int k = obj.nextInt(); int d=t3+t1+t2; int x=3; int[] a = new int[100000]; for(int i=5;i<100000;i++) { a[i] = d; t1=t2; t2=t3; t3=d;

What's wrong in this?