## Lattice Points in Circles

A Lattice Point is any point \((x,y)\) in the Cartesian Plane such that both \(x\) and \(y\) are integers (note that either \(x\) or \(y\) or both may be negative). Let \(R\) and \(\lambda\) be two fixed numbers. Dr Cartesian has drawn \(2\) circles, both of radius \(R\), in the Cartesian Plane, centred at points \((-\lambda,0)\) and \((\lambda,\lambda)\) respectively. Let \(P\) be the number of lattice points that lie inside exactly one of the two drawn circles (lattice points that are precisely on the circumference of a circle do not count as being inside the circle). Dr Cartesian wants to know the value of \(P\) for various values of \(R\) and \(\lambda\). For example, when \(\lambda=1\) and \(R=2\), Dr Cartesian calculates that \(P=14\).

Part A | When \(\lambda=123\) and \(R=234\), what is \(P\)? | |
---|---|---|

Part B | When \(\lambda=123456\) and \(R=234567\), what is \(P\)? |

## Linexponential Series

For each positive integer \(N\) let

\( S(N) = 1 + 2 \cdot 3 + 3 \cdot 3^2 + 4 \cdot 3^3 + 5 \cdot 3^4 + \cdots + (N+1) \cdot 3^N \)

So for example \( S(1) = 1 + 6 = 7 \) and \( S(2) = 1 + 6 + 27 = 34 \).

Part A | What are the last six digits of \(S(123)\)? | |
---|---|---|

Part B | What are the first six digits of \(S(123456789)\)? | |

Part C | What are the last six digits of \(S(2021^{2021})\)? |