%I #38 Jul 23 2023 22:22:41
%S 2,1,6,2,1,3,14,1,2,1,22,6,1,7,3,2,1,1,38,1,42,11,46,3,2,1,6,14,1,3,
%T 62,1,66,1,7,2,1,19,3,1,1,21,86,22,1,23,94,6,2,1,3,1,1,3,11,7,114,1,
%U 118,3,1,31,14,2,1,33,134,1,138,7,142,1,1,1,6,38,154,3,158
%N a(n) is the smallest integer m such that m*n is a sum of two squares but not one.
%C Previous name was: a(n) is the smallest integer m such that A002828(m*n) = 2.
%C All terms are squarefree.
%C Using the sum of two squares theorem it is easy to see that a(n) is either A363340(n) (if A363340(n)*n is not a square) or 2*A363340(n) (if A363340(n)*n is a square). - _Peter Schorn_, Jul 20 2023
%F a(n^2) = 2.
%p A302690 := proc(n)
%p local k ;
%p for k from 1 do
%p if A002828(k*n) = 2 then
%p return k;
%p end if;
%p end do:
%p end proc:
%p seq(A302690(n),n=1..100) ; # _R. J. Mathar_, Apr 16 2018
%o (PARI) a363340(n) = my(r=1); foreach(mattranspose(factor(n)), f, if(f[1]%4==3&&f[2]%2==1, r*=f[1])); r;
%o a(n) = my(p=a363340(n)); if(issquare(p*n), 2*p, p); \\ _Peter Schorn_, Jul 20 2023
%Y Cf. A002828, A005117, A007913, A064680, A099304, A302694, A363340.
%K nonn
%O 1,1
%A _Juri-Stepan Gerasimov_, Apr 11 2018
%E Name corrected and more terms added by _Michel Marcus_, Apr 12 2018
%E Better name from _Peter Schorn_, Jul 20 2023