text:
\section{Introduction}
Recall that the Fibonacci sequence $\{F_n\}$ is defined as the sequence satisfying the recurrence $F_n = F_{n - 1} + F_{n - 2}$ with $F_0 = 0$ and $F_1 = 1$. The terms of this sequence satisfy some interesting divisibility properties, which we list below.

\begin{thm}[Vorob'ev]\cite{V}
gcd($F_n, F_m$) = $F_{\text{gcd}(n, m)}$ for all $m, n \in \mathbb{Z^{+}}$. Note that this implies that gcd($F_n$, $F_{n + 1}$) = 1.
\end{thm}

\begin{thm}\cite{V}
If $n \ge 2$, $F_n | F_m$ if and only if $n | m$.
\end{thm}

\begin{thm}[Hoggatt and Long]\cite{HL}
$F_n$ is prime only if $n$ is prime.
\end{thm}

\begin{thm}\cite{HL}
Let $r \in \mathbb{Z^{+}}$. Then there exists an $m$ such that $r | F_m$. If $m$ is the least such number, then $r | F_n$ if and only if $m | n$.
\end{thm}

Many of these divisibility properties are also shared in the following generalization of the Fibonacci sequence.

\begin{defn}[ACMS]\cite{ACMS}
The $\emph{generalized}$ Fibonacci polynomials are polynomials in $s$ and $t$ defined by $f_0(s, t) = 0$ and $f_1(s, t) = 1$ with the recurrence $f_n(s, t) = sf_{n - 1}(s, t) + tf_{n - 2}(s, t)$ for $n \ge 2$.
\end{defn}

Here are some counterparts of the results above for generalized Fibonacci polynomials. Note that divisibility is considered over $\mathbb{Z}[s, t]$ unless otherwise indicated.

\begin{thm}\cite{HL}
gcd($f_n, f_m$) = $f_{\text{gcd}(n, m)}$ for all $m, n \in \mathbb{Z^{+}}$. Note that this implies that gcd($f_n$, $f_{n + 1}$) = 1.
\end{thm}

\begin{thm}\cite{HL}
If $n \ge 2$, $f_n | f_m$ if and only if $n | m$.
\end{thm}

\begin{thm}\cite{HL}
$f_n(s, t)$ is irreducible over $\mathbb{Q}$ if and only if $n$ is prime.
\end{thm}

\begin{thm}\cite{HL}
Fix $s, t \in \mathbb{Z}$ and let $r$ be a positive integer with gcd($r$, $t$) = 1. Then there exists $m$ such that $r | f_m$. If there is a  least positive integer $m$ such that $r | f_m$, then $r | f_n$ if and only if $m | n$.
\end{thm}

The remainder of this paper will mainly deal with generalized Fibonacci sequences, which are the sequences obtained after fixing $s, t \in \mathbb{Z}$ in the generalized Fibonacci polynomials. In the next section, we will consider the periodicity of generalized Fibonacci sequences modulo $n$ in relation to a generalization of $p$-adic valuations. In Section 3, we consider an analogue of the Riemann zeta function for generalized Fibonacci sequences. Finally, we will examine the rank modulo $n$ in more depth and find an interpretation as the order of an element in a finite field.

\section{$d$-adic valuations of generalized Fibonacci sequences}
One property of the Fibonacci sequence which carries over to generalized Fibonacci sequences is periodicity modulo $n$ for any $n \ge 2$. This property also holds holds for generalized Fibonacci sequences since there are finitely many choices for pairs of consecutive terms modulo $n$. According to \cite{War}, many arithmetic properties of generalized Fibonacci sequences ultimately depend on this periodicity property and the divisibility property which was shown in Theorem 2 and Theorem 6. We now formally define the period modulo $m$.

\begin{defn}
The $\emph{period}$ modulo $m$ is defined to be the smallest positive integer $k(m)$ such that $f_n(s, t) \equiv f_{n + k(m)}(s, t)$ (mod $m$) for all sufficiently large $n$.
\end{defn}

There is a quantity similar to the period related to divisibility modulo $m$.

\begin{defn}
If there exists $r(m)$ such that $f_y(s,t) \equiv 0$ (mod $m$) if and only if $r(m) | y$, $r(m)$ is defined as the $\emph{rank}$ modulo $m$.
\end{defn}

For example, we can consider the Fibonacci sequence modulo 8. Here are the first few terms of the residues modulo 8: $0, 1, 1, 2, 3, 5, 0, 5, 5, 2, 7, 1, 0, 1, 1, \ldots$ In this case, the period $k(8) = 12$, while the rank $r(8) = 6$ \cite{Ro}. \\

We now show that the rank exists modulo a prime $p$ if and only if $p \nmid t$.

\begin{thm}
Let $p$ be a prime. Then, $r(p)$ exists if and only if $p \nmid t$.
\end{thm}

\begin{proof}
By Theorem 8, there is a positive integer $m$ such that $p | f_m$ if $p \nmid t$. This means that it suffices to show that it is not possible to obtain a sequence of the form $x, 0, 0, \ldots$ modulo $p$ with $x \ne 0$ in this case. Using the recurrence, we find that this is only possible if there is a $t$ such that $tx \equiv 0$ (mod $p$). If $p | s$ and $p | t$, then this is true for any $x$ and $f_n \equiv 0$ (mod $p$) for all $n \ge m$, so $r(p)$ does not exist. If $p \nmid s$ and $p | t$, the sequence would be of the form $0, 1, s, s^2, s^3, \ldots$ mod $p$ and there would be no positive integer $m$ such that $p | f_m$. If $p \nmid t$, this statement implies that $x \equiv 0$ (mod $p$). However, this contradicts the assumption that $x \not\equiv 0$ (mod $p$). So, the pair $(f_m, f_{m + 1})$ must be of the form $(0, a)$ modulo $p$, where $a \ne 0$ and the sequence up to $f_{m - 1}$ is multiplied by $a$ mod $p$. Then, $r(p)$ is equal to the smallest possible value of $m$.
\end{proof}

Arguments similar to the one used above can be used to show that $r(p^k)$ exists if and only if $r(p)$ exists as $p^k$ is relatively prime to $t$ if and only if $p \nmid t$. We will mainly focus on the case where $t = -1$ since $r(m)$ exists for any $m \ge 2$ and many properties of the original Fibonacci sequence carry over to this case. \\

\begin{comment}
\begin{thm}
The terms of the sequence $\{f_i\}$  congruent to 0 mod $n$ are evenly spaced within the period of the $\{f_i\}$ mod $n$ when $t = -1$.
\end{thm}

\begin{proof}
First, the pair (0, 1) mod $n$ repeats itself periodically by the argument in the previous theorem. By Theorem 2.2 of \cite{ACMS}, we have that $f_{n + m} = f_m f_{n + 1} - f_{m - 1} f_n$. In addition, $f_{-m} = -f_m$, which can be proved by induction. This can be used to show that $f_{n - m} = f_{m + 1} f_n - f_m f_{n + 1}$. When $f_n \equiv f_m \equiv 0$ (mod $n$), we have $f_{n + m} = f_{n - m} \equiv 0$ (mod $n$). Let $z$ be the smallest positive integer such that $f_z \equiv 0$ (mod $n$). Assume there exists some $y \in \mathbb{Z}$ such that $z \nmid y$ and $f_y \equiv 0$ (mod $n$). Then, we can write $y = qz + r$ with $q, r \in \mathbb{Z}$ and $0 < r < z$. Since $f_{qz + r} \equiv 0$ (mod $n$), we can subtract $z$ repeatedly to find that $f_r \equiv 0$ (mod $n$). This contradicts the minimality of $z$. If $z | y$, we can add repeatedly to find that $f_y \equiv 0$ (mod $n$). Thus, $f_ y \equiv 0$ (mod $n$) if and only if $z | y$ and the terms divisible by $n$ are evenly spaced within the period mod $n$.
\end{proof}
\end{comment}

Here are some results on the rank of generalized Fibonacci sequences modulo $p$, where $p$ is an odd prime.

\begin{thm}[Li] \cite{L}
Let $p$ be an odd prime and $r(p)$ be the rank of the generalized Fibonacci sequence with parameters $(s, t)$ mod $p$. Let $D = s^2 + 4t$. If $p | D$, we have that $r(p) = p$.
\end{thm}

\begin{thm} \cite{L}
If $p$ is an odd prime such that $p \nmid D$, then $(-t/p) = 1$ if and only if $r(p) | \frac{p - (D/p)}{2}$.
\end{thm}

\begin{rem}
Note that we always have $(-t/p) = 1$ when $t = -1$. By Theorem 10 and Theorem 11, we have that $r(p) \le p$ for all odd primes $p$.
\end{rem}

Another property of the Fibonacci sequence which carries over to generalized Fibonacci sequences with $t = -1$ is that we can relate periods of generalized Fibonacci sequences mod $p$ to $p$-adic valuations of their elements. This is one example of the relationship of periodicity modulo $n$ to other arithmetic properties of generalized Fibonacci sequences. Here are some results which have similar counterparts for the Fibonacci sequence (see \cite{Le}, \cite{Wl}, \cite{K}, and \cite{Le} for Lemmas 1, 2, 3, and 4 respectively). We use $g_n(s,t)$ to denote the generalized Lucas sequences.

\begin{lemma}
$\text{gcd}(f_n(s, -1), g_n(s, -1)) \le 2$.
\end{lemma}

\begin{proof}
\begin{align*}
\text{gcd}(f_n(s, -1), g_n(s, -1)) &= \text{gcd}(f_n(s, -1), f_{n + 1}(s, -1) - f_{n - 1}(s, -1)) \text{ (Proposition 2.3 of \cite{ACMS})} \\
&= \text{gcd}(f_n(s, -1), sf_n(s, -1) - 2f_{n - 1}(s, -1)) \\
&= \text{gcd}(f_n(s, -1), - 2f_{n - 1}(s, -1)) \\
&= \text{gcd}(f_n(s, -1), 2) \text{ (follows by induction)}
\end{align*}
\end{proof}

\begin{lemma}
$f_{kn}(s, -1) = 2^{1 - k} f_n(s, -1)(K f_n(s, -1)^2 + k g_n(s, -1)^{k - 1})$, where $K \in \mathbb{Z}$.
\end{lemma}

\begin{proof}
Consider the binomial expansion of $f_{kn}(s, -1) = \frac{X^{kn} - Y^{kn}}{X - Y}$, where $X = \frac{s + \sqrt{s^2 - 4}}{2}$ and $Y = \frac{s - \sqrt{s^2 - 4}}{2}$.

\begin{align*}
f_{kn}(s, -1) &= \frac{X^{kn} - Y^{kn}}{X - Y} \\
&= \frac{1}{X - Y} (\frac{1}{2^k}((X - Y)f_n(s, -1) + g_n(s, -1))^k - \frac{1}{2^k}(-(X - Y)f_n(s, -1) + g_n(s, -1))^k) \\
&= 2^{1 - k} \sum_{j \text{ odd}} \binom{k}{j} (X - Y)^{j - 1} f_n(s, -1)^j g_n(s, -1)^{k - j} \\
&= 2^{1 - k} f_n(s, -1) (K f_n(s, -1)^2 + k g_n(s, -1)^{k - 1}) \text{ } (\text{where $K \in \mathbb{Z}$})
\end{align*}

\end{proof}

\begin{lemma}
Let $k \in \mathbb{N}$. We have $f_{kn}(s, -1) \equiv kf_{n + 1}(s, -1)^{k - 1} f_n(s, -1)$ (mod $f_n(s, -1)^2$) and $f_{kn + 1}(s, -1) \equiv f_{n + 1}(s, -1)^k$  (mod $f_n(s, -1)^2$).
\end{lemma}

\begin{proof}
We use induction on $k$. If $k = 1$, we have $f_n(s, -1) \equiv f_n(s, -1)$ (mod $f_n(s, -1)^2$) and $f_{n + 1}(s, -1) \equiv f_{n + 1}(s, -1)$ (mod $f_n(s, -1)^2$). Assume that $f_{kn}(s, -1) \equiv kf_{n + 1}(s, -1)^{k - 1} f_n(s, -1)$ (mod $f_n(s, -1)^2$) and $f_{kn + 1}(s, -1) \equiv f_{n + 1}(s, -1)^k$  (mod $f_n(s, -1)^2$). Then, we have the following.

\begin{align*}
f_{(k + 1)n}(s, -1) &= f_{kn + 1}(s, -1)f_n(s, -1) - f_{kn}(s, -1)f_{n - 1}(s, -1) \text{ (Theorem 2.2 of \cite{ACMS})} \\
&\equiv f_{n + 1}(s, -1)^k f_n(s, -1) - kf_{n + 1}(s, -1)^{k - 1} f_n(s, -1) f_{n - 1}(s, -1) \text{ (mod $f_n(s, -1)^2$)} \\
&\equiv f_{n + 1}(s, -1)^k f_n(s, -1) + kf_{n + 1}(s, -1)^{k - 1} f_n(s, -1) f_{n + 1}(s, -1) \text{ (mod $f_n(s, -1)^2$)} \\
&\equiv (k + 1)f_{n + 1}(s, -1)^k f_n(s, -1) \text{ (mod $f_n(s, -1)^2$)} \\
\\
f_{(k + 1)n + 1}(s, -1) &= f_{kn + 1}(s, -1)f_{n + 1}(s, -1) - f_{kn}(s, -1)f_n(s, -1) \\
&\equiv f_{n + 1}(s, -1)^k f_{n + 1}(s, -1) - kf_{n + 1}(s, -1)^{k - 1} f_n(s, -1)^2 \text{ (mod $f_n(s, -1)^2$)} \\
&\equiv f_{n + 1}(s, -1)^{k + 1} \text{ (mod $f_n(s, -1)^2$)}
\end{align*}

\end{proof}

\begin{lemma}
Let $p$ be an odd prime and $e = e(p) = \nu_p(f_{r(p)}(s, -1))$. Then,
$$
\nu_p(f_n(s, -1)) =
\begin{cases}
\nu_p(n) - \nu_p(r(p)) + e(p), & \text{if $n \equiv 0$ (mod $r(p)$).} \\
0 , & \text{if $n \not\equiv 0$ (mod $r(p)$).}
\end{cases}
$$
\end{lemma}

\begin{proof}
By Lemma 2, we have that $f_{kn}(s, -1) = 2^{1 - k} f_n(s, -1)(K f_n(s, -1)^2 + k g_n(s, -1)^{k - 1})$, where $K \in \mathbb{Z}$. Let $k  = p$, $n = c r(p) p^{\alpha - 1}$, where gcd($c, p$) = 1 and $\alpha \ge 1$. This means that $f_{cr(p)p^\alpha}(s, -1) = 2^{1 - p} f_{cr(p)p^{\alpha - 1}}(s, -1) (K'p^2 + pg_{cr(p)p^{\alpha - 1}}(s, -1)^{p - 1})$ ($K' \in \mathbb{Z}$). Note that $p \nmid g_{cr(p)p^{\alpha - 1}}(s, -1)$ since \\ $\text{gcd}(f_n(s, -1), g_n(s, -1)) \le 2$ by Lemma 1 and $p$ is an odd prime. This implies that $\nu_p(f_{cr(p)p^\alpha}(s, -1)) = \nu_p(f_{cr(p)p^{\alpha - 1}}(s, -1)) + 1$ and it follows by induction that $\nu_p(f_{cr(p)p^\alpha}(s, -1)) = \nu_p(f_{cr(p)}) + \alpha$. \\

We also have by Lemma 3 that $f_{cr(p)}(s, -1) \equiv cf_{r(p)}(s, -1)f_{r(p) + 1}(s, -1)^{c - 1}$ (mod $p^{2e}$). Note that gcd$(f_{r(p) + 1}(s, -1), p) = 1$ since $f_m(s, -1) \equiv 0$ (mod $p$) if and only if $r(p) | m$. Since  $r(p) \nmid r(p) + 1$, we have $p \nmid f_{r(p) + 1}(s, -1) \Rightarrow $ gcd$(f_{r(p) + 1}(s, -1), p) = 1$ since $p$ is prime. This implies that $\nu_p(f_{cr(p)}(s, -1)) = \nu_p(f_{r(p)}(s, -1))$ when gcd($c$, $p$) = 1. This can be used with  $\nu_p(f_{r(p)}(s, -1)) = e < 2e$ to show that $\nu_p(f_{cr(p)p^\alpha}(s, -1)) = \nu_p(f_{r(p)}(s, -1)) + \alpha = e(p) + \alpha$. Thus, $\nu_p(f_n(s, -1)) = \nu_p(n) - \nu_p(r(p)) + e(p)$ when $r(p) | n$.

\end{proof}

\begin{rem}
It would be interesting to generalize this lemma to relate $p$-adic valuations to the rank modulo $p$ for other values of $t$.
\end{rem}

The results above relating the period of the generalized Fibonacci sequence to the $p$-adic valuations of its elements can be used to show that the following conjecture of Amdeberhan, Chen, Moll, and Sagan holds.

\begin{conj}\cite{ACMS}
Suppose $s \ge 2$ is an integer and $d \ge 3$ is an odd integer. There exist integers $s'(s, d)$ and $d'(s, d)$ such that $d' \le d$ and $\nu_d(f_n(s, -1)) = \delta_{d' \mathbb{Z}}(n)\nu_d(\frac{s'n}{d'})$.
\end{conj}

