login
A391187
a(n) is the smallest positive integer such that a(n) * n is a number of the form x^2 + 2*y^2 (A002479).
4
1, 1, 1, 1, 5, 1, 7, 1, 1, 5, 1, 1, 13, 7, 5, 1, 1, 1, 1, 5, 7, 1, 23, 1, 1, 13, 1, 7, 29, 5, 31, 1, 1, 1, 35, 1, 37, 1, 13, 5, 1, 7, 1, 1, 5, 23, 47, 1, 1, 1, 1, 13, 53, 1, 5, 7, 1, 29, 1, 5, 61, 31, 7, 1, 65, 1, 1, 1, 23, 35, 71, 1, 1, 37, 1, 1, 7, 13, 79, 5, 1
OFFSET
1,5
LINKS
FORMULA
Multiplicative with a(p^e) = p^(e mod 2) if p == 5 or 7 (mod 8), and a(p^e) = 1 otherwise.
a(n) = n / A391186(n).
a(n) = n if and only if n is squarefree and all the prime factors of n are == 5 or 7 (mod 8).
a(n) = 1 if and only if n is in A002479.
EXAMPLE
a(5) = 5 since the 4 smallest positive multiples of 5, i.e., 5, 10, 15, and 20, are not of the form x^2 + 2*y^2, and 25 (which equals 5*5) is, since 25 = 5^2 + 2*0^2.
MATHEMATICA
f[p_, e_] := If[Mod[p, 8] > 4, p^Mod[e, 2], 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
PROG
(PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i, 1]%8 > 4, f[i, 1]^(f[i, 2] % 2), 1)); }
CROSSREFS
Similar sequences: A363340, A390692.
Sequence in context: A308090 A300711 A111008 * A065330 A140215 A366284
KEYWORD
nonn,mult,easy
AUTHOR
Amiram Eldar, Dec 02 2025
STATUS
approved