Question: /** * Determines whether the given string of text represents a * Lucas sequence , where the given text consists of integer * values separated
/** * Determines whether the given string of text represents a * Lucas sequence, where the given text consists of integer * values separated by arbitrary whitespace. A Lucas sequence * is any sequence of numbers in which each value (other than * the first and second) is the sum of the previous two values. * The Fibonacci sequence is one example of a Lucas sequence. * Another one would be "-2 1 -1 0 -1 -1 -2 -3 -5 -8". * This method returns true if the sequence has fewer than 3 numbers. * The behavior is undefined if the provided string contains any non-numeric * values. * @param text * string of text (possibly empty) containing numbers separated by whitespace * @return * true if the given sequence of numbers is a Lucas sequence, * false otherwise */ public static boolean isLucasSequence(String text) { // TODO return false; } Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
