OFFSET
1,2
COMMENTS
Let u(n) + i*v(n) = (5 + 2*i)^n, so that u(n)^2 + v(n)^2 = 29^n, where 29 == 1 (mod 4); such primes admit a representation as a sum of two squares. Then a(n) = n - Omega(u(n)) - Omega(v(n)) = Omega(u(n)^2 + v(n)^2) - Omega(u(n)) - Omega(v(n)). The values u(n) and v(n) can be computed via the recurrence u(n + 1) = 5*u(n) - 2*v(n), v(n + 1) = 2*u(n) + 5*v(n), with u(1) = 5 and v(1) = 2.
Since u(n)^2 + v(n)^2 = 29^n and gcd(u(n), v(n)) = 1 (any common divisor must divide 29^n), the triple (u(n)^2 - v(n)^2, 2*u(n)*v(n), u(n)^2 + v(n)^2) is a primitive Pythagorean triple for all n >= 1.
Thus a(n) compares the additive prime factor count of the norm 29^n with that of its Gaussian components u(n) and v(n).
Large positive values of a(n) occur when both u(n) and v(n) have relatively few prime factors.
Since |u(n)| and |v(n)| are of order about p^(n/2), probabilistic number theory suggests that Omega(u(n)) and Omega(v(n)) grow roughly like log log |u(n)|, which is about log(n). A refined heuristic suggests a(n) ~ n - 2*log(n) - C_p, where C_p = 2*(log(log(p)) - log(2) + B), with p = u(1)^2 + v(1)^2 and B the Meissel-Mertens constant (A077761). Fluctuations around this trend are of order sqrt(log(n)) and are governed by Erdős-Kac type behavior of Omega. For p = 29 this gives C_p ~ 1.56, explaining the stronger downward shift, see linked graph.
LINKS
Felix Huber, Growth of a(n).
Eric Weisstein's World of Mathematics, Erdős-Kac theorem.
Eric Weisstein's World of Mathematics, Hardy-Ramanujan theorem.
Wikipedia, Fermat's theorem on sums of two squares.
EXAMPLE
a(2) = -3 since (5 + 2*i)^2 = 21 + 20*i, so Omega(21) = 2, Omega(20) = 3 and hence 2 - 2 - 3 = -3.
a(11) = 5 since (5 + 2*i)^11 = -55535695 - 95479298*i, so Omega(55535695) = 4, Omega(95479298) = 2 and hence 11 - 4 - 2 = 5.
MAPLE
with(NumberTheory):
A396958List := proc(N)
local a, b, k, u, v;
u := 5;
v := 2;
a := Vector(N);
for k from 1 to N do
a[k] := k - Omega(abs(u)) - Omega(abs(v));
b := 5*u - 2*v;
v := 2*u + 5*v;
u := b;
end do;
convert(a, list)
end proc:
A396958List(69);
MATHEMATICA
Table[n - PrimeOmega@ Abs@ Re[#] - PrimeOmega@ Abs@ Im[#] &[(5 + 2*I)^n], {n, 69}] (* Michael De Vlieger, Jun 18 2026 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Felix Huber, Jun 17 2026
STATUS
approved
