Expansions for harmonic numbers at general rational arguments n + p/q
Expansions for harmonic numbers at general rational arguments n + p/q

In [2]: harmonic(2/S(3))
Out[2]: harmonic(2/3)

In [3]: expand_func(_)
(0, 2, 3)
Out[3]: -log(6) + 2*Sum(log(sin(_k*pi/3))*cos(4*_k*pi/3), (_k, 1, 1)) + sqrt(3)*pi/6 + 3*Sum(1/(3*_k + 2), (_k, 0, 0))

In [4]: pprint(_)
              1                                            0
             ____                                         ____
             ╲                                            ╲
              ╲      ⎛   ⎛k⋅π⎞⎞    ⎛4⋅k⋅π⎞     ___         ╲      1
               ╲  log⎜sin⎜───⎟⎟⋅cos⎜─────⎟   ╲╱ 3 ⋅π        ╲  ───────
-log(6) + 2⋅   ╱     ⎝   ⎝ 3 ⎠⎠    ⎝  3  ⎠ + ─────── + 3⋅   ╱  3⋅k + 2
              ╱                                 6          ╱
             ╱                                            ╱
             ‾‾‾‾                                         ‾‾‾‾
            k = 1                                        k = 0

In [5]: _.doit()
Out[5]: -log(6) - log(sqrt(3)/2) + sqrt(3)*pi/6 + 3/2

In [6]: simplify(_)
Out[6]: log(sqrt(3)/9) + sqrt(3)*pi/6 + 3/2

In [7]: _.n()
Out[7]: 0.758981249114944

In [8]: harmonic(2/S(3))
Out[8]: harmonic(2/3)

In [9]: _.rewrite(polygamma)
Out[9]: -3*log(3)/2 + sqrt(3)*pi/6 + 3/2

In [10]: _.n()
Out[10]: 0.758981249114944

Mitchkoens/sympy,souravsingh/sympy,ahhda/sympy,Titan-C/sympy,atreyv/sympy,Vishluck/sympy,jerli/sympy,abloomston/sympy,kumarkrishna/sympy,Vishluck/sympy,Mitchkoens/sympy,yashsharan/sympy,pbrady/sympy,Arafatk/sympy,shipci/sympy,maniteja123/sympy,madan96/sympy,hargup/sympy,AkademieOlympia/sympy,postvakje/sympy,Sumith1896/sympy,mcdaniel67/sympy,kevalds51/sympy,saurabhjn76/sympy,AunShiLord/sympy,kumarkrishna/sympy,Sumith1896/sympy,AkademieOlympia/sympy,MridulS/sympy,drufat/sympy,moble/sympy,VaibhavAgarwalVA/sympy,rahuldan/sympy,yukoba/sympy,jaimahajan1997/sympy,lindsayad/sympy,ga7g08/sympy,grevutiu-gabriel/sympy,oliverlee/sympy,saurabhjn76/sympy,shipci/sympy,Titan-C/sympy,sahmed95/sympy,aktech/sympy,madan96/sympy,abhiii5459/sympy,mafiya69/sympy,jamesblunt/sympy,skidzo/sympy,Mitchkoens/sympy,shikil/sympy,Arafatk/sympy,iamutkarshtiwari/sympy,maniteja123/sympy,wyom/sympy,shikil/sympy,aktech/sympy,kaushik94/sympy,asm666/sympy,emon10005/sympy,shikil/sympy,wanglongqi/sympy,yashsharan/sympy,shipci/sympy,atreyv/sympy,atsao72/sympy,Gadal/sympy,Curious72/sympy,madan96/sympy,drufat/sympy,iamutkarshtiwari/sympy,kevalds51/sympy,kaichogami/sympy,bukzor/sympy,hargup/sympy,kumarkrishna/sympy,sampadsaha5/sympy,ChristinaZografou/sympy,debugger22/sympy,diofant/diofant,Gadal/sympy,mcdaniel67/sympy,liangjiaxing/sympy,VaibhavAgarwalVA/sympy,vipulroxx/sympy,wanglongqi/sympy,farhaanbukhsh/sympy,cccfran/sympy,pandeyadarsh/sympy,wanglongqi/sympy,yukoba/sympy,atreyv/sympy,mcdaniel67/sympy,garvitr/sympy,grevutiu-gabriel/sympy,pbrady/sympy,rahuldan/sympy,meghana1995/sympy,MridulS/sympy,beni55/sympy,lindsayad/sympy,ahhda/sympy,abloomston/sympy,jbbskinny/sympy,wyom/sympy,bukzor/sympy,liangjiaxing/sympy,farhaanbukhsh/sympy,debugger22/sympy,mafiya69/sympy,Gadal/sympy,kaichogami/sympy,postvakje/sympy,sahilshekhawat/sympy,meghana1995/sympy,sahmed95/sympy,Designist/sympy,jaimahajan1997/sympy,beni55/sympy,abloomston/sympy,Davidjohnwilson/sympy,garvitr/sympy,Sumith1896/sympy,postvakje/sympy,toolforger/sympy,drufat/sympy,oliverlee/sympy,skirpichev/omg,abhiii5459/sympy,pbrady/sympy,toolforger/sympy,kaushik94/sympy,Designist/sympy,aktech/sympy,moble/sympy,AunShiLord/sympy,garvitr/sympy,ga7g08/sympy,kevalds51/sympy,cccfran/sympy,abhiii5459/sympy,souravsingh/sympy,jaimahajan1997/sympy,Davidjohnwilson/sympy,chaffra/sympy,dqnykamp/sympy,MechCoder/sympy,ahhda/sympy,mafiya69/sympy,chaffra/sympy,Curious72/sympy,Shaswat27/sympy,iamutkarshtiwari/sympy,yashsharan/sympy,sahilshekhawat/sympy,Curious72/sympy,beni55/sympy,maniteja123/sympy,Titan-C/sympy,grevutiu-gabriel/sympy,wyom/sympy,dqnykamp/sympy,saurabhjn76/sympy,kaushik94/sympy,cswiercz/sympy,lindsayad/sympy,ChristinaZografou/sympy,sampadsaha5/sympy,debugger22/sympy,asm666/sympy,Designist/sympy,oliverlee/sympy,bukzor/sympy,atsao72/sympy,jamesblunt/sympy,MechCoder/sympy,sunny94/temp,sahilshekhawat/sympy,Vishluck/sympy,AunShiLord/sympy,sunny94/temp,MridulS/sympy,ChristinaZografou/sympy,pandeyadarsh/sympy,emon10005/sympy,souravsingh/sympy,dqnykamp/sympy,cccfran/sympy,vipulroxx/sympy,skidzo/sympy,jerli/sympy,skidzo/sympy,pandeyadarsh/sympy,MechCoder/sympy,Arafatk/sympy,sampadsaha5/sympy,jerli/sympy,yukoba/sympy,atsao72/sympy,toolforger/sympy,VaibhavAgarwalVA/sympy,Shaswat27/sympy,kaichogami/sympy,sahmed95/sympy,cswiercz/sympy,rahuldan/sympy,sunny94/temp,liangjiaxing/sympy,emon10005/sympy,jbbskinny/sympy,jamesblunt/sympy,ga7g08/sympy,hargup/sympy,asm666/sympy,vipulroxx/sympy,cswiercz/sympy,chaffra/sympy,moble/sympy,Shaswat27/sympy,AkademieOlympia/sympy,Davidjohnwilson/sympy,jbbskinny/sympy,farhaanbukhsh/sympy,meghana1995/sympy