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

%I #4 Jul 14 2012 11:32:23

%S 144,576,1009,1129,1201,1296,1801,1849,2304,2521,2689,2881,3049,3361,

%T 3529,3600,3889,4036,4201,4356,4489,4516,4561,4729,4804,5184,5209,

%U 5569,5881,5929,6841,7009,7056,7204,7396,7561,7681,8089,8521,8689,8761,8929

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

%C Subsequence of A155708.

%o (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 for(n=1,9999, isA155707(n) & print1(n","))

%Y Cf. A028372, A000404, A154777 f, A092572, A097268, A155708 ff, A155714, A155560 ff.

%K nonn

%O 1,1

%A _M. F. Hasler_, Feb 10 2009