Subdivide-Sum Sequence Consider the digits of any integral base above one, listed in order. Subdivide them exactly in half repeatedly until every chunk of digits has odd length:
Base    Digits              Subdivided Digit Chunks
2       01                  0 1
3       012                 012
4       0123                0 1 2 3
5       01234               01234
6       012345              012 345
7       0123456             0123456
8       01234567            0 1 2 3 4 5 6 7
9       012345678           012345678
10      0123456789          01234 56789
11      0123456789A         0123456789A
12      0123456789AB        012 345 678 9AB
...                                                        
16      0123456789ABCDEF    0 1 2 3 4 5 6 7 8 9 A B C D E F
...

Now, for any row in this table, read the subdivided digit chunks as numbers in that row's base, and sum them. Give the result in base 10 for convenience.
For example...

for base 3 there is only one number to sum: 0123 = 123 = 510
for base 4 there are 4 numbers to sum: 04 + 14 + 24 +  34 = 124 = 610
base 6: 0126 + 3456 = 4016 = 14510
base 11: 0123456789A11 = 285311670510

Challenge
Write a program that takes in an integer greater than one as a base and performs this subdivide sum procedure, outputting the final sum in base 10. (So if the input is 3 the output is 5, if the input is 6 the output is 145, etc.)
Either write a function that takes and returns an integer (or string since the numbers can get pretty big) or use stdin/stdout to input and output the values.
The shortest code in bytes wins.
Notes

You may use any built in or imported base conversion functions.
There is no upper limit to the input value (besides a reasonable Int.Max). The input values don't stop at 36 just because &quot;Z&quot; stops there.

p.s. this is my fiftieth question :)
Python, 82 78
def f(b):G=b^b&amp;b-1;return sum(b**(b/G-i-1)*(G*i+(G-1)*b/2)for i in range(b/G))

Huh?

The number of digit groups that the subdivison yields, G, is simply the greatest power of two that divides the number of digits (i.e. the base), b.
It's given by G = b ^ (b &amp; (b - 1)), where ^ is bitwise-XOR.
If you're familiar with the fact that n is a power of two iff n &amp; (n - 1) = 0 then it should be pretty easy to see why.
Otherwise, work out a few cases (in binary) and it'll become clear.

The number of digits per group, g, is simply b / G.

The first digit group, 012...(g-1), as a number in base b, is .

The next group, g(g+1)...(2g-1), as a number in base b, is the sum
.

More generally, the n-th group (zero-based), as a number in base b, an, is .

Recall that there are G groups, hence the sum of all groups is



which is what the program calculates.