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.

This page as a plain text file.
%I A155707 #10 May 14 2025 17:05:57
%S A155707 144,576,1009,1129,1201,1296,1801,1849,2304,2521,2689,2881,3049,3361,
%T A155707 3529,3600,3889,4036,4201,4356,4489,4516,4561,4729,4804,5184,5209,
%U A155707 5569,5881,5929,6841,7009,7056,7204,7396,7561,7681,8089,8521,8689,8761,8929
%N A155707 Numbers expressible as a^2 + k b^2 with nonzero integers a,b, for k=2, k=3, k=5 and k=7.
%C A155707 Subsequence of A155708.
%H A155707 Robert Israel, <a href="/A155707/b155707.txt">Table of n, a(n) for n = 1..2500</a>
%p A155707 filter:= proc(x) local k,S;
%p A155707    if numtheory:-quadres(x,3*5*7)<> 1 then return false fi;
%p A155707    for k in [2,3,5,7] do
%p A155707      S:= [isolve(x = a^2 + k*b^2)];
%p A155707      if andmap(t -> subs(t,a*b) = 0, S) then return false fi;
%p A155707    od;
%p A155707    true
%p A155707 end proc;
%p A155707 select(filter, [$1..10000]); # _Robert Israel_, May 14 2025
%o A155707 (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}
%o A155707 for(n=1,9999, isA155707(n) & print1(n","))
%Y A155707 Subsequence of A155708.
%Y A155707 Cf. A028372, A000404, A154777, A092572, A097268, A155714, A155560.
%K A155707 nonn
%O A155707 1,1
%A A155707 _M. F. Hasler_, Feb 10 2009