The definition you have for a Lucas number is recursive, i.e. to calculate the Nth lucas number, you already need to know N-1st and N-2nd.
A naive way to do it would be
public int lucas(int N) {
if( N == 0 ) return 2;
if( N == 1 ) return 1;
return lucas(N-1) + lucas(N-2);
}
However, you only need to print the numbers, right? Then it's pretty simple.
int L2 = 2;
int L1 = 1;
for( int i = 2; i <= N; i++ ) {
int L = L1 + L2;
print(L);
L2 = L1;
L1 = L;
}
The idea is to keep the last two numbers you need to calculate the next two numbers, always at hand.
PS: Lucas , , . , , ( " " ).