program recurrence
  implicit none

  integer, parameter :: dp    = kind(0.0d0)
  integer, parameter :: n_max = 60

  integer  :: n
  real(dp) :: x(n_max)

  x(1) = 1/3.0_dp
  x(2) = 1/12.0_dp

  do n = 3, n_max
     x(n) = 2.25_dp * x(n-1) - 0.5_dp * x(n-2)
     print *, n, x(n), solution(n)
  end do

contains

  function solution(n) result(val)
    integer, intent(in) :: n
    real(dp)            :: val

    val = 4.0_dp**(1-n) / 3.0_dp
  end function solution

end program recurrence
