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.

A297968 Number of solutions to x*y*(x+y)=n in coprime integers.

Original entry on oeis.org

0, 4, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Robert Israel, Jan 10 2018

Keywords

Comments

a(n)=0 if n is odd. - Robert Israel, Jan 10 2018

Examples

			For n=6 the a(n)=6 solutions are (x,y) = (-3,1), (-3,2), (1,-3), (1,2), (2,1) and (2,-3).
		

Programs

  • Maple
    f:= proc(n) local d,count,x,s,ys;
      d:= numtheory:-divisors(n);
      count:= 0:
      for x in d union map(`-`,d) do
        if issqr(x^4+4*n*x) then
          s:= sqrt(x^4+4*n*x);
          ys:= select(t -> type(t,integer) and igcd(t,x)=1, [-(s+x^2)/(2*x), (x^2-s)/(2*x)]);
          count:= count + nops(ys);
        fi
      od;
      count
    end proc:
    map(f, [$1..200]);
  • Mathematica
    f[n_] := Module[{d, count, x, s, ys}, d = Divisors[n]; count = 0; Do[If[ IntegerQ[Sqrt[x^4 + 4n x]], s = Sqrt[x^4 + 4n x]; ys = Select[{-(s+x^2)/ (2x), (x^2-s)/(2x)}, IntegerQ[#] && GCD[#, x] == 1&]; count = count + Length[ys]], {x, Union[d, -d]}]; count]; Array[f, 200] (* Jean-François Alcover, Apr 29 2019, after Robert Israel *)