1

Solving one problem I find two formulas, first for odd: $$f(m,n)=\frac{n^m-n}{m}+n$$ and second for even numbers: $$f(m,n)=\frac{n^m-n^2}{m}+\frac{n(n+1)}{2}$$ Then for static $m$ and dynamic $n$ we have: $$f(2,n)=1,3,6,10,15,21,28,36,44\cdots$$ $$f(3,n)=1,4,11,24,45,76,119,176\cdots$$ $$f(4,n)=1,6,24,70,165,336,616,1044\cdots$$ $$f(5,n)=1,8,51,208,629,1560,3367,6560\cdots$$ $$f(6,n)=1,14,130,700,2635,7827,19684\cdots$$

Can I have formula for all natural numbers, if I know it separately for even and for odd?

If I made some mistakes, sorry for my English.

user514787
  • 1,475
  • Someone here might be able to provide a single formula that did the job, but I suspect it would be much harder to read than your definition that uses cases even and odd explicitly. So why would you want or need such a formula? In a computer program you'd probably just code the cases. – Ethan Bolker Jan 25 '18 at 17:08
  • @EthanBolker, thank you for comment! Single formula can be helpful to solve the problem, in which I interested. I'm not a genius, but I sure, that through some time I will completely understand formula, no matter how extremely hard it would be. This problem (not only finding single formula) interest me more, than two years. – user514787 Jan 25 '18 at 17:16

1 Answers1

1

$$f(m,n)=\frac{(-1)^{m+1}+1}{2}\left(\frac{n^m-n}{m}+n \right)+ \frac{(-1)^{m}+1}{2}\left(\frac{n^m-n^2}{m}+\frac{n(n+1)}{2} \right)$$

Leox
  • 8,120