login
A391186
The largest divisor of n that is a number of the form x^2 + 2*y^2 (A002479).
4
1, 2, 3, 4, 1, 6, 1, 8, 9, 2, 11, 12, 1, 2, 3, 16, 17, 18, 19, 4, 3, 22, 1, 24, 25, 2, 27, 4, 1, 6, 1, 32, 33, 34, 1, 36, 1, 38, 3, 8, 41, 6, 43, 44, 9, 2, 1, 48, 49, 50, 51, 4, 1, 54, 11, 8, 57, 2, 59, 12, 1, 2, 9, 64, 1, 66, 67, 68, 3, 2, 1, 72, 73, 2, 75, 76
OFFSET
1,2
COMMENTS
The number of these divisors is A391184(n), and their sum is A391185(n).
LINKS
FORMULA
Multiplicative with a(p^e) = p^(2*floor(e/2)) if p == 5 or 7 (mod 8), and p^e otherwise.
a(n) = n / A391187(n).
a(n) = n if and only if n is in A002479.
a(n) = 1 if and only if n is squarefree and all its prime factors are in A003628.
EXAMPLE
a(6) = 6 since 6 is the largest divisor of 6 and it is of the form x^2 + 2*y^2: 6 = 2^2 + 2*1^2.
a(10) = 2 since 2 is the largest divisor of 10 that is of the form x^2 + 2*y^2: 2 = 0^2 + 2*1^2. 5 and 10, the two larger divisors of 10, are not of this form.
MATHEMATICA
f[p_, e_] := If[Mod[p, 8] > 4, p^(2*Floor[e/2]), p^e]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
PROG
(PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, f[i, 1]^if(f[i, 1]%8 > 4, 2*(f[i, 2]\2), f[i, 2])); }
CROSSREFS
Similar sequences: A371015, A390691.
Sequence in context: A366283 A065331 A066262 * A195989 A174715 A069817
KEYWORD
nonn,mult,easy
AUTHOR
Amiram Eldar, Dec 02 2025
STATUS
approved