OFFSET
1,2
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
Since 10 = 2*5, 2 = prime(1), and 5 = prime(3), a(10) = 2*5 = 10.
Since 9 = 3^2 and 3 is an even-indexed prime, 3 = prime(2), then a(9) = 1^2 = 1.
Since 30 = 2*3*5, 2 = prime(1), 3 = prime(2), and 5 = prime(3), we see that a(30) = 2*1*5 = 10.
MATHEMATICA
f[n_] := Block[{a, g, pf = FactorInteger@ n}, a = PrimePi[First /@ pf]; g[x_] := If[EvenQ@ x, 1, Prime@ x]; Times @@ Power @@@ Transpose@ {g /@ a, Last /@ pf}]; Array[f, 120] (* Michael De Vlieger, Mar 03 2015 *)
Array[Times @@ (FactorInteger[#] /. {p_, e_} /; e > 0 :> (p^Mod[PrimePi@ p, 2])^e) &, 76] (* Michael De Vlieger, Apr 05 2017 *)
PROG
(Sage)
n=100; oddIndexPrimes=[primes_first_n(2*n+1)[2*i] for i in [0..n]]
[prod([(x[0]^(x[0] in oddIndexPrimes))^x[1] for x in factor(n)]) for n in [1..n]]
(PARI) a(n) = {f = factor(n); for (i=1, #f~, f[i, 2] *= (primepi(f[i, 1]) % 2); ); factorback(f); } \\ Michel Marcus, Mar 03 2015
(Haskell)
a247503 = product . filter (odd . a049084) . a027746_row
-- Reinhard Zumkeller, Mar 06 2015
(Python)
from math import prod
from sympy import factorint, primepi
def A247503(n): return prod(p**e for p, e in factorint(n).items() if primepi(p)&1) # Chai Wah Wu, Dec 26 2022
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Tom Edgar, Mar 03 2015
STATUS
approved