# A331859 ## The total number of elastic collisions between a block of mass n, a block of mass 1, and a wall. ### DATA ```text 3, 5, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25 ``` ### PYTHON IMPLEMENTATION *No Python implementation recorded in the local database yet.* ### PROGRAMS #### Mathematica ```mathematica Table[Ceiling[Pi/ArcTan[Sqrt[1/n]] - 1], {n, 1, 100}] ``` ### COMMENTS - Suppose there is a block A of mass n sliding left toward a stationary block B of mass 1, to the left of which is a wall. Assuming the sliding is frictionless and the collisions are elastic, a(n) is the number of collisions between A and B plus the number of collisions between B and the wall. (See Grant Sanderson links for animated examples.) - a(100^n) = [A011545](A011545)(n). [Strictly speaking, this relation, which is equivalent to the statement that the interval (m*Pi, Pi/arctan(1/m)) does not contain an integer for all m = 10^n, is not known to be true for sure. In other words, we do not know for certain that [A332045](A332045) does not contain a power of 10. This is mentioned in the 2025 3Blue1Brown video "Why colliding blocks compute pi" which is a follow-up of the 2019 video. - [_Jianing Song_](https://oeis.org/wiki/User:Jianing_Song), Sep 18 2025] - Since arctan(sqrt(1/n)) is approximately sqrt(1/n) for large values of n, a(n) = [A121854](A121854)(n) for most values of n. - Conjecture: The values of n for which a(n) != [A121854](A121854)(n) is a subset of [A331903](A331903). - Initial phase: - \ | ______________________ - \ \| | | - \ | | | - \ \| | | - \ | | | - \ \| <=== | Block A | - \ | _________ | | - \ \| | | | M = n | - \ | | Block B | | | - \ \| | | | | | - \ | | M = 1 | | | - \ \| |_________| |______________________| - \ L---------------------------------------------------------- - \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ - \ \| - \ | ______________________ - \ \| | | - \ | | | - \ \| | | - \ | | | - \ \| <=== | | - \ | _________ | | - \ \| | || | - \ | | || | - \ \| | || | - \ | | || | - \ \| |_________||______________________| - \ L---------------------------------------------------------- - \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ - \ \| - \ | ______________________ - \ \| | | - \ | | | - \ \| | | - \ | | | - \ \| <== | | - \ | _________ | | - \ \| | | | | - \ | | | | | - \ \|<===>| | | | - \ | | | | | - \ \| |_________| |______________________| - \ L---------------------------------------------------------- - \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ### FORMULA - a(n) = ceiling(Pi/arctan(sqrt(1/n))) - 1. - a(n) = floor(Pi/arctan(sqrt(1/n))) for n != 1, 3, since the algebraic degree of tan(Pi/n) is greater than 2 for n != 1, 2, 3, 4, 6. - [_Jianing Song_](https://oeis.org/wiki/User:Jianing_Song), Sep 18 2025 ### LINKS - Peter Kagey, [Table of n, a(n) for n = 1..10000](https://oeis.org/A331859/b331859.txt) - Code Golf Stack Exchange, [Elastic collisions between blocks](https://codegolf.stackexchange.com/q/198615/53884) - Grant Sanderson, [How Pi Connects Colliding Blocks to a Quantum Search Algorithm](https://www.quantamagazine.org/how-pi-connects-colliding-blocks-to-a-quantum-search-algorithm-20200121/), Quanta Magazine (2020). - Grant Sanderson, [The most unexpected answer to a counting puzzle](https://www.youtube.com/watch?v=HEfHFsfGXjs), 3Blue1Brown video (2019). - Grant Sanderson, [Why do colliding blocks compute pi?](https://www.youtube.com/watch?v=jsYwFizhncE), 3Blue1Brown video (2019). - Grant Sanderson, [Why colliding blocks compute pi](https://www.youtube.com/watch?v=6dTyOl1fmDo), 3Blue1Brown video (2025). ### CROSSREFERENCES - Cf. [A121854](A121854), [A331903](A331903), [A331904](A331904), [A332045](A332045). - See also the official entry at ### METADATA - **OFFSET** : `1,1` - **KEYWORDS** : `nonn` - **AUTHOR** : [_Peter Kagey_](https://oeis.org/wiki/User:Peter_Kagey), Jan 29 2020 - **IDENTIFICATION** : `#27 Sep 18 2025 14:23:50`