function a = r8to_dif2 ( n )

%*****************************************************************************80
%
%% R8TO_DIF2 sets the second difference as an R8TO matrix.
%
%  Discussion:
%
%    The R8TO storage format is used for a real Toeplitz matrix, which 
%    is constant along diagonals.  Thus, in an N by N Toeplitz matrix, 
%    there are at most 2*N-1 distinct entries.  The format stores the 
%    N elements of the first row, followed by the N-1 elements of the 
%    first column (skipping the entry in the first row).
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    24 September 2015
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the order of the matrix.
%
%    Output, real A(2*N-1), the R8TO matrix.
%
  a = zeros ( 2*n-1, 1 );

  a(1) = 2.0;
  a(2) = -1.0;
  a(n+1) = -1.0;

  return
end