Hello,
I am trying to create a custom object mesh directly in some C# code from scratch for a personal project of mine, and I've come across an issue that I can boil down to a simple maths problem as goes the following:
f(0) = (1 + 3 + 1) + (1)
f(1) = (1 + 3 + 5 + 3 + 1) + (1 + 3 + 1)
f(2) = (1 + 3 + 5 + 7 + 5 + 3 + 1) + (1 + 3 + 5 + 3 + 1)
f(3) = (1 + 3 + 5 + 7 + 9 + 7 + 5 + 3 + 1) + (1 + 3 + 5 + 7 + 5 + 3 + 1)
Or I've noticed an alternate form of the exact same problem:
f(0) = 3*1 + 3
f(1) = 4*1 + 3*3 + 5
f(2) = 4*1 + 4*3 + 3*5 + 7
f(3) = 4*1 + 4*3 + 4*5 + 3*7 + 9
Can anyone think of some formula that could help? I've tried looking up the sum of odd numbers and flipping it to get the following:
f(x) = (2^x + 1)^2 + 4^x
This formula works for the first half of those above formulas. But for some reason the second half is being elusive to me and I'm too sleep deprived from work to put more brain power into this at this point in time.
I'm certain it's probably a fairly simple formula involving the sum of odd numbers that I've just missed.
Any help would be greatly appreciated!
P.S. I wasn't quite sure where such a question would go, so I figured the intermediate level maths would be suitable? Feel free to correct me
I am trying to create a custom object mesh directly in some C# code from scratch for a personal project of mine, and I've come across an issue that I can boil down to a simple maths problem as goes the following:
f(0) = (1 + 3 + 1) + (1)
f(1) = (1 + 3 + 5 + 3 + 1) + (1 + 3 + 1)
f(2) = (1 + 3 + 5 + 7 + 5 + 3 + 1) + (1 + 3 + 5 + 3 + 1)
f(3) = (1 + 3 + 5 + 7 + 9 + 7 + 5 + 3 + 1) + (1 + 3 + 5 + 7 + 5 + 3 + 1)
Or I've noticed an alternate form of the exact same problem:
f(0) = 3*1 + 3
f(1) = 4*1 + 3*3 + 5
f(2) = 4*1 + 4*3 + 3*5 + 7
f(3) = 4*1 + 4*3 + 4*5 + 3*7 + 9
Can anyone think of some formula that could help? I've tried looking up the sum of odd numbers and flipping it to get the following:
f(x) = (2^x + 1)^2 + 4^x
This formula works for the first half of those above formulas. But for some reason the second half is being elusive to me and I'm too sleep deprived from work to put more brain power into this at this point in time.
I'm certain it's probably a fairly simple formula involving the sum of odd numbers that I've just missed.
Any help would be greatly appreciated!
P.S. I wasn't quite sure where such a question would go, so I figured the intermediate level maths would be suitable? Feel free to correct me