This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A306638 #35 Jun 11 2025 14:25:06 %S A306638 -1,-1,1,-1,-1,-1,1,1,1,-1,1,1,-1,-1,-1,1,1,1,-1,-1,1,1,1,-1,-1,-1,1, %T A306638 1,-1,1,1,1,1,-1,1,-1,1,1,1,-1,-1,-1,1,1,-1,1,-1,-1,1,1,1,-1,1,1,1,1, %U A306638 1,-1,1,1,-1,-1,-1,1,1,1,-1,1,1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,1,1,-1,-1,-1 %N A306638 a(n) is the norm of the fundamental unit of binary quadratic forms with discriminant D = A079896(n). %C A306638 The fundamental unit of binary quadratic forms with discriminant D is the number (x_1 + (y_1)*sqrt(D))/2, where (x_1,y_1) is the smallest solution to x^2 - D*y^2 = +-4. Each term is either -1 or 1 depending on whether (x_1)^2 - D*(y_1)^2 = -4 or 4. %C A306638 All solutions to x^2 - D*y^2 = +-4 are given by the identity (x_n + (y_n)*sqrt(D))/2 = ((x_1 + (y_1)*sqrt(D))/2)^n. %C A306638 The discriminants D corresponding to (x_1)^2 - D*(y_1)^2 = -4 are listed in A226696. %D A306638 D. A. Buell, Binary Quadratic Forms, Springer, 1989, Sections 3.2 and 3.3, pp. 31-48. %H A306638 Robin Visser, <a href="/A306638/b306638.txt">Table of n, a(n) for n = 1..10000</a> %F A306638 a(n) = -1 if D = A079896(n) is in A226696, otherwise 1. %e A306638 Fundamental units and their norms for the first 15 discriminants in the form (X + Y*sqrt(D))/2 (N = (X^2 - D*Y^2)/4 are the corresponding norms) are: %e A306638 D | X | Y | N %e A306638 5 | 1 | 1 | -1 %e A306638 8 | 2 | 1 | -1 %e A306638 12 | 4 | 1 | 1 %e A306638 13 | 3 | 1 | -1 %e A306638 17 | 8 | 2 | -1 %e A306638 20 | 4 | 1 | -1 %e A306638 21 | 5 | 1 | 1 %e A306638 24 | 10 | 2 | 1 %e A306638 28 | 16 | 3 | 1 %e A306638 29 | 5 | 1 | -1 %e A306638 32 | 6 | 1 | 1 %e A306638 33 | 46 | 8 | 1 %e A306638 37 | 12 | 2 | -1 %e A306638 40 | 6 | 1 | -1 %e A306638 41 | 64 | 10 | -1 %o A306638 (PARI) b(D) = for(n=1, oo, if(issquare(D*n^2-4), return(-1)); if(issquare(D*n^2+4), return(1))) %o A306638 for(n=2, 200, if(n%4 <= 1 && !issquare(n), print1(b(n), ", "))) %o A306638 (Julia) using Nemo %o A306638 function b(D) %o A306638 for j in 1:10000 %o A306638 issquare(D*j^2 - 4) && return -1 %o A306638 issquare(D*j^2 + 4) && return 1 %o A306638 end %o A306638 0 end %o A306638 F = findall(n -> ZZ(n) % 4 <= 1 && !issquare(ZZ(n)), 1:100) %o A306638 map(n -> b(ZZ(n)), F) |> println # _Peter Luschny_, Mar 08 2019 %Y A306638 Cf. A079896, A226696. %Y A306638 A014077 is a subsequence listing the corresponding values for only fundamental discriminants (A003658). %K A306638 sign %O A306638 1,1 %A A306638 _Jianing Song_, Mar 02 2019 %E A306638 Offset changed to 1 by _Robin Visser_, Jun 09 2025