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.

A155707 Numbers expressible as a^2 + k b^2 with nonzero integers a,b, for k=2, k=3, k=5 and k=7.

Original entry on oeis.org

144, 576, 1009, 1129, 1201, 1296, 1801, 1849, 2304, 2521, 2689, 2881, 3049, 3361, 3529, 3600, 3889, 4036, 4201, 4356, 4489, 4516, 4561, 4729, 4804, 5184, 5209, 5569, 5881, 5929, 6841, 7009, 7056, 7204, 7396, 7561, 7681, 8089, 8521, 8689, 8761, 8929
Offset: 1

Views

Author

M. F. Hasler, Feb 10 2009

Keywords

Comments

Subsequence of A155708.

Crossrefs

Programs

  • Maple
    filter:= proc(x) local k,S;
       if numtheory:-quadres(x,3*5*7)<> 1 then return false fi;
       for k in [2,3,5,7] do
         S:= [isolve(x = a^2 + k*b^2)];
         if andmap(t -> subs(t,a*b) = 0, S) then return false fi;
       od;
       true
    end proc;
    select(filter, [$1..10000]); # Robert Israel, May 14 2025
  • PARI
    isA155707(n,/* optional 2nd arg allows us to get other sequences */c=[7, 5, 3, 2]) = { for(i=1, #c, for(b=1, sqrtint((n-1)\c[i]), issquare(n-c[i]*b^2) & next(2)); return); 1}
    for(n=1,9999, isA155707(n) & print1(n","))