Problem #255
Infinite graph
Let G = (V, E) be an infinite undirected graph whose vertices are ordered pairs of integers, that is V=\mathbb{Z}^2. Given two natural numbers a and b, two vertices (x_1, y_1) and (x_2, y_2) share an edge if and only if either one of these conditions hold: 1. |x_1 - x_2| = a and |y_1 - y_2| = b, or 2. |x_1 - x_2| = b and |y_1 - y_2| = a
Let's define the following functions -
f(a, b) be 1 if the graph is connected (there exists a path between any two vertices), and 0 otherwise, and,
g(i) = \sum_{j = 1}^{10^6}(f(i, j)).
Evaluate \sum_{i = 1}^{10^6}g(i)