1
$\begingroup$

$a_{n,3}$

$1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,\cdots \cdots $

$a_{n,5}$

$1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,\cdots \cdots $

$a_{n,7}$

$1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,\cdots \cdots $

$\vdots $

$a_{n,2k+1}$

$1,\cdots \cdots\cdots \cdots,1,\cdots \cdots\cdots \cdots,\overbrace{1,\cdots \cdots\cdots \cdots}^{2k+1},1,\cdots \cdots\cdots \cdots,1,\cdots \cdots$

I found $a_{n,k}= \left \lfloor \left | \cos\frac{\pi (n-1)}{2k+1} \right | \right \rfloor$ but this term include abs and floorfucntion.

I mean i want the General Term without abs and floorfucntion.(plus sum)

Any hints will be appreciated, thank you.

  • 1
    If your computing environment is the sort of computing environment where `TRUE` is 1 and `FALSE` is 0 (C, for instance), then joriki's answer becomes even more practical...2011-07-17

3 Answers 3

3

The following is a technically correct answer to the question, though that depends on what kind of technician you are. The answer is quite close to the OP's proposal. Let
$f(n,k)=\sin^2\left(\frac{\pi(n-1)}{2k+1}\right).$

Let $g(n,k)=0^{f(n,k)}.$

Then, with a few largish caveats, $g(n,k)$ does the job.

Explanation: The issue, of course, is what do we mean by $0^0$? In calculus courses it is best to consider $0^0$ to be undefined. That is, however, not a universal convention.

For example, according to the IEEE floating point standard 754-2008 for the operation pow, $0^0=1$, and $0$ to a positive power is $0$. A Wikipedia article (what else?) tells me that many computer languages implement this standard. A few desultory tests with the Google calculating utility seem to show that it also implements the standard.

Added: The procedure will break down for very large $k$, because of implementation details of the IEEE standard. We can delay the breakdown by using a function that goes to $0$ more slowly than $\sin^2$ near integer multiples of $\pi$. But since presumably the question is not motivated by practical considerations, I will not suggest such modifications.

  • 0
    @ks0830: No problem, I wrote it up for fun. In your answer involving $\cos$, you can square instead of using absolute value, thereby having only one operation you don't approve of instead of two. With the standard continuous real functions, one cannot do better than one except by using mathematically suspect quirks of computer implementation.2011-07-17
5

$a_{n,j}=\frac1j\sum_{k=0}^{j-1}\mathrm e^{2\pi\mathrm i(n-1)k/j}$

If you want to avoid the summation, you can apply the formula for a geometric sum to get

$a_{n,j}=\frac1j\frac{1-\mathrm e^{2\pi\mathrm i(n-1)}}{1-\mathrm e^{2\pi\mathrm i(n-1)/j}}\;.$

This isn't actually defined for $n=1$, but the limit for $n\to1$ is the value you want.

  • 0
    This is neat. In fact you could apply fourier analysis to all sorts of continuous or smooth functions extending the values given to the real numbers. And if limits are allowed there are other formulations which would work as 'closed formulae' but which would probably not be useful computationally.2011-07-16
4

$a_{n,j}=\delta_{1,n \,\bmod\,j}$

  • 1
    @ks0830: We can try -- I've never done that before -- I've entered the mathematics chat room at http://chat.stackexchange.com/rooms/36/mathematics now.2011-07-16