If the number is 325, then follow 3 black arrows, then 1 white arrow, then 2 black arrows, then 1 white arrow, and finally 5 black arrows.
If you end up back at the white node, n is divisible by 7.
Source: http://blog.tanyakhovanova.com//?p=159
Why does it work?

Recent Posts
 A^2 = B^3 + C^3
 Set {4,b,c,d,e} such that the product of any two of them increased by 1 is a square
 smallest integer whose first n multiples all contain a 3
 Set {3,b,c,d,e} such that the product of any two of them increased by 1 is a square
 Set {2,b,c,d,e} such that the product of any two of them increased by 1 is a square
Recent Comments
Archives
 February 2017
 January 2017
 December 2016
 November 2016
 October 2016
 September 2016
 August 2016
 July 2016
 June 2016
 May 2016
 April 2016
 March 2016
 February 2016
 January 2016
 December 2015
 November 2015
 October 2015
 September 2015
 August 2015
 July 2015
 June 2015
 May 2015
 April 2015
 March 2015
 February 2015
 January 2015
 December 2014
 November 2014
 October 2014
 September 2014
 August 2014
 July 2014
 June 2014
 May 2014
 April 2014
 March 2014
 February 2014
 January 2014
 December 2013
 November 2013
 October 2013
 September 2013
 August 2013
 July 2013
 June 2013
 May 2013
 April 2013
 March 2013
 February 2013
 January 2013
 December 2012
 November 2012
 October 2012
 September 2012
 August 2012
 July 2012
 June 2012
 May 2012
 April 2012
 March 2012
 February 2012
 January 2012
Categories
Meta
I believe that you mean that I have to start from 0. And if I ended at 0, then the number is divisible by 7.
Is it some sort of finite state automata? I seem to remember making diagrams like these for numbers in my theoretical computer science class.
The diagram represents multiplication by 10 modulo 7. One can build similar graphs for any modulus and any base system