For example, for \( w = 2^ − 1 \) and for \( f \) and \( d \) near \( f ≈ 25920 \) and \( d ≈ 765433 \) there is no solution with \( X ≥ d \) for only 1 out of about 9100 combinations of \( f \) and \( d \), and no solution with \( X ≥ w \) for only 1 out of about 54 combinations.
However, when \( f \) and \( d \) are considerably less than \( w \), then there is a good chance of a solution.
For \( z = 0 \) the equation becomes \begin x = \ceilratio − 1 \end and that is certainly correct for \( y \) for which \( z = 0 \) (i.e., for the first day of each month). \begin \begin x & = \ceilratio − 1 \ & = \ceilratio − 1 \ & = \ceilratio − 1 \ & = x − 1 \ceilratio \end \ \begin 1 & = \ceilratio \ 0 & \lt \frac ≤ 1 \ 0 & \lt −⌊px r⌉_1 z 1 ≤ p \ ⌊px r⌉_1 − 1 & \lt z ≤ p − 1 ⌊px r⌉_1 \ 0 & ≤ z ≤ ⌊p⌋ − 1 ⌊p⌉_1 ⌊px r⌉_1 \end \end So, \( z \) may be as large as \( ⌊p⌋ − 1 \) (i.e., at least \( ⌊p⌋ \) days in the month) for any month, and may be as large as \( ⌊p⌋ \) (i.e., \( ⌊p⌋ 1 \) days in the month) if \( ⌊p⌉_1 ⌊px r⌉_1 ≥ 1 \), which is exactly the condition we found earlier for month \( x \) to be a long month, so it all fits together.
Then \begin \begin c(x) & = c(x_0 a) − c(a) \ & = ⌊p(x_0 a)⌋ − ⌊pa⌋ \ & = ⌊px_0 pa − ⌊pa⌋⌋ \ & = ⌊px_0 ⌊pa⌉_1⌋ \end \end so \begin r = ⌊pa⌉_1 \end The subtracting of \( c(a) \) ensures that \( c(0) = 0 \). \begin \begin y & = ⌊px r⌋ z \ px r z − 1 & \lt y ≤ px r z \ x & \lt \frac ≤ x \frac ≤ x 1 \end \end \( x \) must be a whole number, and there is only one whole number that can satisfy the last line of inequalities, and that is \begin x = \ceilratio − 1 \end To use the above equation we must know the value of \( z \), but in general we don't know that value yet.
For a given \( w \) there are many combinations of \( d \) and \( f \) for which there are no solutions with \( X ≥ w \) or \( X ≥ d \).
If such a solution does not exist, then we seek a solution for \( X ≥ d \) (for which we do need to use equations \eqref) and then we must try up to 86 million values of \( R \), which is still much less than the up to 1100 million values of \( P \).
The formulas for \( \max(R_d) \), \( N_w \), and \( N_d \) are approximations; the other formulas are exact for \( 10 ≤ w ≤ 1024 \).
I find \begin \max(f_w) & ≈ \floorratio \ \max(f_d) & ≈ \floorratio \ \max(d_w) & ≈ w − 5 (w \bmod 2) \ \max(d_d) & ≈ w − 1 \ \max(c_w) & ≈ \floorratio \ \max(c_d) & ≈ \floorratio \ \max(P_w) & ≈ \floorratio − 2 (w \bmod 2) \ \max(P_d) & ≈ \floorratio − 1 \ \max(Q) & ≈ \floorratio \ \max(R_w) & ≈ \floorratio \ \max(R_d) & ≈ \frac \ \max(X) & ≈ \floorratio \ N_w & ≈ \fracw^ \ N_d & ≈ \fracw^ \end where the variables with subscript \( w \) apply only to \( X \gt w \), those with subscript \( d \) apply only to \( X \gt d \), and those without a subscript apply to both.
The Extended Algorithm of Euclid (or a search) yields that \( −15188f 499d = 3 \), and there is no sum of a multiple of \( f \) and a multiple of \( d \) that is closer to 0.
Suppose that that pattern would be good if only it were shifted by \( a \) months so that month \( x_0 \) in the calendar with \( r = 0 \) corresponded with month \( x = x_0 a \) in the new calendar.
With \( r = 0 \) we get a certain pattern of long and short months.
On average there is a long month after every \begin Q = \frac \label \end months, but that isn't always a whole number, so in practice the number of months between two successive long months is equal to \( ⌊Q⌋ \) or \( ⌈Q⌉ \).
Month \( x \) is a long month (with \( ⌊p⌋ 1 \) days) if \( ⌊px r⌉_1 ⌊p⌉_1 ≥ 1 \).
Now we calculate \( y \), \( e \) for \( x = 1710321 \).