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.

A118917 Number of inequivalent primes in ring of integers Z[sqrt(2)] with absolute value of norm = n.

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0
Offset: 0

Views

Author

Keywords

Comments

Since there are infinitely many units in Z[sqrt(2)], the total number of primes with a given norm is infinite (when there are any).

Crossrefs

Programs

  • Mathematica
    a[n_] := Which[PrimeQ[n] && MatchQ[Mod[n, 8], 1|7], 2, p = Sqrt[n]; n == 2 || IntegerQ[p] && PrimeQ[p] && MatchQ[Mod[p, 8], 3|5], 1, True, 0]; Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Nov 22 2016 *)
  • PARI
    A118917(n) = { my(p); if(isprime(n)&&((1==(n%8))||(7==(n%8))), 2, if((2==n)||((issquare(n,&p)&&isprime(p))&&((3==(p%8))||(5==(p%8)))),1,0)); }; \\ Antti Karttunen, Aug 30 2017

Formula

a(n) = 2 if n is a prime = 1,7 (mod 8); a(n) = 1 if n is 2 or p^2 where p is a prime = 3,5 (mod 8); otherwise a(n) = 0.