Sum the odd square numbers less than N Write a program or function to output the sum of the odd square numbers (OEIS #A016754) less than an input n.
The first 44 numbers in the sequence are:
1, 9, 25, 49, 81, 121, 169, 225, 289, 361, 441, 529, 625, 729, 841, 961, 1089, 
1225, 1369, 1521, 1681, 1849, 2025, 2209, 2401, 2601, 2809, 3025, 3249, 3481, 
3721, 3969, 4225, 4489, 4761, 5041, 5329, 5625, 5929, 6241, 6561, 6889, 7225, 7569

The formula for the sequence is a(n) = ( 2n + 1 ) ^ 2.
Notes

Your program's behaviour may be undefined for n &lt; 1 (that is, all valid inputs are &gt;= 1.)

Test cases
1 =&gt; 0
2 =&gt; 1
9 =&gt; 1
10 =&gt; 10
9801 =&gt; 156849
9802 =&gt; 166650
10000 =&gt; 166650
Jelly, 6 bytes

½Ċ|1c3


Try it online! or verify all test cases.

Background

For all positive integers k, we have 1² + 3² + ⋯ + (2k - 1)² = k(2k - 1)(2k +1) ÷ 3.

Since there are m C r = m! ÷ ((m-r)!r!) r-combinations of a set of m elements, the above can be calculated as (2k + 1) C 3 = (2k + 1)2k(2k - 1) ÷ 6 = k(2k - 1)(2k + 1) ÷ 3.

To apply the formula, we must find the highest 2k + 1 such that (2k - 1)² &lt; n. Ignoring the parity for a moment, we can compute the highest m such that (m - 1)² &lt; n as m = ceil(srqt(n)). To conditionally increment m if it is even, simply compute m | 1 (bitwise OR with 1).

How it works

½Ċ|1c3  Main link. Argument: n

½       Compute the square root of n.
 Ċ      Round it up to the nearest integer.
  |1    Bitwise OR with 1 to get an odd number.
    c3  Compute (2k + 1) C 3 (combinations).