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.

A092575 Number of representations of n of the form x^2 + 3y^2 with (x,y)=1.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Feb 28 2004

Keywords

Crossrefs

Programs

  • Maple
    N:= 200: # to get a(1)..a(N)
    V:= Vector(N):
    for y from 1 to floor(sqrt(N/3-1)) do
      for x from 1 to floor(sqrt(N-3*y^2)) do
        if igcd(x,y) = 1 then V[x^2 + 3*y^2]:= V[x^2+3*y^2]+1
        fi
    od od:
    convert(V,list); # Robert Israel, Apr 03 2017
  • Mathematica
    r[n_] := Reduce[ x > 0 && y > 0 && GCD[x, y] == 1 && n == x^2 + 3 y^2, {x, y}, Integers]; a[n_] := Which[ r[n] === False, 0, r[n][[0]] === And, 1, True, Length[r[n]]]; Table[a[n], {n, 1, 102}] (* Jean-François Alcover, Oct 31 2012 *)