cp's OEIS Frontend

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.

A227782 Stufe of Q(sqrt(-n)): least number of squares which add to -1 in the field Q(sqrt(-n)).

Original entry on oeis.org

1, 2, 2, 1, 2, 2, 4, 2, 1, 2, 2, 2, 2, 2, 4, 1, 2, 2, 2, 2, 2, 2, 4, 2, 1, 2, 2, 4, 2, 2, 4, 2, 2, 2, 2, 1, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 1, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 4, 2, 2, 4, 1, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 1, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 4, 2
Offset: 1

Views

Author

Keywords

Comments

If n >= 0 then Q(sqrt(n)) is formally real and its stufe is said to be infinite.

Examples

			a(1) = a(4) = a(9) = 1 since Q(sqrt(-1)) = Q(sqrt(-4)) = Q(sqrt(-9)) = Q(i) has a square equal to -1: i^2 = -1.
a(3) = 2 since ((w+1)/2)^2 + ((w-1)/2)^2 = -1 where w = sqrt(-3).
		

References

  • Ian G. Connell, The stufe of number fields, Mathematische Zeitschrift 124:1 (1972), pp. 20-22.
  • A. R. Rajwade, Squares, Cambridge Univ. Press, 1983.

Crossrefs

Programs

  • PARI
    a(n)=n=core(n);if(n%8==7,4,if(n==1,1,2))
    
  • PARI
    a(n)=n>>=(valuation(n,2)\2*2); if(n%8==7, 4, 2-issquare(n))

Formula

a(n) = 1 if n is a square; a(n) = 4 if n is of the form 4^k(8m+7) for some m; a(n) = 2 otherwise.