We will first show that this conjecture holds when $d$ is an odd prime.

\begin{thm}
Suppose $s \ge 2$ is an integer and $p \ge 3$ is an odd prime. There exist integers $s'(s, d), d'(s, d)$ such that $d' \le d$ and $\nu_p(f_n(s, -1)) = \delta_{d' \mathbb{Z}}(n)\nu_p(\frac{s'n}{d'})$.
\end{thm}

\begin{proof}
If there exists $d'$ such that if $\delta_{d' \mathbb{Z}}(n) = 0$, we have that $\nu_d(f_n(s, -1)) = 0$. This implies that $d' \nmid n \Rightarrow d \nmid f_n(s, -1)$, which is equivalent to the statement $d | f_n(s, -1) \Rightarrow d' | n$. Note that $d'$ divides the rank mod $p$. Let $r(p)$ be the rank mod $p$. Setting $d' = r(p)$ satisfies the previous condition and we have $d' \le p$ (see remark following Theorem 4). \\

Consider the case where $r(p) | n$. Then, $\nu_p(f_n(s, -1)) = \nu_p(\frac{s'n}{d'})$ if and only if $\nu_p(n) - \nu_p(r(p)) + e(p) = \nu_p(\frac{s'n}{d'})$. If we take $s'$ such that $d' | s'$, we have $\nu_p(\frac{s'n}{d'}) = \nu_p(n) + \nu_p(\frac{s'}{d'})$ and the statement reduces to $\nu_p(\frac{s'}{d'}) = -\nu_p(r(p)) + e(p)$. Note that we either have $\nu_p(r(p))$ equal to 0 or 1, which means that $-\nu_p(r(p)) + e(p) \ge 0$ as $p | f_{r(p)}(s, -1)$. This equation is satisfied if we set $s' = d' \cdot p^{- \nu_p(r(p)) + e(p)}$, which only depends on $s$ and $p$.

\end{proof}

This result can be generalized to the case where $d$ is the power of an odd prime.

\begin{thm}
Suppose $s \ge 2$ is an integer and $d = p^r$, where $p$ is an odd prime ($p \ge 3$). There exist integers $s'(s, d)$ and $d'(s, d)$ such that $d' \le d$ and $\nu_d(f_n(s, -1)) = \delta_{d' \mathbb{Z}}(n)\nu_d(\frac{s'n}{d'})$.
\end{thm}

\begin{proof}
We set $d'$ equal to some divisor of $r(d)$ less than or equal to $d$ (eg. $d' = 1$). We now consider the case where $r(d) | n$. We claim that there exists an $s'$ divisible by $d'$ such that $\nu_d(f_n(s, -1)) = \nu_d(\frac{s'n}{d'})$. Since $\nu_{p^r}(N) = \lfloor \frac{\nu_p(N)}{r} \rfloor$, we want to find $s'$ such that $\lfloor \frac{\nu_p(n) - \nu_p(r(p)) + e(p)}{r} \rfloor = \lfloor \frac{\nu_p(\frac{s'n}{d'})}{r} \rfloor = \lfloor \frac{-\nu_p(n) + \nu_p(\frac{s'}{d'})}{r} \rfloor$. We find that setting $s' = d' \cdot p^{-\nu_p(r(p)) + e(p)}$ as in the end of the proof of Theorem 12 also satisfies this equation since the numerators are equal.

\end{proof}

We can use solutions for powers of odd primes to show that the conjecture holds for arbitrary odd integers $d$.

\begin{thm}
Suppose $s \ge 2$ is an integer and $d \ge 3$ is an odd integer. There exist integers $s'(s, d)$ and $d'(s, d)$ such that $d' \le d$ and $\nu_d(f_n(s, -1)) = \delta_{d' \mathbb{Z}}(n)\nu_d(\frac{s'n}{d'})$.
\end{thm}

