• No harmony with the harmonics.

    From Peter Luschny@21:1/5 to All on Thu Oct 26 10:04:02 2017
    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!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From acer@21:1/5 to Peter Luschny on Thu Oct 26 11:46:37 2017
    On Thursday, October 26, 2017 at 1:04:03 PM UTC-4, Peter Luschny wrote:
    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!


    I'm going to submit a bug report that this task is not much easier (AFAIK),


    L:=[seq(harmonic(-3/8+(1/8)*(-1)^(n+1), 1-n), n=1..6)];

    L := [-1/4, harmonic(-1/2, -1), harmonic(-1/4, -2),
    harmonic(-1/2, -3), harmonic(-1/4, -4), harmonic(-1/2, -5)]


    map(convert,L,compose,Zeta,elementary,LerchPhi,elementary);

    -1 -1
    [-1/4, -1/8, --, 1/64, 5/1024, ---]
    64 128

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From acer@21:1/5 to acer on Fri Oct 27 10:10:19 2017
    On Thursday, October 26, 2017 at 2:46:38 PM UTC-4, acer wrote:
    On Thursday, October 26, 2017 at 1:04:03 PM UTC-4, Peter Luschny wrote:
    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!


    I'm going to submit a bug report that this task is not much easier (AFAIK),


    L:=[seq(harmonic(-3/8+(1/8)*(-1)^(n+1), 1-n), n=1..6)];

    L := [-1/4, harmonic(-1/2, -1), harmonic(-1/4, -2),
    harmonic(-1/2, -3), harmonic(-1/4, -4), harmonic(-1/2, -5)]


    map(convert,L,compose,Zeta,elementary,LerchPhi,elementary);

    -1 -1
    [-1/4, -1/8, --, 1/64, 5/1024, ---]
    64 128

    Shorter [credit Thomas Richard] , but still not easy,

    L:=[seq(harmonic(-3/8+(1/8)*(-1)^(n+1), 1-n), n=1..6)]:

    map(convert,L,compose,LerchPhi,elementary);

    -1 -1
    [-1/4, -1/8, --, 1/64, 5/1024, ---]
    64 128

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)