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.

A097689 Number of prime pairs (p,q) with p^2 + q^2 <= n^2.

Original entry on oeis.org

0, 0, 1, 3, 4, 8, 8, 13, 15, 16, 16, 20, 22, 30, 32, 33, 33, 41, 44, 50, 54, 58, 58, 66, 69, 73, 76, 76, 78, 88, 88, 100, 103, 107, 109, 111, 113, 123, 127, 129, 131, 142, 146, 159, 165, 167, 169, 183, 191, 193, 197, 201, 204, 214, 218, 224, 230, 233, 233, 245, 252, 268
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 21 2004

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = Module[{cnt = 0, p, q}, Do[p = Prime[ip]; q = Prime[iq]; If[p^2 + q^2 <= n^2, If[p == q, cnt++, If[p < q, cnt += 2, 0]]], {ip, PrimePi[n]}, {iq, ip, PrimePi[n]}]; cnt];
    Array[a, 100] (* Jean-François Alcover, Nov 18 2021 *)