<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <pre><code class="language-nim">
# This Nim code generates a random list of integers,
# calculates their sum and average, and then filters
# the list to keep only the numbers greater than the average.

import math, random

# Function to generate a random list of integers
proc generateRandomList(size: int): seq[int] =
  result = newSeq[int](size)
  for i in 0..&lt;size:
    result[i] = random(100)

# Function to calculate the sum of a list
proc calculate