+
    ‹°³jU  ã                   ój   € R t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	  ! R R]4      t
R tR	 tR
 tR# )z¦
The Schur number S(k) is the largest integer n for which the interval [1,n]
can be partitioned into k sum-free sets.(https://mathworld.wolfram.com/SchurNumber.html)
N)ÚS)ÚBasic)ÚFunction)ÚIntegerc                   ó:   a € ] tR t^t o Rt]R 4       tR tRtV t	R# )ÚSchurNumbera  
This function creates a SchurNumber object
which is evaluated for `k \le 5` otherwise only
the lower bound information can be retrieved.

Examples
========

>>> from sympy.combinatorics.schur_number import SchurNumber

Since S(3) = 13, hence the output is a number
>>> SchurNumber(3)
13

We do not know the Schur number for values greater than 5, hence
only the object is returned
>>> SchurNumber(6)
SchurNumber(6)

Now, the lower bound information can be retrieved using lower_bound()
method
>>> SchurNumber(6).lower_bound()
536

c           
     ó`  € VP                   '       dœ   V\        P                  J d   \        P                  # VP                  '       d   \        P                  # VP
                  '       d   VP                  '       d   \        R 4      h^^^^^^^^,^^ /pV^8:  d   \        W!,          4      # R# R# )zk should be a positive integerN)	Ú	is_Numberr   ÚInfinityÚis_zeroÚZeroÚ
is_integerÚis_negativeÚ
ValueErrorr   )ÚclsÚkÚfirst_known_schur_numberss   && Úa/home/luca/screen-checking/.venv/lib/python3.14/site-packages/sympy/combinatorics/schur_number.pyÚevalÚSchurNumber.eval'   sŠ   € à�;�;ˆ;Ø”A—J‘J‹Ü—z‘zÐ!Ø�y�yˆyÜ—v‘v�Ø—<—<�< 1§=§= =Ü Ð!AÓBÐBØ)*¨A¨q°!°Q¸¸A¸rÀ1ÀcÐ(JÐ%Ø�AŒvÜÐ8Õ;Ó<Ð<ñ ñ ó    c                ó*  € V P                   ^ ,          pV^8X  d   \        R4      # V^8X  d   \        R4      # VP                  '       d5   ^V P                  V^,
          4      P	                  4       ,          ^,
          # ^V,          ^,
          ^,          # )é    i  i�  )Úargsr   Ú
is_IntegerÚfuncÚlower_bound)ÚselfÚf_s   & r   r   ÚSchurNumber.lower_bound4   sr   € Ø�Y‰Y�q�\ˆà�Œ7Ü˜3“<ÐØ�Œ7Ü˜4“=Ð à�=�=ˆ=Ø�T—Y‘Y˜r A�vÓ&×2Ñ2Ó4Õ4°qÕ8Ð8Ø�2•˜•	˜1�}Ðr   © N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úclassmethodr   r   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r      s(   ø‡ € ñð4 ñ
=ó ð
=÷
ð 
r   r   c                 ó   € V \         P                  J d   \        R 4      hV ^ 8:  d   \        R4      hV ^8:  d   ^pM9\        P                  ! \        P
                  ! ^V ,          ^,           ^4      4      p\        V4      # )zInput must be finitez&n must be a non-zero positive integer.)r   r
   r   ÚmathÚceilÚlogr   )ÚnÚmin_ks   & r   Ú_schur_subsets_numberr0   A   sc   € àŒA�J‰JƒÜÐ/Ó0Ð0ØˆA„vÜÐAÓBÐBØ	
ˆaŒØ‰ä—	’	œ$Ÿ(š( 1 Q¥3¨¥7¨AÓ.Ó/ˆä�5‹>Ðr   c                óÚ  € \        V \        4      '       d   V P                  '       g   \        R4      h\	        V 4      pV ^8X  d   ^..pM"V ^8X  d   ^^..pMV ^8X  d   . RO.pM^^.^^..p\        V4      V8  dj   \        W 4      p\        \        V4      V ^,
          ^,          ^,           4       Uu. uF  p^V,          ^,           NK  	  ppVR;;,          V,          uu&   Ky  V# u upi )a  

This function returns the partition in the minimum number of sum-free subsets
according to the lower bound given by the Schur Number.

Parameters
==========

n: a number
    n is the upper limit of the range [1, n] for which we need to find and
    return the minimum number of free subsets according to the lower bound
    of schur number

Returns
=======

List of lists
    List of the minimum number of sum-free subsets

Notes
=====

It is possible for some n to make the partition into less
subsets since the only known Schur numbers are:
S(1) = 1, S(2) = 4, S(3) = 13, S(4) = 44.
e.g for n = 44 the lower bound from the function above is 5 subsets but it has been proven
that can be done with 4 subsets.

Examples
========

For n = 1, 2, 3 the answer is the set itself

>>> from sympy.combinatorics.schur_number import schur_partition
>>> schur_partition(2)
[[1, 2]]

For n > 3, the answer is the minimum number of sum-free subsets:

>>> schur_partition(5)
[[3, 2], [5], [1, 4]]

>>> schur_partition(8)
[[3, 2], [6, 5, 8], [1, 4, 7]]
zInput value must be a number)é   é   é   éÿÿÿÿ)Ú
isinstancer   r	   r   r0   ÚlenÚ_generate_next_listÚrange)r.   Únumber_of_subsetsÚsum_free_subsetsr   Úmissed_elementss   &    r   Úschur_partitionr=   O   sé   € ô^ �!”U×Ò A§K§K KÜÐ7Ó8Ð8ä-¨aÓ0ÐØˆA„vØ˜C˜5ÑØ	
ˆaŒØ ˜F˜8ÑØ	
ˆaŒÚ%˜;Ñà ˜F Q¨ FÐ+Ðä
ÐÓ
Ð"3Ô
3Ü.Ð/?ÓCÐÜ,1´#Ð6FÓ2GÈ!ÈAÍ#ÐPQÍÐTUÍÔ,VÓWÑ,V q˜1˜Q�3 Ÿ7˜7Ñ,VˆÐWØ˜× Õ/ÕàÐùò Xs   Â4C(c                 óè  € . pV  Fx  pV Uu. uF  qD^,          V8:  g   K  V^,          NK  	  ppV Uu. uF)  qD^,          ^,
          V8:  g   K  V^,          ^,
          NK+  	  ppWV,           pVP                  V4       Kz  	  \        \        V 4      ^,           4       Uu. uF*  p^V,          ^,           V8:  g   K  ^V,          ^,           NK,  	  p	pVP                  V	4       Tp V # u upi u upi u upi )r4   )Úappendr9   r7   )
Úcurrent_listr.   Únew_listÚitemÚnumberÚtemp_1Útemp_2Únew_itemr   Ú	last_lists
   &&        r   r8   r8   “   sÜ   € Ø€HãˆÙ)-Ó?©˜v¸µ¸Q±”(�&˜—(�(©ˆÐ?Ù-1ÓG©T 6¸AµXÀµ\ÀQÑ5F”,�&˜•(˜Q—,�,©TˆÐGØ•?ˆØ�‰˜Ö!ñ	 ô #(¬¨LÓ(9¸!Õ(;Ô"<ÓMÑ"<˜QÀÀ!ÅÀaÅÈ1Á”��1•�q—�Ñ"<€IÐMØ‡O�O�IÔØ€LàÐùò @ùÚGùò Ns!   ŒC% C%³C*ÁC*ÂC/Â:C/)r%   r+   Ú
sympy.corer   Úsympy.core.basicr   Úsympy.core.functionr   Úsympy.core.numbersr   r   r0   r=   r8   r    r   r   Ú<module>rL      s9   ðñó Ý Ý "Ý (Ý &ô2�(ô 2òjòAôHr   