Questo codice restituisce sempre 1, invece dovrebbe restituire un valore che varia in base ad n: un valore inserito dall'utente. Mi potete aiutare per risolvere il problema???

AlgoritmiMatrici.identita(2);-->crea una matrice identità 2X2
AlgoritmiMatrici.prodotto(a,b);-->esegue il prodotto tra due matrici a e b
codice:
public static int matrice1(int n)
  {
  	int idn[][]=AlgoritmiMatrici.identita(2);
  	int m[][]=idn;
  	
  	potenzamatrice(m, n-1);
  
  	return m[0][0];
  }
  public static void potenzamatrice(int[][] m, int n)
  {
    	if(n>1)
	{
		potenzamatrice(m, n/2);
		m=AlgoritmiMatrici.prodotto(m,m);
	}	
	if(n%2==1)
	{
		int a[][]={{1,1},{1,0}};
		m=AlgoritmiMatrici.prodotto(m,a);
	}
 }