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 #35 Apr 06 2017 02:34:17
%S 1,1,3,1,1,3,7,1,9,1,1,3,13,7,3,1,1,9,19,1,21,1,1,3,1,13,27,7,29,3,1,
%T 1,3,1,7,9,37,19,39,1,1,21,43,1,9,1,1,3,49,1,3,13,53,27,1,7,57,29,1,3,
%U 61,1,63,1,13,3,1,1,3,7,71,9,1,37,3,19,7,39,79
%N Completely multiplicative with a(prime(n)) = prime(n)^((n+1) mod 2).
%C To compute a(n) replace odd-indexed primes in the prime factorization of n by 1.
%C a(p) = p if p is in A031215.
%C a(p) = 1 if p is in A031368.
%H Reinhard Zumkeller, <a href="/A248101/b248101.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Di#divseq">Index to divisibility sequences</a>
%F When n = Product_{k>=1} prime(k)^r_k, a(n) = Product_{k>=1} prime(k)^(r_k*((k+1) mod 2)).
%F a(n) = n / A247503(n).
%F a(n) = Product(A027746(n,k): k = 1 .. A001222(n) and A049084(A027746(n,k)) is even). - _Reinhard Zumkeller_, Mar 06 2015
%e Since 10 = 2*5, 2 = prime(1), and 5 = prime(3), a(10) = 1*1 = 1.
%e Since 9 = 3^2 and 3 is an even-indexed prime, 3 = prime(2), then a(9) = 3^2 = 9.
%e Since 35 = 5*7, 5 = prime(3), and 7 = prime(4), we see that a(35) = 1*7 = 7.
%t f[n_] := Block[{a, g, pf = FactorInteger@ n}, a = PrimePi[First /@ pf]; g[x_] := If[Or[OddQ@ x, x == 0], 1, Prime@ x]; Times @@ Power @@@ Transpose@ {g /@ a, Last /@ pf}]; Array[f, 120] (* _Michael De Vlieger_, Mar 03 2015 *)
%t Array[Times @@ (FactorInteger[#] /. {p_, e_} /; e > 0 :> (p^Mod[PrimePi@ p + 1, 2])^e) &, 79] (* _Michael De Vlieger_, Apr 05 2017 *)
%o (Sage)
%o n=100; evenIndexPrimes=[primes_first_n(2*n+2)[2*i+1] for i in [0..n]]
%o [prod([(x[0]^(x[0] in evenIndexPrimes))^x[1] for x in factor(n)]) for n in [1..n]]
%o (PARI) a(n) = {f = factor(n); for (i=1, #f~, f[i,2] *= (primepi(f[i,1])+1) % 2;); factorback(f);} \\ _Michel Marcus_, Mar 03 2015
%o (Haskell)
%o a248101 = product . filter (even . a049084) . a027746_row
%o -- _Reinhard Zumkeller_, Mar 06 2015
%Y Cf. A031368, A031215, A247503, A001222, A027746, A049084.
%K nonn,mult
%O 1,3
%A _Tom Edgar_, Mar 03 2015