trying to use recursion to find the possibilities of two known numbers adding to N : <p>I have this recursion problem that I spent hours on but unable to transform some of my thoughts into code. I have a problem where I need to build a function that tries to fit 3's and 1's into a given number(n). I try to get n from user but then I cannot go further. Basically I need to calculate the possibility of 3's and 1's that add up to n. I know that a constant solution is that I can fit 1n times into n. </p>

<p>Any help is appreciated. Thanks in advance</p>

<pre><code>public static void main(String[] args) {
    // TODO code application logic here

    Scanner ask = new Scanner(System.in);
    System.out.println("input number: ");
    int n = ask.nextInt(); 

}

public static int getPossibility(int n, int k, int p) {

    if (n == 0) {
        return 0;
    } else if (n / p == n ) {
        return n;
    } else {
        int ctr = n;
        for (int i = 1; i &lt;= n; i++) {

            ctr += getPossibility(n, k - 1, p - 1) ;
        }
   return ctr;
    } 
}
</code></pre>

<p>}</p>
