// Goals of this code to teach infinite recursion
// Review:  static methods, polymorphic methods, debugging methods

import java.io.*;

public class Mystery {
	


// infinite recursion, possibly!
public static int mystery(int n) {

  System.out.println("mystery with n = " + n);
  if (n == 1) {
    return(1);
  }
  else {
    return n + mystery(n - 2);
  }
}



	

public static void main ( String[] args ) {
	
	
	// infinite recursion if number is even, how can we fix this?
	int answer = mystery(7);
	System.out.println("yeah it finished, the answer is:  " + answer);
	// if no answer -- you may get stack overflow message
	
	
	
}

}
	