\begin{proof}
Set $d'$ to be a divisor of the rank mod $d$ less than or equal to $d$ as above. Let $d = p_1^{\alpha_1} \cdots p_k^{\alpha_k}$ and $s' = d' \cdot \displaystyle\prod_{j = 1}^k {p_j^{-\nu_{p_j}(r(p_i)) + e(p_j)}}$. We have $\nu_{p_i}(n) = \nu_{p_i}(n) - \nu_{p_i}(r(p_i)) + e(p_i)$ and $\nu_{p_i}(\frac{s'n}{d'}) =\nu_{p_i}(n) + \nu_{p_i}(\frac{s'}{d'}) = \nu_{p_i}(n) + \nu_{p_i}(\displaystyle\prod{p_j^{\nu_{p_j}(-r(p_j)) + e(p_j)}}) = \nu_{p_i}(n) - \nu_{p_i}(r(p_i)) + e(p_i)$. So, we have $\nu_{p_i}(f_n(s, -1)) = \nu_{p_i}(\frac{s'n}{d'})$ for all $i$. Since $\nu_d(N) = \min_{1 \le i \le k} \lfloor \frac{\nu_{p_i}(N)}{\alpha_i} \rfloor$ for $N \in \mathbb{N}$, we have $\nu_d(f_n(s, -1)) = \min_{1 \le i \le k} \lfloor \frac{\nu_{p_i}(f_n(s, -1))}{\alpha_i} \rfloor = \min_{1 \le i \le k} \lfloor \frac{\nu_{p_i}(\frac{s'n}{d'})}{\alpha_i} \rfloor = \nu_d(\frac{s'n}{d'})$.

\end{proof}

\section{An analogue of the Riemann zeta function}
We now consider an analogue of the Riemann zeta function. The Riemann zeta function is defined as the analytic continuation of $\zeta(z)  = \sum_{k = 1}^\infty \frac{1}{k^z}$, where $z \in \mathbb{C}$. One variation of this function which has been considered is the function $\zeta_F(z)  = \sum_{k = 0}^\infty \frac{1}{F_k^z}$ with $z \in \mathbb{C}$, where the positive integers are replaced with terms of the Fibonacci sequence \cite{WZ}. This function shares some properties with the original Riemann zeta function (see \cite{M} for more details) and has been studied in several different ways (see \cite{HK} for an overview). Some of the work that has been done with this analogue of the Riemann zeta function involves estimating the tails of the series for positive integers $z$. The first result relating to such estimates is the following.

\begin{thm} [Ohtsuka and Nakamura] \cite{ON} Let $\{F_k\}$ be the Fibonacci sequence.
$$
\left\lfloor \left(\sum_{k = n}^\infty \frac{1}{F_k}\right)^{-1} \right\rfloor =
\begin{cases}
F_{n - 2}, & \text{if $n$ even, $n \ge 2$} \\
F_{n - 2} - 1, & \text{if $n$ odd, $n \ge 1$}
\end{cases}
$$

$$
\left\lfloor \left(\sum_{k = n}^\infty \frac{1}{F_k^2}\right)^{-1} \right\rfloor =
\begin{cases}
F_{n - 1}F_n - 1, & \text{if $n$ even, $n \ge 2$} \\
F_{n - 1}F_n, & \text{if $n$ odd, $n \ge 1$}
\end{cases}
$$
\end{thm}

Note that no closed form is known for the sum $\sum_{k = n}^\infty \frac{1}{F_k}$ although some of its properties are known. Holliday and Komatsu \cite{HK} gave the first result relating to sums of more general terms. Specifically, they studied the case where the denominators were Fibonacci polynomials with a fixed integer parameter. Here is one of their results.

\begin{thm}[Holliday and Komatsu] \cite{HK}
If $t = 1$ and $s, n \in \mathbb{Z}^{+}$, then

\begin{align*}
\left\lfloor \left(\sum_{k = n}^\infty \frac{1}{f_{k}(s, 1)}\right)^{-1} \right\rfloor = f_{n}(s, 1) - f_{n - 1}(s, 1) - \delta_{\mathbb{Z} \setminus 2\mathbb{Z}}(n),
\end{align*}

and

\begin{align*}
\left\lfloor \left(\sum_{k = n}^\infty \frac{1}{f_{k}(s, 1)^2}\right)^{-1} \right\rfloor = s f_n(s, 1) f_{n - 1}(s, 1) - \delta_{2\mathbb{Z}}(n).
\end{align*}

\end{thm}

According to \cite{ACMS}, Holliday and Komatsu asked whether the above result could be generalized for other $t$. The following result from \cite{ACMS} generalizes the first sum and also considers a more general class of sums than those considered in \cite{HK}.

\begin{thm} [ACMS] \cite{ACMS}
If $s \ge t \ge 1$ and $n, r \in \mathbb{Z}^+$ then

\begin{align*}
\left\lfloor \left(\sum_{k = n}^\infty \frac{1}{f_{rk}(s, t)}\right)^{-1} \right\rfloor = f_{rn}(s, t) - f_{r(n - 1)}(s, t) - \delta_{2\mathbb{Z}}(r(n - 1)).
\end{align*}

If $t = 1$ and $s, n, r \in \mathbb{Z}^+$ then

\begin{align*}
\left\lfloor \left(\sum_{k = n}^\infty \frac{1}{f_{rk}(s, 1)^2}\right)^{-1} \right\rfloor = f_{rn}(s, 1)^2 - f_{r(n - 1)}(s, 1)^2 - \delta_{2\mathbb{Z}}(r(n - 1)).
\end{align*}

\end{thm}

It is conjectured that there is an analogue of this theorem replacing $t$ with $-t$.

\begin{conj}[ACMS] \cite{ACMS}
If $s > t \ge 1$ with $(s, -t) \ne (2, -1)$ and $n, r \in \mathbb{Z}^+$ then

\begin{align*}
\left\lfloor \left(\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -t)}\right)^{-1} \right\rfloor = f_{rn}(s, -t) - f_{r(n - 1)}(s, -t) - 1.
\end{align*}

If $t = -1$ and $s, n, r \in \mathbb{Z}^+$ then

\begin{align*}
\left\lfloor \left(\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -1)^2}\right)^{-1} \right\rfloor = f_{rn}(s, -1)^2 - f_{r(n - 1)}(s, -1)^2 - 1.
\end{align*}

\end{conj}

We show that the conjecture holds for sufficiently large $s, t$.

\begin{thm}
Let $s > t \ge 1$ be a pair of integers with $(s, -t) \ne (2, -1)$ and $n, r \in \mathbb{Z}^+$. If $s, t$ are sufficiently large, we have that

\begin{align*}
\left\lfloor \left(\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -t)}\right)^{-1} \right\rfloor = f_{rn}(s, -t) - f_{r(n - 1)}(s, -t) - 1.
\end{align*}

Let $t = -1$ and $s, n, r \in \mathbb{Z}^+$. If $s$ is sufficiently large, we have that

\begin{align*}
\left\lfloor \left(\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -1)^2}\right)^{-1} \right\rfloor = f_{rn}(s, -1)^2 - f_{r(n - 1)}(s, -1)^2 - 1.
\end{align*}

\end{thm}

We will use the following result in \cite{ACMS} in the proof of this theorem.

\begin{lemma} [ACMS] \cite{ACMS}
Let $r, m, n \in  \mathbb{P}$ and $s, t$ be arbitrary integers. We have $f_{rn}(s, t) f_{r(n + m - 1)}(s, t) - f_{r(n - 1)}(s, t) f_{r(n + m)}(s, t) = (-t)^{r(n - 1)} f_r(s, t) f_{rm}(s, t)$.
\end{lemma}

Now we begin the proof of Theorem 18.

\begin{proof}

We will first show that each of the two series $\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -t)}$ and $\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -1)^2}$ converges under the given conditions. By Proposition 1.1 of \cite{ACMS}, we have that$f_n(s, -t) = \frac{X^n - Y^n}{X - Y}$, where $X = \frac{s + \sqrt{s^2 - 4t}}{2}$ and $Y = \frac{s - \sqrt{s^2 - 4t}}{2}$. This means that the ratio of consecutive terms of the sum $\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -t)}$ is of the form $\frac{X^p - Y^p}{X^{p + r} - Y^{p + r}}$ for some $p \ge rn$. Similarly, we have that the ratio of consecutive terms of the sum $\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -1)^2}$ is of the form $\left(\frac{X^p - Y^p}{X^{p + r} - Y^{p + r}}\right)^2$ for some $p \ge rn$. Note that $\lim_{p \to \infty} \frac{X^p - Y^p}{X^{p + r} - Y^{p + r}} = \frac{1}{X^r}$. Since $X > 1$ for all pairs $(s, -t) \ne (2, -1)$, it follows that the two series $\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -t)}$ and $\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -1)^2}$ both converge. \\

We now examine the sum $\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -t)}$. Let $B(n) = \sum_{k = n}^\infty \frac{1}{f_{rk}(s, -t)}$. Note that \\ $\left\lfloor \left(\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -t)}\right)^{-1} \right\rfloor = f_{rn}(s, -t) - f_{r(n - 1)}(s, -t) - 1$ if and only if $f_{rn}(s, -t) - f_{r(n - 1)}(s, -t) - 1 \le \frac{1}{B(n)} < f_{rn}(s, -t) - f_{r(n - 1)}(s, -t)$. \\

The proof that $\frac{1}{B(n)} < f_{rn}(s, -t) - f_{r(n - 1)}(s, -t)$ is very similar to the corresponding proof in Theorem 2 for $f_n(s, t)$ (see \cite{ACMS}). It suffices to show that $1 < B(n)(f_{rn}(s, -t) - f_{r(n - 1)}(s, -t))$. Note that the first term of the product $B(n) f_{rn}(s, -t)$ is equal to 1, which we subtract from both sides of the inequality. Now we will compare the term for $k = n + m$ ($m \ge 1$) in $f_{rn}(s, -t) B(n)$ with the term for $k = n + m - 1$ in $f_{r(n - 1)}(s, -t) B(n)$ and see that it suffices to show that

\begin{align*}
0 < \frac{f_{rn}(s, -t)}{f_{r(n + m)}(s, -t)} - \frac{f_{r(n - 1)}(s, -t)}{f_{r(n + m - 1)}(s, -t)}.
\end{align*}

By Lemma 1, we have that \[f_{rn}(s, -t) f_{r(n + m - 1)}(s, -t) - f_{r(n - 1)}(s, -t) f_{r(n + m)}(s, -t) = t^{r(n - 1)} f_r(s, -t) f_{rm}(s, -t).\] Dividing by $f_{r(n + m -1)}(s, -t) f_{r(n + m)}(s, -t)$, we have that \[\frac{f_{rn}(s, -t)}{f_{r(n + m)}(s, -t)} - \frac{f_{r(n - 1)}(s, -t)}{f_{r(n + m - 1)}(s, -t)} = t^{r(n - 1)} \frac{f_r(s, -t) f_{rm}(s, -t)}{f_{r(n + m)}(s, -t) f_{r(n + m - 1)}(s, -t)}\]. We claim that $f_k(s, -t) > 0$ for all $k \ge 1$. It suffices to show that the sequence $\{f_k(s, -t)\}$ is monotonically increasing since $f_1(s, -t) = 1$. This can be proved by induction. We have $f_1(s, -t) = 1$ and $f_2(s, -t) = s \ge 3$. Assume that $f_n \ge f_{n - 1}$. Then, $f_{n + 1} - f_n = (s - 1)f_n - tf_{n - 1} \ge (s - 1)f_n - (s - 1)f_{n - 1} = (s - 1)(f_n - f_{n - 1}) \ge 0$. Thus, $f_k(s, -t) > 0$ for all $k \ge 1$. This means that

\begin{align*}
\frac{f_{rn}(s, -t)}{f_{r(n + m)}(s, -t)} - \frac{f_{r(n - 1)}(s, -t)}{f_{r(n + m - 1)}(s, -t)} = t^{r(n - 1)} \frac{f_r(s, -t) f_{rm}(s, -t)}{f_{r(n + m)}(s, -t) f_{r(n + m - 1)}(s, -t)} > 0.
\end{align*}

As for the other bound, the same procedure as the one used in the previous paragraph can be used to show that proving this bound reduces to showing that

\begin{align*}
\frac{f_{rn}(s, -t)}{f_{r(n + m)}(s, -t)} - \frac{f_{r(n - 1)}(s, -t)}{f_{r(n + m - 1)}(s, -t)} \le \frac{1}{f_{r(n + m - 1)}(s, -t)}.
\end{align*}

