$$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 $$


$$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 $$


$$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 $$


$$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.

  • 2
    $\begingroup$ I am curious about why you want something other than the usual $a_{n,k}=1$ if $n \equiv 1 \pmod{2k+1}$, $a_{n,k}=0$ otherwise? Pure curiosity? A programming problem in a very linited setting? If we knew more about the reason, a more satisfying answer might be possible. $\endgroup$ – André Nicolas Jul 16 '11 at 21:59
  • 1
    $\begingroup$ 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... $\endgroup$ – J. M. is a poor mathematician Jul 17 '11 at 2:10

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

  • $\begingroup$ Judging from the OP's own suggestion his indexing begins from $n=1$ as opposed $n=0$. Also, it looks like you want to look at the remainder of $n$ modulo $j$ - not the other way round. $\endgroup$ – Jyrki Lahtonen Jul 16 '11 at 10:33
  • $\begingroup$ Thanks, you're right on both accounts -- I edited accordingly. $\endgroup$ – joriki Jul 16 '11 at 10:44
  • 1
    $\begingroup$ @ks0830: We can try -- I've never done that before -- I've entered the mathematics chat room at chat.stackexchange.com/rooms/36/mathematics now. $\endgroup$ – joriki Jul 16 '11 at 10:51

$$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.

  • $\begingroup$ Then I suggest you give a clear and complete definition of "closed form" in the question. $\endgroup$ – joriki Jul 16 '11 at 10:21
  • $\begingroup$ 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. $\endgroup$ – Mark Bennet Jul 16 '11 at 20:02

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

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.

  • $\begingroup$ Therfore, as always, what $0^0$ "is" completely depends on the environment... :) $\endgroup$ – J. M. is a poor mathematician Jul 17 '11 at 1:52
  • $\begingroup$ @J.M.: Absolutely. There is no way otherwise to produce that kind of discontinuity with the narrow range of "allowed" functions. $\endgroup$ – André Nicolas Jul 17 '11 at 2:04
  • $\begingroup$ ...which reminds me, your proposal is quite related to ones by Libri and Möbius, as recounted here (see p. 406 onwards). (added: now that I can upvote, I gave a +1 for "But since presumably the question is not motivated by practical considerations, I will not suggest such modifications." :D ) $\endgroup$ – J. M. is a poor mathematician Jul 17 '11 at 2:09
  • $\begingroup$ @J.M.: Thanks for the link, it is always a pleasure to read Knuth. $\endgroup$ – André Nicolas Jul 17 '11 at 2:12
  • $\begingroup$ @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. $\endgroup$ – André Nicolas Jul 17 '11 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.