OFFSET
1,1
COMMENTS
The sequence lists prime numbers, in nondecreasing order, such that each of them can be written, in a unique way, in the form x^2 + h*y^2, where x, y are natural numbers, while h takes an increasing number of values of the sequence A000926 (idoneal numbers). See examples.
LINKS
Marco Frigerio, Table of n, a(n) for n = 1..65
EXAMPLE
a(2) = 17 because, considered the first two idoneal numbers, A000926(1) = 1 and A000926(2) = 2, 17 = 1^2+A000926(1)*4^2 = 3^2+A000926(2)*2^2.
The prime 1009 is present in the sequence 5 times because:
a(7) = 15^2+1*28^2 = 19^2+2*18^2 = 31^2+3*4^2 = 15^2+4*14^2 = 17^2+5*12^2 = 25^2+6*12^2 = 1^2+7*12^2, with idoneal numbers up to A000926(7), and also:
a(8) = 19^2+8*9^2,
a(9) = 28^2+9*5^2,
a(10) = 3^2+10*10^2,
a(11) = 31^2+12*2^2,
1083289 is the last term of the sequence since for every idoneal number h there are x, y such that 1083289 = x^2 + h*y^2 and this is the least prime for which this is possible.
PROG
(PARI)
isok(p, u)={for(i=1, #u, my(s=qfbsolve(Qfb(1, 0, u[i]), p)); if(s==0 || s[1]==0, return(0))); 1}
idoneal()={select(m->!#select(k->k<>2, quadclassunit(-4*m).cyc), [1..1848])}
seq()={my(u=idoneal(), v=[1], L=List()); forprime(p=2, oo, if(isok(p, v), listput(L, p); my(k=#v); while(k<#u && isok(p, [u[k+1]]), listput(L, p); k++); if(k==#u, return(Vec(L))); v=u[1..k+1]))} \\ Andrew Howroyd, Nov 05 2020
CROSSREFS
KEYWORD
nonn,fini,full
AUTHOR
Marco Frigerio, Oct 09 2020
STATUS
approved