\noindent Cross-multiplying and using Lemma 1, we find that it suffices to show that \[t^{r(n - 1)} \le \frac{1}{f_r(s, -t)} \frac{f_{r(n + m)}(s, -t)}{f_{rm}(s, -t)}\]. In \cite{ACMS}, it was shown that \[t^{r(n - 1)} \le \frac{1}{t} \frac{1}{f_r(s, t)} \frac{f_{r(n + m)}(s, t)}{f_{rm}(s, t)} \le \frac{1}{t} \frac{1}{f_r(s, -t)} \frac{f_{r(n + m)}(s, t)}{f_{rm}(s, t)}\]. Since $\frac{1}{f_r(s, -t)} \ge \frac{1}{f_r(s, t)}$ for all $r, s, t \in \mathbb{Z}^+$, it suffices to show that \[\frac{1}{t} \frac{f_{r(n + m)}(s, t)}{f_{rm}(s, t)} \le \frac{f_{r(n + m)}(s, -t)}{f_{rm}(s, -t)}\] for sufficiently large $s, t$. Let $X_1 = \frac{s + \sqrt{s^2 - 4t}}{2}$, $Y_1 = \frac{s - \sqrt{s^2 - 4t}}{2}$, $X_2 = \frac{s + \sqrt{s^2 + 4t}}{2}$, and $Y_2 = \frac{s - \sqrt{s^2 + 4t}}{2}$. Rewriting the inequality in terms of the $X_i$ and $Y_i$, we claim that \[\frac{1}{t} \frac{X_2^{r(n + m)} - Y_2^{r(n + m)}}{X_2^{rm} - Y_2^{rm}} \le \frac{X_1^{r(n + m)} - Y_1^{r(n + m)}}{X_1^{rm} - Y_1^{rm}}\] for sufficiently large $s, t$. We have \[\frac{1}{t} \frac{X_2^{r(n + m)} - Y_2^{r(n + m)}}{X_2^{rm} - Y_2^{rm}} \le \frac{X_1^{r(n + m)} - Y_1^{r(n + m)}}{X_1^{rm} - Y_1^{rm}}\] if and only if \[\frac{(X_2^{r(n + m)} - Y_2^{r(n + m)})(X_1^{rm} - Y_1^{rm})}{(X_1^{r(n + m)} - Y_1^{r(n + m)})(X_2^{rm} - Y_2^{rm})} \le t\]. Note that $\lim_{s \to \infty} \frac{X_1}{X_2} = 1$ and $\lim_{s \to \infty} \frac{Y_1}{Y_2} = -1$. We obtain the first limit as follows. Since $s > t$, we have $\frac{s + \sqrt{s^2 - 4s}}{s + \sqrt{s^2 + 4s}} < \frac{X_1}{X_2} < 1$. Since $\lim_{s \to \infty} \frac{s + \sqrt{s^2 - 4s}}{s + \sqrt{s^2 + 4s}} = 1$, we have  $\lim_{s \to \infty} \frac{s + \sqrt{s^2 - 4t}}{s + \sqrt{s^2 + 4t}} = 1$ for all $t < s$. We also have that $\lim_{s \to \infty} \frac{Y_i}{X_i} = 0$. Rewriting \[\frac{(X_2^{r(n + m)} - Y_2^{r(n + m)})(X_1^{rm} - Y_1^{rm})}{(X_1^{r(n + m)} - Y_1^{r(n + m)})(X_2^{rm} - Y_2^{rm})}\] in terms of $\frac{X_2}{X_1}$, $\frac{Y_2}{Y_1}$, and $\frac{Y_i}{X_i}$, we have the following.

\begin{align*}
\frac{(X_2^{r(n + m)} - Y_2^{r(n + m)})(X_1^{rm} - Y_1^{rm})}{(X_1^{r(n + m)} - Y_1^{r(n + m)})(X_2^{rm} - Y_2^{rm})} \\= \frac{\left(1 - \left(\frac{Y_2}{X_2}\right)^{r(n + m)}\right) \left(1 - \left(\frac{Y_1}{X_1}\right)^{rm} \right)}{\left(\left(\frac{X_1}{X_2}\right)^{r(n + m)} - \left(\frac{Y_2}{X_2}\right)^{r(n + m)} \left(\frac{Y_1}{Y_2}\right)^{r(n + m)}\right) \left(\left(\frac{X_2}{X_1}\right)^{rm} - \left(\frac{Y_1}{X_1}\right)^{rm} \left(\frac{Y_2}{Y_1}\right)^{rm}\right)}
\end{align*}

Using the limits given above, we find that \[\lim_{s \to \infty} \frac{(X_2^{r(n + m)} - Y_2^{r(n + m)})(X_1^{rm} - Y_1^{rm})}{(X_1^{r(n + m)} - Y_1^{r(n + m)})(X_2^{rm} - Y_2^{rm})} = 1\]. Thus, the inequality \[\frac{(X_2^{r(n + m)} - Y_2^{r(n + m)})(X_1^{rm} - Y_1^{rm})}{(X_1^{r(n + m)} - Y_1^{r(n + m)})(X_2^{rm} - Y_2^{rm})} \le t\] holds for any $t \ge 2$ for sufficiently large $s$. \\

Now we turn to the sum $\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -1)^2}$. Let $C(n) = \sum_{k = n}^\infty \frac{1}{f_{rk}(s, -1)^2}$. Note that \\ $\left\lfloor \left(\sum_{k = n}^\infty \frac{1}{f_{rk}(s, -t)^2}\right)^{-1} \right\rfloor = f_{rn}(s, -t)^2 - f_{r(n - 1)}(s, -t)^2 - 1$ if and only if \[f_{rn}(s, -t)^2 - f_{r(n - 1)}(s, -t)^2 - 1 \le \frac{1}{C(n)} < f_{rn}(s, -t)^2 - f_{r(n - 1)}(s, -t)^2\]. \\

The proof that $\frac{1}{C(n)} < f_{rn}(s, -1)^2 - f_{r(n - 1)}(s, -1)^2$ is also very similar to the corresponding proof of Theorem 2. It suffices to show that $1 < C(n)(f_{rn}(s, -1)^2 - f_{r(n - 1)}(s, -1)^2)$. Note that the first term of the product $C(n) f_{rn}(s, -1)^2$ is equal to 1, which we subtract from both sides of the inequality. Now we will compare the term for $k = n + m$ ($m \ge 1$) in $f_{rn}(s, -t)^2 C(n)$ with the term for $k = n + m - 1$ in $f_{r(n - 1)}(s, -t)^2 C(n)$ and see that it suffices to show that

\begin{align*}
0 < \left(\frac{f_{rn}(s, -1)}{f_{r(n + m)}(s, -1)}\right)^2 - \left(\frac{f_{r(n - 1)}(s, -1)}{f_{r(n + m - 1)}(s, -1)}\right)^2.
\end{align*}

From the proof of the first part of the theorem, we have $\frac{f_{rn}(s, -t)}{f_{r(n + m)}(s, -t)} > \frac{f_{r(n - 1)}(s, -t)}{f_{r(n + m - 1)}(s, -t)}$ and we can obtain the above inequality by squaring both sides and setting $t = 1$. \\

Consider the difference between the term for $k = n + m$ in $f_{rn}(s, -1)^2 C(n)$ and the term for $k = n + m - 1$ in $f_{r(n - 1)}(s, -1)^2 C(n)$. After replacing each fraction in the inequality \[\frac{f_{rn}(s, -1)}{f_{r(n + m)}(s, -1)} - \frac{f_{r(n - 1)}(s, -1)}{f_{r(n + m - 1)}(s, -1)} \le \frac{1}{f_{r(n + m - 1)}(s, -1)}\] with its square and clearing denominators, we have

\begin{align*}
f_{rn}(s, -1)^2 f_{r(n + m - 1)}(s, -1)^2 - f_{r(n - 1)}(s, -1)^2 f_{r(n + m)}(s, -1)^2 \le f_{rn + rm}(s, -1)^2.
\end{align*}

If this inequality is satisfied for all $m \in \mathbb{Z}^+$, then the difference between the term for $k = n + m$ in $f_{rn}(s, -1)^2 C(n)$ and the term for $k = n + m - 1$ in $f_{r(n - 1)}(s, -1)^2 C(n)$ is always positive. If it is not satisfied for any $m \in \mathbb{Z}^+$, this difference is always negative. Let $X = \frac{s + \sqrt{s^2 - 4}}{2}$ and $Y = \frac{s - \sqrt{s^2 - 4}}{2}$. Note that $\lim_{s \to \infty} \frac{Y}{X} = 0$. \\

By Lemma 1, we have that \[f_{rn}(s, -1)^2 f_{r(n + m - 1)}(s, -1)^2 - f_{r(n - 1)}(s, -1)^2 f_{r(n + m)}(s, -1)^2 \le f_{rn + rm}(s, -1)^2\] if and only if \[f_r(s, -1) f_{rm}(s, -1) (f_{rn}(s, -1) f_{r(n + m - 1)}(s, -1) + f_{r(n - 1)}(s, -1) f_{r(n + m)}(s, -1))  \le f_{rn + rm}(s, -1)^2\]. This holds if and only if

\begin{align*}
\frac{1}{f_{rn}(s, -1) f_{r(n + m - 1)}(s, -1) + f_{r(n - 1)}(s, -1) f_{r(n + m)}(s, -1)} \frac{f_{rn + rm}(s, -1)}{f_r(s, -1)} \frac{f_{rn + rm}(s, -1)}{f_{rm}(s, -1)} \ge 1.
\end{align*}

We have that $f_n(s, -1) = \frac{X^n - Y^n}{X - Y}$ \cite{ACMS}. Since $\lim_{s \to \infty} \frac{Y}{X} = 0$, we have $\lim_{s \to \infty} f_n(s, -1) = X^{n - 1}$. This means that

\begin{flalign*}
\lim_{s \to \infty} \frac{1}{f_{rn}(s, -1) f_{r(n + m - 1)}(s, -1) + f_{r(n - 1)}(s, -1) f_{r(n + m)}(s, -1)} \frac{f_{rn + rm}(s, -1)}{f_r(s, -1)} \frac{f_{rn + rm}(s, -1)}{f_{rm}(s, -1)} \\= \frac{X^{2rn + 2rm - r - rm}}{X^{rn - 1} X^{r(n + m - 1) - 1} + X^{r(n - 1) - 1} X^{r(n + m) - 1}} \\
= \text{        } \frac{X^{2rn + 2rm - r - rm}}{X^{rn - 1 + rn + rm - r - 1} + X^{rn - r - 1 + rn + rm - 1}} \\
= \text{     } \frac{X^{2rn + rm - r}}{2X^{2rn + rm - r - 2}} \\
= \frac{X^2}{2}.
\end{flalign*}

Since $X^2 > 2$ for sufficiently large $s$, we have

\begin{align*}
\frac{1}{f_r(s, -1) f_m(s, -1) (f_{rn}(s, -1) + f_{r(n + m - 1)}(s, -1))} \frac{f_{rn + rm}(s, -1)}{f_r(s, -1)} \frac{f_{rn + rm}(s, -1)}{f_m(s, -1)} > 1
\end{align*}

for sufficiently large $s$ for all $m \in \mathbb{Z}^+$.

\end{proof}

\section{Periodicity modulo $n$}

Returning to periodicity of generalized Fibonacci sequences modulo $n$, we find a way to interpret the rank of a sequence mod $p$ as the order of an element of the splitting field of the characteristic polynomial of the recurrence in the case where $t = -1$. We also look at possible generalizations for other $t$ where $p \nmid t$ and the rank mod $p^k$.

\begin{thm}
Let $X = \frac{s + \sqrt{s^2 - 4}}{2}$, $Y = \frac{s - \sqrt{s^2 - 4}}{2}$, and $D = s^2 -4$ be the discriminant of the characteristic polynomial of the recurrence with $D \not\equiv 0$ (mod $p$). If $(D/p) = 1$, then $r(p) = \frac{1}{2} ord(X)$ in $\mathbb {F}_p^{\times}$ if $ord(X)$ is even and $r(p) = ord(X)$ if $ord(X)$ is odd. Otherwise, we have that $r(p) = \frac{1}{2} ord(X)$ in $\mathbb {F}_{p^2}^{\times}$ if $ord(X)$ is even and $r(p) = ord(X)$ if $ord(X)$ is odd.
\end{thm}

