function v = tribonacci2_eigen_right ( n )

%*****************************************************************************80
%
%% tribonacci2_eigen_right(): right eigenvectors of the TRIBONACCI2 matrix.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 May 2021
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the order of the matrix.
%
%  Output:
%
%    real V(N,N), the right eigenvectors.
%
  v = zeros ( n, n );

  if ( 3 <= n )

    [ alpha, beta, gamma ] = tribonacci_roots ( );

    p = 1.0;
    for i = 1 : n
      v(i,1) = p;
      p = p * alpha;
    end

    v(n,2:n-2)     = 1.0;
    
    p = 1.0;
    for i = 1 : n
      v(i,n-1) = p;
      p = p * beta;
    end

    p = 1.0;
    for i = 1 : n
      v(i,n) = p;
      p = p * gamma;
    end

  end

  return
end
