1

Edit: I'm looking for a continuous function. Note also that $f(x)$ is continuous, but it depends on it's summation limit being rounded up (ceil). I changed the limit, previously it was not clear how many terms would there be.

$\lvert x \rvert$ is the absolute value function
$\lfloor x \rfloor$ denotes the floor function

This is a triangle wave function with period of 2 $$T(x) = \left\lvert x - 2\left\lfloor\frac {x + 1}{2}\right\rfloor\right\rvert$$

What I am trying to do is generalizing the summation, because the it's limit may not be an integer. I know the the summation can be expressed without iteration, like $\sum_{k = 1}^{n} k$ can be generalized to $ \frac {n(n+1)}{2}$.
My attempts have not produced correct results. $$f(x) = xT(x) + \sum_{k = 1}^{\lceil x/2 \rceil} (x + T(x + 1) - 2k + 1)(x + T(x + 1) - 2k)$$ $f(x)$ calculates the following sequence:
$1\cdot2 + 3\cdot4 + \dots + (n-1)\cdot n$
For example:
$f(5) = 1\cdot2 + 3\cdot4 + 5$
$f(6) = 1\cdot2 + 3\cdot4 + 5\cdot6$

This sequence alternates between addition and multiplication (or can be interpreted as so). If $n$ is odd it will be added unpaired, and if it is even it will be added multiplied by $(n - 1)$. It is always the last number.

Describing more formally:
$m \in \Bbb Z$
$f(2m) = 1\cdot2 + 3\cdot4 + \dots + (2m - 1)(2m)$
$f(2m + 1) = 1\cdot2 + 3\cdot4 + \dots + (2m + 1) $

Edit 2: It turns out the closed-form expression is: $$f(x) = xT(x) + \left\lceil \frac x2 \right\rceil\left[x(x + 1) + T(x + 1)\left(2\left(x - \left\lceil \frac x2 \right\rceil\right) + T(x + 1) - 1\right) + \left\lceil \frac x2 + 1 \right\rceil \left(-1 - 2x + \frac 23 \left(2 \left\lceil \frac x2 \right\rceil + 1\right)\right)\right]$$

Thank you for the help and tips.

  • 1
    Hi, welcome to Math SE. Hint:$$\begin{align}\sum_{k=1}^nk&=\frac12n(n+1),\\sum_{k=1}^nk^2&=\frac16n(n+1)(2n+1).\end{align}$$ – J.G. Oct 25 '24 at 20:02
  • Thanks I'll try that – PlayerAmigo1273 Oct 25 '24 at 20:06
  • It is is possible that no solution exists. Actually it exists look at this post https://math.stackexchange.com/a/2365249/763728. – EDX Oct 26 '24 at 12:36
  • Look also here https://en.wikipedia.org/wiki/Weierstrass_factorization_theorem#Existence_of_entire_function_with_specified_zeroes – EDX Oct 26 '24 at 12:43

2 Answers2

1

I believe your sum can be represented in the form $$\begin{cases} \sum _{k=1}^m\left(2k-1\right)\left(2k\right)&n=2m{,}\ \ m\in \mathbb{N}\\ \sum _{k=1}^m\left(2k-1\right)\left(2k\right)+n&n=2m+1{,}\ \ m\in \mathbb{N} \end{cases}$$

Expanding and using the identity $$\sum _{k=1}^nk^2=\frac{n\left(n+1\right)\left(2n+1\right)}{6}$$ From this we get the solutions to be: $$\begin{cases} \frac{1}{12}n\left(n+2\right)\left(2n-1\right)&n=2m{,}\ m\in \mathbb{N}\\ \frac{1}{12}\left(n-1\right)\left(n+1\right)\left(2n-3\right)+n&n=2m+1{,}\ m\in \mathbb{N} \end{cases}$$ It's my first time post on here, please go easy on me.

  • Your definition works, but I forgot to mention I'm looking for a continuous function. – PlayerAmigo1273 Oct 26 '24 at 11:05
  • 1
    Presumably when @user3257842 said $x$ they meant $n$. – J.G. Oct 26 '24 at 14:46
  • $$\left(\frac{1 + \cos(\pi ; n )}{2} \right) (\frac{1}{12}n\left(n+2\right)\left(2n-1\right)) + \ + \left(\frac{1 - \cos(\pi;n )}{2}\right) (\frac{1}{12}\left(n-1\right)\left(n+1\right)\left(2n-3\right)+n)$$ – user3257842 Oct 26 '24 at 14:47
0

So we need $f(2m)=1 \cdot 2 + 3 \cdot 4 + \cdots (2m-1)\cdot(2m) = \sum_{k=1}^{m} (2k-1)(2k)$
$f(2m) = \sum_{k=1}^{m} (2k-1)(2k)=\sum_{k=1}^{m} 4k^2-2k= 4\sum_{k=1}^{m} k^2 -2\sum_{k=1}^{m} k=4(\frac{1}{6})m(m+1)(2m+1)-2(\frac12)m(m+1)=\frac43 m^3+m^2-\frac43m$
$f(2m)=\frac43 m^3+m^2-\frac43m$ and for $f(2m+1)$ use $f(2m+1)=f(2m)+2m+1$

Rithvick
  • 124