OFFSET
1,3
COMMENTS
Using Fermat's two-squares theorem it is easy to see that a(n) is the product of all prime factors of n that are congruent to 3 modulo 4 and have an odd exponent.
This implies that a(n) is also the smallest positive integer such that n / a(n) is the sum of two squares.
Equivalently, a(n) is the product of all primes of the form 4k+3 that divide the squarefree part of n. If we use the squarefree kernel instead, we get A170819. - Peter Munn, Aug 06 2023
FORMULA
Multiplicative with a(p^e) = p if p^e == 3 (mod 4), otherwise 1. - Peter Munn, Jul 03 2023
From Peter Munn, Aug 06 2023: (Start)
a(n) == A000265(n) (mod 4).
(End)
EXAMPLE
a(1) = a(2) = 1 since 1 and 2 are sums of two squares.
a(3) = 3 since 3 and 6 are not sums of two squares but 3*3 is.
a(6) = 3 since 6 and 12 are not sums of two squares but 3*6 = 3^2 + 3^2.
PROG
(PARI) a(n) = my(r=1); foreach(mattranspose(factor(n)), f, if(f[1]%4==3&&f[2]%2==1, r*=f[1])); r
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Peter Schorn, May 28 2023
STATUS
approved