OFFSET
1,2
COMMENTS
a(n) <= n; a(a(n)) = a(n).
All factors p^m of a(n) are of the form p=2 or p=4*k+3.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
FORMULA
Multiplicative with a(p)=(if p==1 (mod 4) then 1 else p).
EXAMPLE
a(90) = a(2*3*3*5) = a(2*(4*0+3)^2*(4*1+1)^1 = 2*3^2*1 = 18.
MAPLE
a:= n-> mul(`if`(irem(i[1], 4)=1, 1, i[1]^i[2]), i=ifactors(n)[2]):
seq(a(n), n=1..100); # Alois P. Heinz, Jun 09 2014
MATHEMATICA
a[n_] := n/Product[{p, e} = pe; If[Mod[p, 4] == 1, p^e, 1], {pe, FactorInteger[n]}];
Array[a, 100] (* Jean-François Alcover, May 29 2019 *)
PROG
(PARI) a(n) = my(f=factor(n)); for (i=1, #f~, if ((f[i, 1] % 4) == 1, f[i, 1] = 1)); factorback(f); \\ Michel Marcus, Jun 09 2014
(Python)
from sympy import factorint, prod
def a(n):
f = factorint(n)
return 1 if n == 1 else prod(i**f[i] for i in f if i%4 != 1) # Indranil Ghosh, May 08 2017
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Reinhard Zumkeller, Jun 17 2002
STATUS
approved