Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #29 Sep 02 2023 04:38:06
%S 1,2,3,4,1,6,3,8,9,2,3,12,1,6,3,16,1,18,3,4,9,6,3,24,1,2,27,12,1,6,3,
%T 32,9,2,3,36,1,6,3,8,1,18,3,12,9,6,3,48,9,2,3,4,1,54,3,24,9,2,3,12,1,
%U 6,27,64,1,18,3,4,9,6,3,72,1,2,3,12,9,6,3,16,81,2,3,36,1,6,3,24,1,18,3
%N a(1) = 1, a(p) = p mod 4 for p prime and a(u * v) = a(u) * a(v) for u, v > 0.
%H T. D. Noe, <a href="/A065338/b065338.txt">Table of n, a(n) for n = 1..1000</a>
%F a(n) = 1 if n = 1, otherwise (A020639(n) mod 4) * n / A020639(n).
%F a(n) = (2^A007814(n)) * (3^A065339(n)).
%F a(n) <= n.
%F a(a(n)) = a(n).
%F a(x) = x iff x = 2^i * 3^j for i, j >= 0.
%F a(A003586(n)) = A003586(n).
%F a(A065331(n)) = A065331(n).
%F a(A004613(n)) = 1; A065333(a(n)) = 1. - _Reinhard Zumkeller_, Jul 10 2010
%F Dirichlet g.f.: (1/(1-2^(-s+1))) * Product_{prime p=4k+1} (1/(1-p^(-s))) * Product_{prime p=4k+3} 1/(1-3*p^(-s)). - _Ralf Stephan_, Mar 28 2015
%e a(120) = a(2*2*2*3*5) = a(2)*a(2)*a(2)*a(3)*a(5) = 2*2*2*3*1 = 24.
%e a(150) = a(2*3*5*5) = a(2)*a(3)*a(5)*a(5) = 2*3*1*1 = 6.
%e a(210) = a(2*3*5*7) = a(2)*a(3)*a(5)*a(7) = 2*3*1*3 = 18.
%t a[1] = 1; a[n_] := a[n] = Mod[p = FactorInteger[n][[1, 1]], 4]*a[n/p]; Table[ a[n], {n, 1, 100} ] (* _Jean-François Alcover_, Jan 20 2012 *)
%o (Haskell)
%o a065338 1 = 1
%o a065338 n = (spf `mod` 4) * a065338 (n `div` spf) where spf = a020639 n
%o -- _Reinhard Zumkeller_, Nov 18 2011
%o (PARI) a(n)=my(f=factor(n)); prod(i=1,#f~, (f[i,1]%4)^f[i,2]) \\ _Charles R Greathouse IV_, Feb 07 2017
%Y Cf. A039702, A000040, A003586, A007814, A065339, A065331.
%K mult,nice,nonn
%O 1,2
%A _Reinhard Zumkeller_, Oct 29 2001