The base case is true, since
1² = 1
1 (6×1² - 3×1 - 1) / 2 = 1
Assume the equality holds for n = k, so that
1² + 4² + 7² + … + (3k - 2)² = k (6k ² - 3k - 1) / 2
Then for n = k + 1, we would have
1² + 4² + 7² + … + (3k - 2)² + (3 (k + 1) - 2)² = k (6k ² - 3k - 1) / 2 + (3 (k + 1) - 2)²
… = (6k ³ - 3k ² - k) / 2 + (3k + 3 - 2)²
… = (6k ³ - 3k ² - k) / 2 + (3k + 1)²
… = (6k ³ - 3k ² - k) / 2 + 9k ² + 6k + 1
… = (6k ³ - 3k ² - k + 18k ² + 12k + 2) / 2
… = (6k ³ + 15k ² + 11k + 2) / 2
We want to end up with
(k + 1) (6 (k + 1)² - 3 (k + 1) - 1) / 2
which means the numerator should have a factor of k + 1; it does, since
(6k ³ + 15k ² + 11k + 2) / (k + 1) = 6k ² + 9k + 2
This quotient should be equal to
6 (k + 1)² - 3 (k + 1) - 1
and it is; you can confirm this by expanding:
6 (k ² + 2k + 1) - 3 (k + 1) - 1 = 6k ² + 9k + 2
and we're done.