\begin{proof}
Consider the matrix for the recurrence $U = \begin{pmatrix} s&t\\ 1&0 \end{pmatrix}$. Note that multiplying $U$ by $\begin{pmatrix} f_n(s, -1) \\ f_{n + 1}(s, -1) \end{pmatrix}$ gives $\begin{pmatrix} f_{n + 1}(s, -1) \\ f_{n + 2}(s, -1) \end{pmatrix}$. If $(D/p) = 1$, we can consider the eigenvalues $X$ and $Y$ in $\mathbb{F}_p$. Since $D \not\equiv 0$ (mod $p$), the eigenvalues of the matrix $U$ are distinct and $U$ is diagonalizable. Thus, we can write $U = C \begin{pmatrix} X & 0 \\ 0 & Y \end{pmatrix} C^{-1}$ or $U = \begin{pmatrix} Y & 0 \\ 0 & X \end{pmatrix}$, where $C$ is an invertible matrix. This means that the rank is the smallest positive integer $h$ such that $U^h = \lambda I$ for some $\lambda \in \mathbb{F}_p$. In terms of the eigenvalues, it is the smallest positive integer $h$ such that $X^h = Y^h$ in $\mathbb{F}_p$. Since $X$ and $Y$ are roots of $x^2 - sx + 1$, we have that $XY = 1$. So, we can rewrite $X^h = Y^h$ as $X^h = X^{-h}$ and get $X^{2h} = 1$ in $\mathbb{F}_p$. So, $r(p) = \frac{1}{2} ord(X)$ if $ord(X)$ is even and $r(p) = ord(X)$ if $ord(X)$ is odd. \\

We can use a similar argument for the case where $(D/p) = -1$. However, $X$ and $Y$ cannot be considered in $\mathbb{F}_p$, so we look at the splitting field $\mathbb{F}_{p^2}$ of the characteristic polynomial instead. Note that $X$ and $Y$ are also distinct in $\mathbb{F}_{p^2}$ since $X^p = Y$ in $F_{p^2}$ and $Y \notin \mathbb{F}_p$. Using the same steps as above, we find that $r(p) = \frac{1}{2} ord(X)$ in $\mathbb F_{p^2}^{\times}$ if $ord(X)$ is even and $r(p) = ord(X)$ if $ord(X)$ is odd.
\end{proof}

\begin{rem}
The use of the splitting field of the characteristic polynomial in the proof of this theorem is similar to its use in \cite{GRS} to study periods of generalized Fibonacci sequences.
\end{rem}

\begin{rem}
The rank of generalized Fibonacci sequences is a special case of the restricted period of a general linear recurrence (see \cite{EPSW} for a definition).
\end{rem}

We now look at the distribution of $r(p)$ over different values of $s$. \\

