# Need help simplifying an equation.

I'm trying to speed up the following code:

```sum = 0
for (k = 1 ... N) {
  f = Fibonacci(k);
  for (a = 1 ... 24)
    for (b = 1 ... 24)
      for (c = 1 ... 24) {
        sum = sum + m(a, b, c) // m(a, b, c) <= 24 for all input
          * ((f - c) / 24) * ((f - b) / 24) * ((f - a) / 24);
      }
}
```

So I have $$\sum_k\sum_a\sum_b\sum_cM_{a, b, c}\Bigg\lfloor\frac{F_k - a}{24}\Bigg\rfloor\Bigg\lfloor\frac{F_k - b}{24}\Bigg\rfloor\Bigg\lfloor\frac{F_k - c}{24}\Bigg\rfloor$$

So then I push the summation over $k$ in and apply $\lfloor x / y\rfloor = \frac{x - (x \text{ mod } y)}{y}$ to get

$$\sum_a\sum_b\sum_cM_{a, b, c}\left(\sum_k\Bigg\lfloor\frac{F_k - a}{24}\Bigg\rfloor\Bigg\lfloor\frac{F_k - b}{24}\Bigg\rfloor\Bigg\lfloor\frac{F_k - c}{24}\Bigg\rfloor\right)$$

$$\frac{1}{24^3}\sum_a\sum_b\sum_cM_{a, b, c}\sum_k(F_k - c - (F_k - c \text{ mod } 24))\times(F_k - b - (F_k - b \text{ mod } 24)) \times (F_k - a - (F_k - a \text{ mod } 24))$$

Actually that's about as far as I get. Typing this up helped me find a mistake in a simplification I thought I could make earlier. Can't seem to simplify this further. If it helps at all everything is also mod 1e9.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 3, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9705366492271423, "perplexity_flag": "head"}