%I #31 May 05 2024 20:05:05
%S 4,2,6,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
%T 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
%U 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
%N Number of units in the imaginary quadratic field Q(sqrt(-d)), where d > 0 is the n-th squarefree number.
%C a(n) = 2 for all n > 3.
%C Decimal expansion of 959/225. - _Elmo R. Oliveira_, May 05 2024
%D Saban Alaca & Kenneth S. Williams, Introductory Algebraic Number Theory. Cambridge: Cambridge University Press (2004): p. 98, Theorem 5.4.3.
%D Ivan Niven & Herbert S. Zuckerman, An Introduction to the Theory of Numbers, 4th Ed. New York: John Wiley & Sons (1980): p. 249, Theorem 9.22.
%H M. Hazewinkel, <a href="http://www.encyclopediaofmath.org/index.php?title=Quadratic_field&oldid=25501">Quadratic field</a>, Encyclopedia of Mathematics, Springer, 2001.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Unit.html">Unit</a>
%H <a href="/index/Rec#order_01">Index entries for linear recurrences with constant coefficients</a>, signature (1).
%F a(n) = A092205(A005117(n)).
%F G.f.: 2*x*(2 - x + 2*x^2 - 2*x^3)/(1 - x). [_Bruno Berselli_, Jan 30 2014]
%e Q(sqrt(-1)) = Q(i) has units +/-1, +/-i, so a(1) = 4.
%e Q(sqrt(-3)) has units +/-1, +/-ω, +/-ω^2, where ω = (1 + sqrt(-3))/2, so a(3) = 6.
%e Q(sqrt(-d)) has units +/-1 for all other squarefree d > 0, so a(n) = 2 for n = 2 and n > 3.
%t CoefficientList[Series[2 x (2 - x + 2 x^2 - 2 x^3)/(1 - x), {x, 0, 105}], x] (* _Michael De Vlieger_, Mar 30 2016 *)
%Y Cf. A005117, A092205.
%K nonn,easy
%O 1,1
%A _Jonathan Sondow_, Jan 29 2014