\begin{center}
\begin{figure}
\caption{A plot of $r(31)$ for various values of $s$ when $t = -1$. Since the sequence starts with $0, 1, s, \ldots$, the terms of the sequence mod $p$ depend only on the residue of $s$ mod $p$. In addition, only $\frac{p - 1}{2}$ of the residues need to be considered since the terms of $f_n(-s, 1)$ mod $p$ are either identical or of opposite sign, which does not change the rank of the sequence.}
\begin{tikzpicture}
		\tikzstyle{every node} = [font = \large]
	\begin{axis}[xlabel={$s$}, ylabel={$r(31)$}
	clickable coords={(xy): \thisrow{label}}
	scatter/classes=
		a={mark=*,black}
		b={mark=triangle*,red}
		c={mark=o,draw=black}}]
	\addplot[scatter,only marks
		scatter src=explicit symbolic
	table[meta=label] {
x     y      label
1			3				a
2			31			a
3			15			a
4			16			a
5			8				a
6			15			a
7			15			a
8			4				a
9			16			a
10		16			a
11		16			a
12		5				a
13		5				a
14		8				a
15		15			a

	};
	\end{axis}
\end{tikzpicture}
\end{figure}
\pagebreak
\end{center}

As we can see above for $p = 31$, there is a large amount of clustering around $\frac{p \pm 1}{2}$ for primes $p$. This can be understood using the distribution of orders of elements of finite abelian groups since $r(p) = \frac{1}{2} ord(X)$ or $r(p) = ord(X)$ in $\mathbb{F}_p$ or $\mathbb{F}_{p^2}$. In the case where $(D/p) = 1$, we are looking at the orders of elements of the cyclic group $\mathbb{F}_p^{\times}$. Take a generator $x$ of $\mathbb{F}_p^{\times}$ and a divisor $d$ of $p - 1$. Then, $x^k$ is of order $\frac{p - 1}{\text{gcd($p - 1$, $k$)}}$. So, there are $\varphi(d)$ elements of order $d$. Since $\varphi(m) \le \varphi(n)$ for all $m | n$, this means that there are generally more elements which are of higher order than lower order although $\varphi(n)$ does not increase monotonically. Since we have that $X^{p - 1} = 1$ in $\mathbb{F}_p$, the order of $X$ divides $p - 1$ and the previous statement applies. In the case that $ord(X)$ is odd, $ord(X) \le \frac{p - 1}{2}$ and we can repeat the observations which we made earlier. \\

If $(D/p) = -1$, we can consider the order of $X$ in $\mathbb{F}_{p^2} = \{a + bX: a, b \in \mathbb{F}_p\}$. Since $X^p = Y$ in $\mathbb{F}_{p^2}$ and $XY = 1$, we have that $X^{p + 1} = 1$ in $\mathbb{F}_{p^2}$ and $ord(X) | p + 1$. In addition, $\mathbb{F}_{p^2}^{\times}$ is cyclic since multiplicative subgroups of finite fields are cyclic. As above, we have that the number of elements of order $d$ is $\varphi(d)$ and $\varphi(a) \le \varphi(b)$ for all $a | b$. This means that the largest number of elements have order $p + 1$ among elements whose orders divide $p + 1$. \\

Making more precise statements about the rank mod $p$ would involve looking at the order of an element in the multiplicative groups for the fields $\mathbb{F}_p$ and $\mathbb{F}_{p^2}$ more closely. In addition, we have yet to determine a relationship between $s$ and the rank. \\

Since the rank mod $p^k$ exists if and only if $p \nmid t$, it is possible to generalize the order arguments above for other $t$ not divisible by $p$. The more interesting generalization relates to rank modulo general prime powers $p^k$. In this case we would consider the order of $X$ in $\mathbb{Z}_{p^k}^{\times}$ or in $\mathbb{Z}_{p^k}[X]^{\times}$. Finding the order would be more complicated than for $r(p)$ since $\mathbb{Z}_{p^k}$ is not a field for $k > 1$. However, we can still find an upper bound for $r(p^k)$ using a counting argument. \\

\begin{thm}
For any $s, t \in \mathbb{Z}$ with $p \nmid t$, we have that $r(p^k) \le p^k + 1$.
\end{thm}

\begin{proof}
Note that we can divide the set of possible pairs of terms modulo $p$ into equivalence classes where two pairs $(a, b)$ and $(c, d)$ belong to the same equivalence class if and only if $(c, d) \equiv (ka, kb)$ (mod $p$) for some $k$ such that $p \nmid k$. We claim that all pairs of consecutive terms $(f_n, f_{n + 1})$ with $n < r(p^k)$ belong to different equivalence classes. Assume that this is not the case. Then, there are two pairs $(a, b)$ and $(ka, kb)$ when considered modulo $p$ with $k \not\equiv 0,1$ (mod $p^k$). Since none of the terms of the sequence between $(a, b)$ and $(ka, kb)$ are divisible by $p^k$ and the terms following $ka$ are those following $a$ multiplied by $k$, there are no nonzero terms of the sequences considered modulo $p^k$ other than $f_0(s, t)$. However, this is a contradiction since $r(p^k)$ exists. This means that there are no such pairs $(a, b)$ and $(ka, kb)$ before $f_{r(p^k)}$. Note that sets of pairs of the form $(ka, kb)$ form an equivalence class. Since a single equivalence class contains $p^k - 1$ elements and each term of the sequence before $f_m$ must come from distinct equivalence classes, we have that $r(p^k) \le \frac{(p^k)^2 -1}{p^k - 1} = p^k + 1$.

\end{proof}

Note that it suffices to look at $r(p^k)$ in order to understand $r(n)$ for any $n \in \mathbb{N}$ by the following theorem, which we can obtain by considering the matrix $U$ in the proof of Theorem 19.

\begin{thm} [Robinson] \cite{Ro}
Let $m_1, m_2$ be positive integers greater than or equal to 2. Then we have that and $r([m_1, m_2]) = [r(m_1), r(m_2)]$.
\end{thm}

It would be interesting to find a relationship between $r(p^k)$ and $s$ for a given value of $t$ and adapt methods used above for general linear recurrences.

\begin{comment}
\begin{thm} [GRS] \cite{GRS}
Let $p$ be an odd prime and $D = s^2 + 4t$ with $D \not\equiv 0$ (mod $p$). If $(D/p) = 1$, $k(p) | p - 1$. Otherwise, we have that $k(p) | 2(p + 1) \cdot ord_p(t^2)$.
\end{thm}

\begin{proof}
Consider the matrix for the recurrence $U = \begin{pmatrix} s&t\\ 1&0 \end{pmatrix}$. We want to find the smallest $n \in \mathbb{N}$ such that $U^n \equiv I$ (mod $p$). If $(D/p) = 1$, the eigenvalues of this matrix are in $\mathbb{F}_p$ and we have that $U^{p - 1} \equiv I$ (mod $p$). If $(D/p) = -1$, then the eigenvalues cannot be considered in $\mathbb{F}_p$. Thus, we consider the field extension $\mathbb{F}_{p^2} = \{a + b\gamma : a, b \in \mathbb{F}_p \}$, where $\gamma$ is a root of the characteristic polynomial of the recurrence. For more details, see \cite{GRS}.
\end{proof}

Similar ideas as those used for this proof can be used to relate the rank to the period and the rank and period of different moduli to each other.

\begin{thm}[Robinson] \cite{Ro}
If $D \not\equiv 0$ (mod $m$), $U^{r(m)} \equiv s(m) I$ (mod $m$), and $\beta(m)$ is the order of $s(m)$ modulo $m$, then $r(m)\beta(m) = k(m)$.
\end{thm}

\begin{thm} \cite{Ro}
Let $m_1, m_2$ be positive integers greater than or equal to 2. Then we have that $k([m_1, m_2]) = [k(m_1), k(m_2)]$ and $r([m_1, m_2]) = [r(m_1), r(m_2)]$.
\end{thm}

Note that the second theorem of Robinson implies that it suffices to examine the rank or period modulo prime powers in order to find the rank modulo $n$ for any positive integer $n$. \\

More specific conditions for the period of generalized Fibonacci sequences than those mentioned above can be obtained using methods which were used to study the periodicity modulo $n$ for general linear recurrences. For example, one method involves considering operators on sequences satisfying a particular linear recurrence $f_{n + k} = a_1 f_{n + k - 1} + \ldots + a_k f_n$ with $a_i \in \mathbb{Z}$ (see \cite{Ha} and \cite{Wr}). The three main operations considered were sums of sequences $(v_n) + (w_n) = (v_n + w_n)$, scalar products $t(v_n) = (tv_n)$ with $t \in \mathbb{Z}$, and the shift operator $x(v_n) = (v_{n + 1})$. These operators can be combined to form a ring $R(x)$ of polynomial operators. For example, if $g(x) = x^k - a_1 x^{k - 1} - \ldots - a_k$ is the characteristic polynomial for the recurrence, we have that $g(x) (v_n) = (0)$ for any sequence $(v_n)$ satisfying the recurrence. \\

In addition, there is an isomorphism between the ring of operators $R(x)$ and the set of sequences satisfying the recurrence.

\begin{thm}[Hall] \cite{Ha}
There is an isomorphism between the sequences satisfying the recurrence $f_{n + k} = a_1 f_{n + k - 1} + \ldots + a_k f_n$ and $R(x)$ modulo $f(x)$, which is the characteristic polynomial of the recurrence. The correspondence is as follows: $1 \longleftrightarrow (w_n)$ and $h(x) \longleftrightarrow (w_n)$, where $(w_n)$ is the $\emph{unit sequence}$ defined by $w_0 = \ldots = w_{k - 2} = 0$ and $w_{k - 1} = 1$. For an arbitrary sequence $(v_n)$ satisfying the recurrence, we have $(v_n) \longleftrightarrow V(x) = v_0 x^{k - 1} + (v_1 - a_1 v_0)x^{k - 2} + \ldots + (v_{k - 1} - \ldots - a_{k - 1} v_0)$.
\end{thm}

There is a method using this isomorphism which can be used to determine the period modulo $n$ for a general linear recurrence and find a graphical interpretation for it (see \cite{Ha} and \cite{Wr} for more details). We can also use this isomorphism to rephrase the question of finding the rank in terms of these polynomial operators. We note that the rank is a special case of the restricted period of the sequence over mod $n$.

\begin{defn}
Given a sequence $(u_n)$, the $\emph{restricted}$ period is the smallest number $h$ such that there exists $\lambda$ such that $u_{r + h} = \lambda u_r$ for all sufficiently large $r$.
\end{defn}

If the $r(n)$ exists for some unit sequence (same definition as before, just change order of recurrence), then it is the restricted period of the sequence over mod $n$. Applying the isomorphism between the polynomial operators and sequences satisfying the linear recurrence, we hve the following.

\begin{thm}
If the rank exists for a sequence $(u_n)$ satisfying the linear recurrence, then $r(p^j)$ is the smallest $h \in \mathbb{N}$ such that there exists $\lambda \in \mathbb{N}$ such that $U(x)(x^h - \lambda) \equiv 0$ (modd $p^j, f(x)$), where $U(x)$ is the polynomial corresponding to the sequence $(u_n)$ in the isomorphism above.
\end{thm}

\begin{proof}
If $r(p^j)$ exists, it is the smallest $h \in \mathbb{N}$ such that there exists $\lambda$ with $u_{r + h} \equiv \lambda u_r$ (mod $p^j$) for all $r \in \mathbb{N}$. Writing this relationship in terms of polynomial operators, we have that $x^h U(x) \equiv \lambda U(x)$ (modd $f(x), p^j$) $\Rightarrow U(x)(x^h - \lambda) \equiv 0$ (modd $p^j, f(x)$), where $U(x)$ is the polynomial corresponding to the sequence $(u_n)$.
\end{proof}

We have the following corollary for the generalized Fibonacci sequences since they are the unit sequences for linear recurrences of order 2.

\begin{cor}
If the $r(p^j)$ exists, it is the smallest $h \in \mathbb{N}$ such that there exists $\lambda$ with $x^h - \lambda \equiv 0$ (modd $p^j, x^2 - sx - t$).
\end{cor}

When the rank does exist, we could use methods similar to those used in \cite{Wr} and \cite{Ha} to find a method to determine the rank of generalized Fibonacci sequence modulo $n$. It would be interesting to find a graphical interpretation for the rank modulo prime powers as done for the period modulo prime powers in \cite{Ha}.

\end{comment}

\section{Acknowledgements}
This research was conducted at the University of Minnesota Duluth REU program, supported by NSF/DMS grant 1062709 and NSA grant H98230-11-1-0224. I would like to thank Joe Gallian for his encouragement and creating such a great environment for research at UMD. I would also like to thank Krishanu Sankar and Sam Elder for their help with my research. I would especially like to thank Brian Chung for very helpful discussions at various points of this project.


text:
Was Kudankulam attacked: The real threat India's nuclear plants face
Bengaluru, First Published 30, Oct 2019, 3:02 PM IST
The Kudankulam nuclear plant is back in the news today. Amidst reports of a cyber-attack, the plant denied rumours. A statement by the Training Superintendent and Information Officer R Ramdoss said that some false information is being propagated on social media platforms, electronic and print media.
Foreign funded NGOs and those with a Leftist leaning have always tried to sabotage the clean energy that India has been producing. In June 2014, the Intelligence Bureau had spoken about the presence of thousands of NGOs that were operating within India, in a bid to hamper both social and economic development.
It was in that report the IB had spoken about the interference by NGOs in the Kudankulam nuclear plant in Tamil Nadu. In its report to the Union Home Ministry, the IB had spoken about a foreign funded NGO that was orchestrating the protest by the villagers. The first time this was pointed out was when the UPA was in power. The UPA just made a statement and did not take any further action, but after the Narendra Modi government took over, the crack down on the NGOs began.
Also read: UCC: Rajiv Gandhi backed out, Modi won't; Time has come to divorce law from religion
The Kudankulam nuclear plant is back in the news today. Amidst reports of a cyber-attack, the plant denied rumours. A statement by the Training Superintendent and Information Officer R Ramdoss said that some false information is being propagated on social media platforms, electronic and print media with reference to a cyber-attack on the Kudankulam nuclear plant. This is to clarify Kudankulam nuclear plant and other Indian Nuclear Power Plants Control Systems are stand alone and not connected to outside cyber network and internet. Any cyber-attack on the Nuclear Power Plant Control System is not possible. Presently KKNPP Unit-1&2 are operating at 1000 MWe and 600 MWe respectively without any operational or safety concerns.
The origin of the information:
Pukraj Singh, who was part of the team that set up the National Technical Research Organisation said on Twitter, "so it is public now. Domain controller level access at the Kudankulam nuclear plant. The government was notified way back. Extremely mission-critical targets were hit."
After an official denial was issued, Singh tweeted, "seeing the KKNNP's press release, I would like to add that I notified Lt. Gen Rajesh Pant (National Cyber Security Coordinator) on September 4. Follow up emails were exchanged, acknowledging the issue. I would solicit no further enquires on the matter, requesting privacy."
On October 28, a link to a report on VirusTotal.Com was posted on Twitter. It said that a form of malware known as DTRACK had been found in the assessment by VirusTotal. Kaspersky, a cyber security firm had in September said that they had discovered DTRACK in Indian Financial Institutions and Research Centres. This form of spyware was created by the Lazarus group and is being used to upload and download files to the systems of victims, record keystrokes and conduct other actions typical of a malicious remote administration, Kaspersky also said.
Can the plant come under a cyber-attack?
The official release by the KKNNP said that the systems are not connected outside cyber network and internet and hence any cyber-attack on the plant is not possible. Owing to the huge security risk, the control systems of nuclear power plants are run on air-gapped networks.
This would mean that the internal networks are not connected to the outside networks and the internet. While this makes it not possible to attack, an attack is however possible, if the systems are infected by malware from inside the plant.
Due to these reports there have been questions on why the plant had been shuttered last Saturday. Officials say that this was due to the reduced water flow into the steam generator, which was due to a mechanical issue. The official said that it was restored in two days.
Moments after the news broke out, district officials at Tirunelveli checked with the plant and were told that the reports were false.
The larger concern for India's Nuclear Plants:
Strictly speaking, all nuclear plants in India are unsafe. India needs clean and cheap energy and there are lobbies which will try and beat down such attempts. Their biggest worry is that India will enrich the uranium.
Saudi Arabia today is warming up to us because we are keen on moving towards electric vehicles. They want a foot in our oil requirements.
There are several lobbies and foreign funded NGOs who do not want us to be self-sufficient. When the scenario is such there are bound to be attempts to either try and sabotage operations or stage protests so that these plants do not function. India should not relent and must understand that we cannot build our nation without power and energy.
Now coming to Kudankulam, there have always been problems. The lobby pushed very hard to ensure that the plant did not become functional. There is always a threat to such installations says, former Research and Wing Officer, Amar Bhushan.
He tells MyNation that all the energy plants are very heavily guarded. They are not just secured by guards, but also by intelligence agencies. This is because the threat is always there, he says.
In the current case, I would like to say that it would be difficult to attack the plant. However, the leftist set up will always try and agitate and try and hamper operations, Bhushan further adds. They would always try and rake up environment and safety issues and this is what we must be careful about as the sabotage attempt would always be there, Bhushan also points out.
In this context one must also take a look at the construction of the Nuclear Power Plant in Haryana. The 700megawatt nuclear plant being constructed at the Fatehbad district of Haryana is being delayed reportedly due to the meddling by some foreign funded NGOs.
A report in the Sunday Guardian said that the project is behind schedule.
The NGOs are stoking fear among the locals that their only source of water in the area will be used up by the plant. The issues and concerns that were raised have already been addressed by the Nuclear Power Corporation of India. The report while quoting officials said that similar protests had been witnessed by vested interests to sabotage the Kudankulam nuclear plant.
To fund these NGOs and stage protests, the amount of money that had been pumped in was obscene. The 2014 IB report mentioned above had said that the US would pump in Rs 3,838 crore annually. UK on the other hand pumped in Rs 1,219 crore, followed by Germany at Rs 1,096 crore. Italy and Netherlands would pump in Rs 528 crore and Rs 418.3 crore annually. The report also said that while there were 85,000 NGOs, the activities of 30% of these organisations were found to be suspect.
Kudankulam nuclear plant
R Ramdoss
nuclear plants
cyber-attack
Kashmiriyat and its misuse as Islamiyat: How Abrogation of Article 370 has righted the wrong
A strong and effective Sedition law? India needs it more than any other country
From Pakistan to Italy, NIA unearths transnational conspiracy in killing of RSS leader Brig (Retd) Gagneja
Illegal Bangladeshis in South India are real, ticking time bombs
Radicalisation of South India by Wahhabis who came and went before we knew it

redpajama_set_name: RedPajamaCommonCrawl


All of ATI's Radeon 5000-series videocards draw from a family of GPUs called 'Evergreen', which is then divided into a smaller GPU lines based on performance.
The fastest line is code named 'Cypress', which is itself broken up into smaller segments based on speed tolerances and how many functional shader processors. This is a practice called "binning" in the tech industry.
Only the 'Cypress' chips that have all 1600 stream processors functioning properly and are completely stable at 850MHz are used in Radeon HD 5870 graphics cards.
The RV850 'Cypress' GPU is produced on a 40nm production process that ATI first introduced in the Radeon 4000-series. Getting down to a 40nm process was important because the Radeon HD 5870 has 2.15 billion transistors on a 334mm2 die, more than double that of last generation's RV770, which had 956 million transistors.
This wealth of transistors comprise the Radeon HD 5870's 1600 stream processors, 80 texture units, 32 raster operators and the 256-bit wide memory interface that connects the RV870 GPU to its GDDR5 memory.
Stock Radeon HD 5870 videocards have 1GB of GDDR5 memory clocked at 1200MHz, however Gigabyte has bumped this speed up 1250MHz, which is then GDDR5-quad-pumped up to an even 5GHz.
All of AMD's Radeon 5000-series of graphics cards share a number of new technologies, the most important of which is support for DirectX 11. This latest revision to Microsoft's graphics hardware standard brings two major additions to the DX11, tessellation and compute shaders.
Tessellation is a method of adding density and complexity to a 3D mesh. It can take a simple, low-poly model and break up the geometry into more complex portions, adding another layer of detail on top of a mesh. The end result is better looking, more detailed graphics with a very low cost in performance.
Compute shaders allow DirectX 11-based GPUs to do tasks normally reserved for CPUs. This will play a big role in desktop applications that harness the power of a PCs videocard, as well as enable games programmers use the GPU to compute things like physics and AI. Again, this opens up the possibility for more immersed gaming, but with a miniscule performance penalty when compared to using a CPU. Now let's see just how well ASUS' EAH5850 DirectCU TOP stands up to a little overclocking... but first, power draw.
Here's how this videocard stacks up in real life against a various other videocards for power draw. PCSTATS measures total system power draw and compares that in 3D loaded (max value recorded in 3DMark06) and idle states (at Windows desktop). The power supply used in each test is an A-PFC compliant PC Power and Cooling 750W model.
Even with factory overclocking, more transistors and more shader processors than any other single-GPU videocard in this chart, Gigabyte's GVR587SO-1GD videocard is actually quite energy efficient thanks to be produced on a 40nm production process. The videocard draws 217W under load, less than a Radeon HD 4890. At idle power draw is 109W for the entire test system, which is closer to what you find from economical low wattage videocards, rather than the power guzzling extremism you'd expect from high end videocards.


Want to free up more time this busy season? You could stop showering. Or ban March Madness? But what about something more effective and less offensive, like eliminating dozens of back and forth emails by implementing meeting scheduler software?
A few months ago, a friend told me she was using a meeting scheduler app. Instead of exchanging a series of messages back and forth with her clients on when they should talk, she sent them a link and they booked their call with her.
This sounded nice, but I worry about client service. I want my clients to feel like they're getting white-glove service, personal attention and all of those exceptional levels of quality that I associate with my brand. I wasn't sure sending them a link to DIY the scheduling dirty work was the right answer for me.
Your contact replies and says that none of those times work. They have come up with three alternatives (8 minutes of their own time). You check your calendar and find that one works for you (3 minutes).
You reply by email to tell them that Tuesday at 4pm would be great. (2 minutes) Add two more minutes if you reply to the email separately from creating a calendar invitation.
So we're at 10-15 minutes of time spent scheduling this meeting. Not counting the inefficiency of having to stop what you're doing to answer or send another email, and the marinating time while you wait (and inadvertently book over) the times you suggested to begin with.
Multiply 15 minutes by the number of meetings you book each week and the result is an intriguing amount potential time savings. Even if you're only booking 4 - 5 external meetings a week, that's a full hour of time.
Scheduling apps are simple for clients to use, and allow you to set all of the parameters you need to be sane: working hours, buffer times, meeting durations, and they sync bank and forth with your calendar real time so there's never a double-booking. One hour a week of time savings x 15 weeks = 15 hours of time you can now focus on highest and best use activities, rather than the easily-automated task of scheduling a meeting.
For sole practitioners and small practices with a primary point of contact can embed a scheduling tool on your website. You can check out how I've done that here.
I currently use ScheduleOnce and the time savings more than covers the $20 monthly fee to connect it to Outlook. Many other apps that have similar features, so find the one that works for your needs (here is a list to start with). And as they say, 15 minutes (setting up a meeting scheduler app) could save you 15 hours of time…in perpetuity.
This article was also published in AccoutingToday.


I have been working on a .NET project that needed to send email notifications via an SMTP server. It worked just fine, but sometimes the notifications just did not arrive. The cause was simple, but also annoying: when the SmtpClient could not reach the server (for any reason), there was no means to postpone the operation and try to re-send it later. Thus an exception was thrown, and the message abandoned.
Then I searched the web for a suitable solution, but found only fragments of what I imagined. One of these is the article by Amol Rawke Pune: Use of MSMQ for Sending Bulk Mails .
It is mainly a proof of concept, but I have to admit, this article was the starting point for me. After some Googling, I found a great solution  for the first one - which I incorporated in my solution after some minor adaptation. I also used the ideas of Mark Gravell  of making the service installer not to depend on installutil.exe.
I also found Rami Vemula's work  which is a great demonstration of how MailMessage can be populated with rich content. Thus it was ideal for me to test the abilities of serialization and of the solution itself.
So thanks to these good people for their contribution. All the other things I had to come up with myself... but it was fun, and I hope it will be of use for many.
Message queue is a very basic concept of Windows. The so-called MSMQ (Microsoft Message Queuing) technology is not new, and is a really useful and rock solid IPC (Inter-Process Communication) tool - able to transaction ally communicate even between hosts over a network.
It has its own limitations, first of all, there is a limit of 4MB for messages. Considering the overhead of serialization, Unicode, and so on, we have to deal with even smaller messages. Well, I have to live with this - but I never intended to send large files.
Where Are the Message Queues?
Well, it is that simple on a Windows 2008 Server. But you will probably not find it on Windows 7. You will have to install Message Queuing service. It is (a standard) Windows component, so it's not a big deal.
As any other object since Windows NT, message queues have ACL-s (Access Control List). I will come back to this one later, since it can be tricky.
I will start with this later one shortly.
What About the Error Conditions?
Well, my approach was to treat the queue not like a regular FIFO storage - MSMQ has the tools to do it. I am using a property of the message object to set up a TTL-like counter (Time To Live), and a property to store a schedule timestamp. When a message is posted, the TTL counter is set to a user-defined value, and the timestamp to the current one. The service will use the timestamp to pick only the messages that are "expired" - every message starts its life as expired. If a possibly recoverable error condition arises during email sending, a message is re-posted in the queue and re-processed after a predefined waiting time. Every time a message is re-posted, the TTL is decreased. If the TTL is consumed, the message is abandoned. While a message is waiting to be re-processed, other messages can be processed.
Serialization is something very important if we want to create distributed applications. I think actually any class should be serializable - but they are not. Well, System.Net.Mail.MailMessage is not serializable by default.
Actually, SmtpClient uses some sort of serialization to save messages in .elm format (see this article), but it would be a lot of work to make MailMessage again from such an RFC compliant file - and a lot of unnecessary overhead too.
The author of  created a serializable class that encapsulated a small subset of MailMessage properties. But in the blog-post , we can see a complete binary serializable replacement (SerializeableMailMessage) of the original class.
Since MailMessage has lot of properties of different unserializable types, the author implemented the SerializeableMailAddress, SerializeableAttachment, SerializeableAlternateView, SerializeableLinkedResource, SerializeableContentDisposition, SerializeableContentType, and SerializeableCollection classes.
My version is an adaptation of it to .NET 4.0, I have changed to generic collections, and so on. Great stuff after all, but if you find something missing, he is to blame :). No, actually, since I intend to use this in real-life applications, any comment is appreciated.
This piece of code is intended to be called by the application willing to send a mail. It contains a MailSender class. When constructed, it tries to attach to the MSMQ specified in the constructor parameter. If it does not exist, the construction is aborted.
Oh, and by the way, there is logging all around the code: you will need to install NLog if you want to compile the code. Logging is a must even in production environments, and with NLog, you need only to change a configuration file to have the logs where you want them: one logger for all purposes. Really.
But I will omit logging statements in this article when possible.
If construction is successful, you may call the QueueMessage method.
The Extension property is a byte array, so I had to convert the current timestamp to bytes. I am using UTC to be sure to have the same time on both sides, if producer and consumer are not on the same host.
A queue can be set up to require authentication to access it. Only in this case are the ACL-s of the queue effective. I have not tested it yet, but it seems that authentication is working only in AD environments. Well, the code is prepared.
Let's talk first about the service installer. I wrote earlier that I have adopted a solution  to get rid of installutil.exe and to have the possibility to run the service application as a regular console application. This little trick is really useful during debugging.
// run service as network service... remember the ACL-s!
So if you want to install the service, just call MSMQ_MailRelyService.exe -i as administrator. To debug, just add -c as a command line argument in the Debug page of the application properties, and run it from the IDE.
Next, I will talk about the service itself. For the complete source code, please browse the code here or download it.
Remember: You may create the queue manually, but do not forget to set up the ACL. By default, everyone can post messages in the queue, but retrieving from it requires rights granted. The creator will have this by default. So if the service creates it, it will work just fine, but you need to take ownership to be able to manipulate the ACL or any other property via the MMC plug-in. If you create the queue, you have to grant necessary rights to the user running the service.
As extension methods are great things, I wrote one to get the next message to be processed. The method will traverse all messages in the queue, and take all eligible ones according to their schedule timestamp. From those eligible ones, the method will pick the oldest one, and return its ID. If no eligible message is found, the method will return null.
// have we found a message to be processed?
It might be worth reviewing error conditions where retries are applied. Actually, it depends on the SMTP server and the addresses.
The service has several settings stored in the app.config. The defaults might be suitable for you, but you may change them as you like.
First of all, we have the queue name. As this is the service, using a local private queue is straightforward. Technically, a public queue could also be used.
The delayed time in seconds in case of an SMTP error.
See MSDN for future details.
I will not say much about this one, the code will be self-explaining. As I mentioned earlier, I have adapted  to have a nearly complete feature-test.
I think this solution can be used as is in a real-life application. I have tried to deal with as many situations that must be handled as possible. I think MSMQ has even more possibilities to be explored in such an application, like using report typed messages and administration queues to give asynchronous feedback to the sender, introducing some timeouts. As I will test it in an AD environment soon, I will come back and update the article with my findings.
Will conclude my project nicely and should be easily adapted for SMS too.
Excellent article Zoltan. Works straight from the download - but there is one change I would like to make. I want to read the SMTP parameters from a database table. However I cant find where you are taking them from the app.Config. Is that something the SMTPClient has built in?
You won't find any code rows in my application retrieving those settings since the framework does it. It is a built-in feature. However, if you omit this section you can simpy do it from code.
Just add the necessary parameter assignments according to MSDN[^] description after the SmtpClient instantiation.
I expect success, perhaps after a few adjustments.
Yes, that will do it. Please note, that SmtpClient is IDisposable, thus in my code it is in a using statement.
Got it. Very little trouble. The credential including encrypted password are coming back as expected from a MySQL database.
It is not quite clear what your actual problem is. Do you see the result correctly if you attach the same image from local file system? As I mentioned in my article, the serializer is not my original work  it was adapted only to a higher .net version, and was not fully tested in all situations. Still, if the demo code is working for you, might happen, that the download part is not correct. As a first step try to download the image in a temporary file, and link that file as resource - but also try to open the file with a viewer to see if it is properly downloaded or not.
and your article builds on it very nicely. I appreciate you publishing this article.
Hi, I want to display the content of a directory (directory contains text files only) in a dropdown combobox or list box in an html page.so the listbox or dropdown box will contain the filenames only.i can use perl script if needed.. i am using unix server. Is there a way to do this?? plz if you hav a way..
How is this question related to my article? I think you should post this as question in the "quick answers" section. I am pretty sure, the community will be able to help you. But you should give more details there about your environment and constraints, as you gave here. Good luck.
good article about use of msmq.
I wasn't able to find where it has been used.
The code line you have quoted above is the one reading out the scheduled time.
This code line is scheduling the retry by adding a specific amount of time and putting the message back into the queue.
Could you please help me make the connection between the two code files?
Specifically, how does calling MSMQ_MailRelyService.exe -i (on cmd.exe I am guessing) execute the code in MSMQ_MailRelyServiceInstaller.cs? I looked at the MSMQ_MailRelyService.cs code, and it does not seem like it takes the '-i' argument. Thank you.
The MSMQ_MailRelyServiceInstaller.cs contains the service installer. But this one is the entry point for the service executable also. The service itself (from MSMQ_MailRelyService.cs) is only instantiated by it, or passed to the infrastructure to be registered. It looks a little bit confusing, because not the service class is the service executable, and the executable has multiple aspects (installer/uninstaller/console mode/hosted service executable). But this is a common behavior in case of windows service architecture.
I recently had to write a mail relay service using MSMQ. I was able to take your article and adapt it to my needs, adding WCF support. I rewrote some of the code to use interfaces instead of concrete classes. I also broke your serializer classes into separate files and adapted them for my needs.
Unfortunately I cannot share the code that I modified.
Re: Just what I was looking for!
I am glad I have helped you.


