+
    åûj##  ã                   óô   € ^ RI HtHtHtHtHtHtHtHtH	t	H
t
HtHtHtHtHtHt ^RIHtHt ^ RIHt ^ RIHt ^ RIt^ RIHt R tR tR	 t]! ^^.4      R
 R l4       tR R lt]! RRRR7      RR l4       t R# )é    )ÚfzeroÚfrom_intÚfrom_rationalÚfoneÚfhalfÚbitcountÚto_intÚmpf_mulÚmpf_divÚmpf_subÚmpf_addÚmpf_sqrtÚmpf_piÚmpf_cosh_sinhÚmpf_cosÚmpf_sin)Ú_sqrt_mod_prime_powerÚis_quad_residue)Ú
deprecated)Úrecurrence_memoN©Úcountc                  ó`  € Rp ^ .V ,          s ^.V ,          s\        V R,          4      ^,           p\        ^V4       FM  p\         V,          ^ 8X  g   K  \        W",          W4       F   p\         V,          ^ 8X  g   K  V\         V&   K"  	  KO  	  \        ^V 4       F‘  p\         V,          ^ 8X  d   V\         V&   V^,
          \        V&   K0  \         V,          pW$,          pWT,          ^ 8X  d   \        V,          V,          \        V&   Ko  \        V,          V^,
          ,          \        V&   K“  	  R# )é
   ç      à?Né † )Ú_factorÚ_totientÚintÚrange)ÚmaxnÚlimÚiÚjÚxÚys         ÚUC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\sympy\ntheory\partitions_.pyÚ_prer(      sç   € Ø€Dàˆc�$�h€GØˆs�4�x€HÜ
ˆd�C�i‹.˜1Õ
€CÜ�1�cŽ]ˆÜ�1�:˜Ž?Ü˜1�3 Ö(�Ü˜1•: –?Ø!"”G˜A“Jó )ñ ô
 �1�dŽ^ˆÜ�1�:˜Œ?ØŒG�A‰JØ˜A�#ŒH�Q‰KÙÜ�A�JˆØ�DˆØ�5�AŒ:Ü" 1�+ a�-ŒH�Q‹Kä" 1�+ q¨1¥uÕ-ŒH�Q‹Kó ó    c                óJ  € V^8X  d   \         # Tp^ p\        V,          pW5,          ^ 8X  d   W5,          pV^,          pK   W,          p^^V ,          ,
          p\        V4      pV^8X  Ed0   V^8X  dß   ^V,          p	W—V	,          ,           pV\        ^	V^,
          V	4      ,          V	,          p\	        V^V^,           4      ^ ,          p
\        \        \        ^V
,          4      W‚4      \        V	4      V4      p\        \        \        RV,          ^V
^,          ,
          ,          4      \        \        V4      V4      V4      \        W²4      V4      # V^8X  Ed	   ^V,          p	W—V	,          ,           pV^8”  d*   V\        ^@V^,          ^,
          V	4      ,          V	,          p\	        V^V^,           4      ^ ,          p
\        \        \        ^V
,          4      W‚4      \        V	4      V4      p\        \        \        ^RV^,           ,          ,          ^^V
^,          ,          ,
          ,          4      \        \        V^,          4      V4      V4      \        W²4      V4      # WV,          ,           pV^,          R9   d   RM^pWu,          ^ 8X  d7   V^8X  d*   \        \        V4      \        \        V4      V4      V4      # \        # \        Wu4      '       g   \        # WT^,
          ,          V^,
          ,          pV\        RV^,
          V4      ,          p\	        WuV4      ^ ,          p
\        \        \        ^V
,          4      W‚4      \        V4      V4      p\        \        \        ^V,          4      \        \        V4      V4      V4      \        W²4      V4      # V^8w  g	   V^8¼  Ed2   \        P                  ! V^4      \        P                  ! V^4      rþ^Wï,          ,          pWô,          V ,          V^,          ^,
          V,          ,           \        WF,          V,          V,          \        V,          ^,
          V4      ,          V,          pWä,          V ,          V^,          ^,
          V,          ,           \        WC,          V,          V,          \        V,          ^,
          V4      ,          V,          p\        \!        VW24      \!        VWb4      V4      # V^8X  d¸   ^V ,          ^,           \        ^€\        V,          ^,
          V4      ,          V,          p^V ^,
          V^,          ^,
          ^,          ,
          V^,          ,          ^,          ,           ^,          p\        \        \        R4      \!        VW24      V4      \!        VWb4      4      # ^V ,          ^,           \        ^ \        V,          ^,
          V4      ,          V,          p^W^,          ^,
          ^,          ,
          ^,          ,           ^,          p\        \!        VW24      \!        VWb4      V4      # )z{Compute the inner sum in HRR formula [1]_

References
==========

.. [1] https://msp.org/pjm/1956/6-1/pjm-v6-n1-p18-p.pdf

i@  éÿÿÿÿ)é   é   )r   r   r   Úpowr   r   r
   r   r   r   r   r   r   ÚmathÚgcdr   Ú_a)ÚnÚkÚprecÚk1ÚeÚpÚk2ÚvÚpiÚmodÚmÚargÚjacobi3Ú_phiÚd1Úd2Ún1Ún2s   &&&               r'   r1   r1   "   sä  € ð 	ˆA„vÜˆà	
€BØ	€AÜ��
€AØ
�&�AŒ+Ø
�ˆØ	ˆQ�ŠØ	
�€BØ	ˆBˆq�D�€AÜ	�‹€Bà	ˆQ…wà�Œ6Ø�A•#ˆCØ˜#•g•ˆAØ”3�q˜!˜a�% Ó%Õ%¨Õ,ˆAÜ% a¨¨A°­EÓ2°1Õ5ˆAÜœ'Ü˜˜1�“˜ró)Ü*2°3«-¸ó?ˆCäœ7Ü˜"˜q� ! q¨1¥u¥+Õ.Ó/Üœ !› dÓ+¨Tó3ô ˜Ó" Dó*ð *ð ��6Ø�A•#ˆCØ˜#•g•ˆAØ�1ŒuØ”s˜2˜q !�t a�x¨Ó-Õ-°Õ4�Ü% a¨¨A°­EÓ2°1Õ5ˆAÜœ'¤(¨1¨Q­3£-°Ó:Ü˜“˜tó%ˆCäœ7Ü˜˜B ! a¥%�=�¨!¨a°°Qµ­i­-Õ8Ó9Üœ ! Q¥$›¨Ó.°ó6ô ˜Ó" Dó*ð *ð �A•�IˆØ˜B� &Ô(‘"¨aˆØ�5�AŒ:Ø�AŒvÜÜ˜WÓ%ÜœX a›[¨$Ó/°ó7ð 7ô ˆLÜ˜q×$Ò$ÜˆLØ�q•5�z˜1˜q�5Õ!ˆØŒs�3˜˜q� !Ó$Õ$ˆÜ! !¨Ó*¨1Õ-ˆÜÜ”H˜Q˜q�S“M 2Ó,Ü�Q‹K˜óˆô ”wÜ�Q�w•YÓÜ”X˜a“[ $Ó'¨ó/ô �CÓ ó&ð 	&ð
 	ˆA„v��a•Ü—’˜"˜bÓ!¤4§8¢8¨B°Ó#3ˆBØ�•�KˆØ�t�A�v˜˜Q� � R�Õ'Ü�•�R•˜•
œH R�L¨1Õ,¨bÓ1õ2Ø57õ8ˆà�t�A�v˜˜Q� � R�Õ'Ü�•�R•˜•
œH R�L¨1Õ,¨bÓ1õ2Ø57õ8ˆä”r˜"˜bÓ'¬¨B°Ó)9¸4Ó@Ð@ØˆA„vØ��s�Q�wœ˜C¤¨"¥°Õ!1°2Ó6Õ6¸"Õ<ˆØ�A˜•E˜R �U Q�Y¨�NÕ*¨R°­UÕ3°qÕ8Õ8¸AÕ=ˆÜ”wÜ�R‹LÜˆr�2Ó˜dó$ô ˆr�2Óóð 	ð ˆQ�3��7”C˜œH R�L¨1Õ,¨bÓ1Õ
1°RÕ	7€BØ
ˆq˜•E˜A•I •>Õ! QÕ&Õ
&¨!Õ	+€BÜ”2�b˜"Ó#¤R¨¨BÓ%5°tÓ<Ð<r)   c           	     ót  € \        V4      p\        V4      p\        W1V4      p\        \        V 4      \	        ^^V4      V4      p\        Wr4      p\        \        Wh4      V4      w  rš\        \        W4      \        \        WG4      V4      V4      p\        \        Wi4      \        W¨V4      V4      p\        W¼4      # )zx
Compute the sinh term in the outer sum of the HRR formula.
The constants sqrt(2/3*pi) and sqrt(8) must be precomputed.
)r   r   r   r   r   r   r   r
   )r2   r$   r4   Úsq23piÚsqrt8r:   ÚaÚbÚcÚchÚshÚDÚEs   &&&&&        r'   Ú_drN   y   s¡   € ô
 	�‹€AÜ	�‹€BÜ�˜4Ó €AÜ”˜“œ]¨1¨b°$Ó7¸Ó>€AÜ�Ó€AÜœ7 1›=¨$Ó/�F€BÜÜ�ÓÜ”˜Ó! 2Ó&¨ó	.€Aô 	”˜“¤¨¨tÓ 4°dÓ;€AÜ�1‹=Ðr)   c                ó0   € V ^8„  d   QhR\         R\         /# ©é   r2   Úreturn©r   )Úformats   "r'   Ú__annotate__rU   Œ   s   € ÷ ñ ”cð ¤Cñ r)   c                ó  € ^ p^ p\        4        Fs  pV^V,          ^,           ,          pW,
          pV^ 8  d    V# W,          pWT^,           ,          p^ V8:  d   WaV,          ,          pY$^,          '       d   V) MT,          pKu  	  V# )z_Calculate the partition function P(n)

Parameters
==========

n : int
    nonnegative integer

r   )r2   Úprevr9   Úpentar#   ÚnpÚss   &&     r'   Ú_partition_recr[   ‹   s…   € ð 	
€AØ€EÜŽWˆØ��1•�q•ÕˆØ�YˆØ�Œ6Øð €Hð �HˆØ
�!�e�ˆà�Œ7Ø�b•�MˆAØ	�q—5”5ˆa‰R˜aÕŠñ ð €Hr)   c                ó0   € V ^8„  d   QhR\         R\         /# rP   rS   )rT   s   "r'   rU   rU   ¦   s   € ÷ J0ñ J0”#ð J0œ#ñ J0r)   c           	     ó”  aaa€ V ^ 8  d   ^ # V R8:  d!   V \         P                  4       ,
          ^F8  g!   \         P                  4       ^8X  d   V R8  d   \        V 4      # R\        4       9  d   \        4        \	        \
        P                  ^V ,          R,          R,          ,          \
        P                  ! ^V ,          4      ,
          \
        P                  ! ^
4      ,          ^,           4      \
        P                  ! ^
4      ,          p\	        VR,          ^d,           4      ;r#^,\
        P                  ^,          ,          ^á\
        P                  ! ^4      ,          ,          o\
        P                  \
        P                  ! ^4      ,          ^K,          o\
        P                  \
        P                  ! R	4      ,          oVVV3R lp\        ^	\
        P                  ! V R,          4      4      pV! W4      R8  g   Q hV^(8”  d   V! W4      R8  d   V^,          pK  TpV^,          pWV,
          ^8”  d0   WV,           ^,          pV! W4      ;pR8  d   TpK/  VR8¼  g   K8  TpK<  Tp	V	R
8”  d   \        R4      h\        p
\        \        \!        ^^V4      V4      \#        V4      V4      p\        \%        ^4      V4      p\'        ^V	4       FV  p\)        WV4      p\+        WW;V4      p\-        V
\        Wï4      V4      p
\/        \1        \3        V4      4      4      ^2,           pKX  	  \	        \3        \-        V
\4        V4      4      4      # )zGCalculate the partition function P(n)

Parameters
==========

n : int

i@ i@8  r   g      @r   gš™™™™™ñ?c                 óâ   <€ \         P                  pSV! V4      ,          SV! W^,
          ,          4      ,          \         P                  ! SV! V 4      ,          V,          4      ,          ,           # )é   )r/   ÚsqrtÚsinh)r2   ÚNr`   Úc1Úc2Úc3s   && €€€r'   Ú_MÚ_partition.<locals>._MÏ   sH   ø€ Ü�y‰yˆØ‘$�q“'�z˜B™t A¨1¥u¥I›Õ.¬t¯yªy¸¹DÀ»G½ÀA½Ó/FÕFÕFÐFr)   zInput too biggUUUUUUå?r   )r[   Úcache_lengthÚglobalsr(   r   r/   r:   ÚlogÚlog2r`   ÚmaxÚceilÚ
ValueErrorr   r
   r   r   r   r   r    r1   rN   r   r   Úabsr	   r   )r2   Úpbitsr4   r7   rf   ÚbigÚsmallrb   ÚerÚMrZ   rE   rF   ÚqrG   Údrc   rd   re   s   &               @@@r'   Ú
_partitionrw   ¦   s~  ú€ ð 	ˆ1„uÙØ	ˆWŒ˜œ^×8Ñ8Ó:Õ:¸RÔ?Ü×'Ñ'Ó)¨QÔ.°1°v´:ô ˜aÓ Ð Øœ›	Ô!ÜŒäÜ�‰��1•�R•˜#•ÕÜ�Š��1•‹õ	Ü—x’x “|õ$à&'õ(ó )ô 	�	Š	�"‹õ€Eô �5˜•9˜s•?Ó#Ð#€Dð
 
ŒD�G‰G�Q�J�˜œDŸIšI a›LÕ(Õ	)€BÜ	�‰”—’˜1“Õ	˜bÕ	 €BÜ	�‰”—’˜3“Õ	€B÷Gô ˆa”—’˜1˜c�6Ó"Ó
#€CÙˆa‹:˜ÔÐÐØ
�Œ(‘r˜!“z CÔ'Ø��	ŠØ€EØ
��'€CØ
�+˜Œ/Ø�[˜1ÕˆÙ�Q“(ˆNˆB˜cÔ!ØŠCØ�3ŽYØŠEØ€Að 	ˆ5„yÜ˜Ó)Ð)ô 	€AÜ”Xœm¨A¨q°!Ó4°aÓ8¼&À»)ÀQÓG€FÜ”X˜a“[ !Ó$€EÜ�1�aŽ[ˆÜˆq�Q‹KˆÜˆq�Q Ó&ˆÜ�A”w˜q“} dÓ+ˆô ”Sœ ›“^Ó$ rÕ)Šñ ô Œv”g˜a¤¨Ó-Ó.Ó/Ð/r)   zpThe `sympy.ntheory.partitions_.npartitions` has been moved to `sympy.functions.combinatorial.numbers.partition`.z1.13z%deprecated-ntheory-symbolic-functions)Údeprecated_since_versionÚactive_deprecations_targetc                ó   € ^ RI Hp V! V 4      # )aÆ  
Calculate the partition function P(n), i.e. the number of ways that
n can be written as a sum of positive integers.

.. deprecated:: 1.13

    The ``npartitions`` function is deprecated. Use :class:`sympy.functions.combinatorial.numbers.partition`
    instead. See its documentation for more information. See
    :ref:`deprecated-ntheory-symbolic-functions` for details.

P(n) is computed using the Hardy-Ramanujan-Rademacher formula [1]_.


The correctness of this implementation has been tested through $10^{10}$.

Examples
========

>>> from sympy.functions.combinatorial.numbers import partition
>>> partition(25)
1958

References
==========

.. [1] https://mathworld.wolfram.com/PartitionFunctionP.html

)Ú	partition)Ú%sympy.functions.combinatorial.numbersr{   )r2   ÚverboseÚfunc_partitions   && r'   Únpartitionsr   ó   s   € õB RÙ˜!ÓÐr)   )F)!Úmpmath.libmpr   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   Úresidue_ntheoryr   r   Úsympy.utilities.decoratorr   Úsympy.utilities.memoizationr   r/   Ú	itertoolsr   r(   r1   rN   r[   rw   r   © r)   r'   Ú<module>r†      s‘   ð÷@÷ @÷ @÷ @ó @÷ DÝ 0Ý 7ã Ý ò.ò.U=ònñ$ �!�Q�Óôó ðõ4J0ñZ ð tàØBôDóó	Dòr)   