Find the Punishment Number of an Integer

Given integer n, find the "punishment number" which is the sum of integers from 1 to n where the integer can be partitioned into parts whose sum equals a multiple of 3.

Examples
Input: 1
Output: 1
Hints

Find the Punishment Number of an Integer

Given integer n, find the "punishment number" which is the sum of integers from 1 to n where the integer can be partitioned into parts whose sum equals a multiple of 3.