No one said hardware was easy business. Microsoft may have just made official the second generation Surface slates yesterday at an event in NYC, but the company is already planning well ahead.
Well ahead, in this case, being the next three Surface generations.
Panos Panay, the head of the Surface unit at Redmond, explained during the event that the company is already thinking about is future models, and is now working on plans for the next three generation of its flagship Windows powered tablet.
Details, as you would expect, have not been provided.
But when it comes to release dates, it is reasonable to expect yearly updates to the Surface family. Considering the fact that the second generation slates are hitting the store shelves approximately a year after the first model, the third generation device could be here late 2014.
And at least in the case of the Surface Pro, the third generation model could be powered by Intel CPUs based on the company's Broadwell microarchitecture — which is the successor to Haswell.
In any case, this is as good a proof as any that Microsoft is fully and completely committed to its hardware plans. The news may not be all too rosy for some hardware companies that like to slack around, but Redmond is nevertheless going all out on hardware.
But then again, most hardware partners like Acer, ASUS, Dell, Lenovo, HP, even Sony are bringing out their own Windows tablet goodies in the coming months, and most seem to be well designed, and with pretty exciting price tags to match.
What this ultimately means is that good times could soon be rolling in for Windows powered hardware.


Many of our participants dream of playing their respective sport at the next level. For some, that dream has been with them for many years while for others they may begin to look at the possibility of college athletics as their high school career progresses to their junior and senior years. Either way, the Athletics Department of the Upper Dauphin Area School District encourages our participants to strive for attaining the next level. However, it is important for all participants to realize that playing college athletics is a challenging venture that requires a lot of effort and dedication both on and off the field, court or mat (even more so than high school athletics). In addition, each participant must understand that the National Collegiate Athletic Association (NCAA) requires prospective college student-athletes to achieve certain academic requirements prior to participation at the collegiate level. It should be noted that certain math courses taken at Upper Dauphin Area are not accepted by the NCAA for meeting mathematics guidelines. Athletes wishing to compete at the next level should meet with the guidance counselors and Athletic Director to ensure that NCAA academic requirements are being met and to ensure that they understand the process that is involved.
If you feel passionate about playing a college sport, contact your schools' guidance counselor and athletic director and allow them to guide you through the beginning stages of becoming a college athlete.
Becoming a college student-athlete is a process. It begins with pre-recruitment and extends into your first year of college. The Playing College Athletics section contains a description of the process required as well as some tips and guidelines to consider as you go through the process.
The information contained in the Related Information section contains additional information for those planning to become student-athletes in college. Each link is related to one of the key areas identified in the Playing College Athletics section.
The most exhausting part of playing college athletics is often figuring out where to start. It begins with pre-recruitment and figuring out what you truly want to do in your future. You have to make challenging decisions that will impact your life for years to come. The most effective strategy to use is asking yourself questions that need to be answered. What are you best at? Do you enjoy it? Could you see yourself doing it for years to come? Finding these answers may not be easy, but they're essential for you to make those difficult decisions in your near future.
Even if you view being an athlete as the most important aspect of college, deciding on your major is still the most prominent decision you'll make that will affect your college career. Research the career path you would like to take in life, and figure out which major is recommended. If your dream job is uncommon, it's often worth looking into taking a double major, or a minor with your major. It adds extra work to each day, but teaches you to manage your time efficiently and will allow you to stand out. Coaches value academics more than you think, and doing extra work academically is a way for you to gain an advantage over other athletes.
out there. When doing this, make sure you contact coaches and try to encourage them to watch, and always remember to put your contact information at the beginning or the end of your highlights (name, phone number, email address). Many colleges provide a recruitment questionnaire on their respective athletic team internet page. Going through the questionnaire and answering questions honestly is a great way to get your information out to coaches as well.
After completing your visits, send in your academic information to each college you toured and are interested in. Be sure to include your best SAT/ACT score and your official transcript, and include any other information that schools might ask for. Find the schools official website and fill out the application. Completing the NCAA Eligibility Center form is also required for anyone wanting to play in a collegiate sport at the Division I or Division II level. After applying to each school, reevaluate each report that you wrote down, and create a list of your highest ranked schools from top to bottom. Once you've finished applying, it can often take colleges several weeks to get back and let you know if you have been accepted or not, so don't panic if they take extra time to review your application.
Assuming you received acceptance letters from multiple schools, you then have to evaluate each college and make the decision on where you would like to attend. The decision process is only as difficult as you make it. It can be extremely stressful, especially if you have several schools interested in you. Talking to your family and taking time out of your day to think about it is crucial. Let your family know what you think the best school for you would be, and give your reasoning as to why you think they are the best fit for you. Your family may or may not agree, but remind them that the final decision should be yours.
When you are confident that you know where you want to go, tell your family first and let them know you are confident in your decision. Let the coaches from the college know that you would like to attend their school and that you're excited to be a part of the team moving forward. Talk to your high school athletic director shortly after, and make sure you set up a meeting to sign your letter of intent.
Once you've committed, take time to reflect on the steps you took to make your decision, and celebrate with your friends and family. Stay in contact with the coaches, and figure out when practice times are in the future. Even though you just committed, you have to look ahead to the school year. Schedule your classes around practice times, and contact your academic counselor if you need assistance. Look into clubs and extracurricular activities that you could involve yourself with to stay busy each day. It's also helpful to contact current players on the team and ask for any advice they might have for classes, or anything you should do before you arrive on campus.
MOVE IN DAY! When you arrive on campus, meet up with your coaches and teammates whenever possible, and try to get comfortable with everyone. Figure out where and when your classes are, and prioritize your school work. Within your first few weeks, you should develop an everyday schedule to allow you to stay on top of all your work and practices. Manage your time effectively, and always stay ahead in your classes. The most important thing you can do is GET HELP when you need it. Whether it be classwork, practices, socializing, or eating right, there's always people that are willing to help if you ask. Make sure you develop a healthy eating habit to give yourself an edge over other athletes on your team. Three or four meals a day is essential. Maximize your protein, carbohydrate, and water intake, and eliminate junk food to maintain a healthy diet and stay active throughout the day.
Here's a few final tips for every athlete. Make yourself the best student-athlete you can be, and remember to value academics as much as you do athletics. Be yourself, but get out of your comfort zone to make yourself stand out. Remember your morals and don't let college change who you are or what you're about. Surround yourself with individuals who only want you to get better, and eliminate those who don't believe in you. Keep in touch with family and friends back home, and remember the work it took for you to get as far as you did.
The following are links to sites outside of the Upper Dauphin Area School District Web site and the UDASD is not responsible for content on these sites.


