# Identity involving numbers 7, 16, 113, Pi, and Floor function

I've accidentally observed that the following identity seems to hold for all $n$ divisible by $7$,

$$\lfloor n\pi\rfloor = \lfloor\frac{n-1-\lfloor{\frac{n}{16}}\rfloor}{7}\rfloor+\sum_{k=1}^{\lfloor{\frac{n}{16}}\rfloor} d(n,k)$$

$$d(n,k)= \begin{cases} 1, & \text{(n\ge16k) \land (7\mid n-k) \land (((7^2-k\bmod7)\nmid k) \lor (n\lt16k+\frac{k}{7}))} \\ 0, & \text{otherwise} \end{cases}$$

If $7$ does not divide $n$, then it is either exactly correct or off by $-1$.

Why (how to show that) this identity is true? Couldn't find any counter examples. (See Edit below.)

The formula can also work for all $n\in\mathbb N$; by taking care of the $-1$ exceptions;

If $7\nmid n$, then simply add $1$ to the right side of the equation if $$\frac{n-(n\bmod7)+7}{7}\in\left[2\cdot(n\bmod7)+2+113(k-1),16\cdot(n\bmod7)+113(k-1)\right]$$

For some $k\in\mathbb N$; And now we have all the rules and the identity should hold for all $n\in\mathbb N$.

Edit: I believe I've found first exceptions for $n$ divisible by $7$ at $n\gt40000$ which are off by $+1$. I'm still interested to know if this could perhaps be further enhanced for more precision like $-1$ examples were dealt with so far. Is there an explicit way to extend this pattern?

I believe all of these exceptions so far are given by:

$$7\cdot(5649 + 113 k)$$

Which is a similar case as of the $-1$ examples that are mentioned above. Can we find all counter examples like these so far?

The number $113$ might be appearing in all these counter examples as $\frac{355}{113}$ is already a good approximation. But I suspect that these will get more unpredictable in large examples, or could we in fact find them all and "patch up" the identity?

It's interesting to me that using only $7,16,113$ and the rules above, we can find $\lfloor n\pi\rfloor$ exactly.

How could one prove this identity? Can it be perhaps, simplified or written more neatly?

Are there similar identities for numbers of form $\lfloor n\alpha\rfloor$ where $\alpha\in\mathbb R$?

Mathematica:

d[n_,k_]:= If[ n>=16*k && Mod[n-k,7]==0 && (Mod[k-Mod[k,7],49]!=0 || n<16k+k/7),1,0];
Rside[n_]:= 3*n +Floor[(n-1-Floor[n/16])/7]+Sum[d[n,k],{k,1,Floor[n/16],1}];
Lside[n_]:= Floor[Pi*n];

• Presumably, you ran this on Mathematica for some range and found no exceptions. What range? – saulspatz Feb 17 '18 at 5:41
• @saulspatz I initially just ran it in the wolfram cloud. But just now I believe I found some exceptions that are off by $1$; $40334,41125,41916,42707,43498,44289,45080,45871,46662,47453,48244,49035,...$ – Vepir Feb 17 '18 at 5:50
• You should edit your question to reflect this, I think. – saulspatz Feb 17 '18 at 5:52

$$F(n) = \text{Rside}[n] -\text{Lside}[n]$$
The first exception such that $F(n)=1$ is $n =33215$.
One exception (may not be the smallest) such that $F(n)=2$ is $n =6574442$, and this $n \neq 7(5649+113k)$.
It may be the case that $F(n)$ is unbounded as $n\to \infty$, and your proposed identity works only for "smallish" $n$.
• By exception, we mean $n = 7m$, of course. – Tito Piezas III Feb 21 '18 at 15:43