Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.maple > #1283

No harmony with the harmonics.

Newsgroups comp.soft-sys.math.maple
Date 2017-10-26 10:04 -0700
Message-ID <77089042-3be5-4d92-b6c4-4c8ca99c31dd@googlegroups.com> (permalink)
Subject No harmony with the harmonics.
From Peter Luschny <peter.luschny@gmail.com>

Show all headers | View raw


seq(harmonic(-3/8+(1/8)*(-1)^(n+1), 1-n), n=1..6);
-1/4, harmonic(-1/2, -1), harmonic(-1/4, -2), harmonic(-1/2, -3), ...

A rather dull answer. Let's try with evalf:

seq(evalf(harmonic(-3/8+(1/8)*(-1)^(n+1), 1-n)), n=1..6);
-.2500000000, -.1250000000, -0.1562500000e-1, 0.1562500000e-1, ...

It would be so much nicer to get rational numbers!
Table[HarmonicNumber(-3/8+(1/8)*(-1)^(n+1), 1-n), {n,1,6}]
-1/4, -1/8, -1/64, 1/64, 5/1024, -1/128, ...

Now let's try a slight variant:

seq(harmonic(-7/8+(1/8)*(-1)^(n+1), 1-n), n=1..6);
Error, (in harmonic) numeric exception: division by zero

The docs say: "When the first parameter is a negative integer 
an exception (error) is raised, signaling the event 'division_by_zero'." 

Hmm, no problem here:
Table[HarmonicNumber(-7/8+(1/8)*(-1)^(n+1), 1-n), {n,1,6}]
-3/4, 0, 1/64, 0, -5/1024, 0, ...

So let's see if the solution of MMA makes sense and add the two variants.

Table[(1/2)*4^n*(-HarmonicNumber(-7/8+(1/8)*(-1)^(n+1), 1-n)
      + HarmonicNumber(-3/8+(1/8)*(-1)^(n+1), 1-n)), {n,1,11}]

1, -1, -1, 2, 5, -16, -61, 272, ...

OMG, already Leonhard knew this!

Back to comp.soft-sys.math.maple | Previous | NextNext in thread | Find similar


Thread

No harmony with the harmonics. Peter Luschny <peter.luschny@gmail.com> - 2017-10-26 10:04 -0700
  Re: No harmony with the harmonics. acer <maple@rogers.com> - 2017-10-26 11:46 -0700
    Re: No harmony with the harmonics. acer <maple@rogers.com> - 2017-10-27 10:10 -0700

csiph-web