Cate: Please welcome Jeanne Bannon. Jeanne, will you please share a short bio with us?
Jeanne: I've worked in the publishing industry for over 20 years. First as a freelance writer and then as an editor. After having several short stories published, I tried my hand at novel writing. Invisible is my debut novel.
Cate: Congrats! Tell us about Invisible and where it's available.
Jeanne: Invisible, is about a teenage girl who isn't happy with herself and wishes she could disappear. And one day she does. Invisible is available on Amazon, Smashwords, and the Solstice Publishing website.
Cate: Very cool premise. Can you tell us why we're going to love your hero?
Jeanne: Lola is just an average girl. She's not a gorgeous heroine who saves the world. She's overweight, she doesn't think she's pretty. Doesn't expect to ever have a boyfriend, and she's the victim of bullies. But Lola finds an inner strength she didn't know she possessed and rises above it all. Invisible is the story of the underdog and who can't help but root for the underdog?
Cate: Love it. Tease us with one little thing about your fictional world that makes it different from others.
Jeanne: Perhaps the thing that makes my fictional world different is the cast of characters. There are Lola's tattooed and pierced parents who are cooler than she'll ever be. Her androgynous best friend, Charlie and her eccentric Grandma Rose. These characters along with Lola make for an interesting fictional environment.
Jeanne: I'm finishing up work on my paranormal thriller, Dark Angel. It's three times the length of Invisible and much more complicated. I started Dark Angel two and a half years ago and I think it's about time I finish.
Cate: Very cool. What inspired you to draft your first story?
Jeanne: Events in my own life. I had a hard time with bullies in grades 7 and 8 and wished I could disappear. However, I look at Invisible as a gift as if came to me as if it were whispered in my ear. I completed it four months.
Jeanne: I used to! But now that Invisible has been released, I'm doing more promotion than writing. I'm itching to get back to my writing routine which used to be three to four hours of writing a day, every day.
Jeanne: Hmmm, what a great question. I suppose I'd like to know if readers prefer perfect, pretty characters to flawed not so good looking characters in YA novels. And what do they think of reading a novel written in first person present?
Cate: Readers, Jeanne Bannon is giving away a book, in both ebook and paperback formats, to a random commenter... so start commenting. She'll pick a winner on October 12th and announce the winner here.
Thanks so much for being my guest Jeanne! Best of luck to you.
Loved your book! Great interview.
Thanks for putting Bannon in the spotlight were she belongs, Cate. I loved Invisible, enjoyed reading about the author. Lola is an east character to fall in love with.
Susan Stec, author, The Grateful Undead series.
Do love the cover! I can already relate to your story. Great interview!
Great Interview !! I like this story , it's not your average heroine story , it'd different and unique. Hope to win a copy !!
Thanks for stopping by, Crystal :) Good luck!
Characters that are too perfect are hard to relate too and to root for.
Am I too late to enter the draw? Jeanne's blurb is sooo intriguing! Thanks Cate for spotlighting her!
I'd like to announce the winners of INVISIBLE. I used random.org to randomly chose the winners. Crystal Trent Dobson is the winner of the book and Emmy Swain, the winner of the paperback.
Crystal, I have your email address and will be touch with you shortly.
Emmy would you kindly leave your email address...thanks!
Thank you to Cate for hosting me and congratulations to the winners!
I'm awed that the book was written and wrapped up in such a short time. Invisible really was a gift.
Thank you, Jeanne. I am very excited about my win and look forward to reading Invisible.
Also, many thanks to you and your Author Spotlight, Cate. Very nice!
I was a fortunate winner of this book. Invisible is a fantastic read!
Jeanne captured just about every emotion in this great book for teens. From sad to happy, fearful to fearless, Lola turns revenge into self worth. I laughed, cried and was surprised at the super power that young Lola possessed.
Most all of us have colorful, sometimes clashing characters in our lives. Jeanne managed to weave them into the story, with a happy ending for all.
I highly recommend this book for teenagers, teachers and guidance counselors.


Please do contact us if you'd like to share or gather oral histories.
Are you an elder who is 70 or above? Do you know an elder 70 or above who would be open to sharing their life stories with us? Contact us with your/their brief biographical details.
Using the field kit, record an interview with an elder that you are acquainted with and submit the recording to our archive.


Enjoy the beautiful, timeless style of this 4-bedroom townhome overlooking Castle Creek. The property is located on the Aspen Institute campus, where guests can enjoy access to the gym, the tennis courts, and the pool for an additional fee, and the complimentary shuttle service, which takes guests to town every 30 minutes. The West End locations provides for a quiet and serene environment year round. The property offers one covered parking space, a laundry room, an equipped kitchen, and a dining table that seats 8 individuals.