%I #7 Mar 30 2012 17:27:34
%S 2,3,4,6,8,10,12,16,18,22,24,28,30,40,42,48,58,60,70,72,78,88,102,112,
%T 120,130,168,190,210,232,240,280,312,330,408,462,520,760,840,1320,1848
%N Numbers n such that for every k the following condition holds: (*) The number of nonnegative solutions of the Diophantine equation x^2 + n*y^2 = 1+n*k^2 equals one half of the number of divisors of 1+n*k^2 if 1+n*k^2 is not a square and one half of 1 + the number of divisors of 1+n*k^2 if 1+n*k^2 is a square.
%C The sequence is conjectural. It depends on a proof of conjecture 1: If condition (*) holds for k and n < u(k), then it holds for k+1 and n, where u(k) is some nondecreasing function of k. Computationally this is confirmed for 1 < k < 300 and n < 100, 2 < k < 250 and n < 238, 3 < k < 250 and n < 282, 5 < k < 200 and n < 652, 8 < k < 200 and n < 2088, 9 < k < 200 and n <= 1000000.
%C No further terms up to 1000000 were found; this suggests conjecture 2: The sequence is finite and 1848 its last term. Perhaps easier to prove is the stronger conjecture 3: For every n > c there is a k < d such that condition (*) is violated for k and n. Computationally this is confirmed for n <=1000000 and c = 1848, d = 11.
%o (PARI) {h=50; m=5000; v=vector(m,x,1); for(k=1,h, for(n=1,m,if(v[n]>0,r=0; for(x=0,sqrtint(n*k^2+1), for(y=0,sqrtint((n*k^2+1-x^2)\n),if(x^2+n*y^2==n*k^2+1,r++))); q=n*k^2+1; d=numdiv(q); s=if(issquare(q),d+1,d)/2; if(r!=s,v[n]=0)))); for(n=1,m,if(v[n]>0,print1(n,",")))}
%K nonn
%O 1,1
%A Holger Stephan (stephan(AT)wias-berlin.de), Feb 18 2002
%E Edited and extended by _Klaus Brockhaus_, Jun 25 2003