Let T(n) be the number of necklace triplets (a, b, c) such that a, b and c are positive integers, and b ≤ n.
For example, T(1) = 9, T(20) = 732 and T(3000) = 438106.
Find T(1 000 000 000).
necklace(1000000000) should return 747215561862.
testString: assert.strictEqual(necklace(1000000000), 747215561862, 'necklace(1000000000) should return 747215561862.');
```