OFFSET
1,5
COMMENTS
Completely multiplicative with a(p) = p if p = 4k+1 and a(p) = 1 otherwise. - Tom Edgar, Mar 05 2015
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
A. Tripathi, On Pythagorean triples containing a fixed integer, Fib. Q., 46/47 (2008/2009), 331-340.
FORMULA
a(n) = n/A072438(n). - Michel Marcus, Mar 05 2015
MAPLE
a:= n-> mul(`if`(irem(i[1], 4)=1, i[1]^i[2], 1), i=ifactors(n)[2]):
seq(a(n), n=1..100); # Alois P. Heinz, Jun 09 2014
MATHEMATICA
a[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)); prod(i=1, #f~, if(f[i, 1]%4>1, 1, f[i, 1])^f[i, 2]) \\ Charles R Greathouse IV, Jun 28 2015
(Python)
from sympy import factorint, prod
def a072438(n):
f = factorint(n)
return 1 if n == 1 else prod(i**f[i] for i in f if i % 4 != 1)
def a(n): return n//a072438(n) # Indranil Ghosh, May 08 2017
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
N. J. A. Sloane, Dec 22 2009
STATUS
approved