login
a(n) is the largest unitary divisor of n that is an exponentially odd number (A268335).
23

%I #16 Sep 18 2023 02:02:14

%S 1,2,3,1,5,6,7,8,1,10,11,3,13,14,15,1,17,2,19,5,21,22,23,24,1,26,27,7,

%T 29,30,31,32,33,34,35,1,37,38,39,40,41,42,43,11,5,46,47,3,1,2,51,13,

%U 53,54,55,56,57,58,59,15,61,62,7,1,65,66,67,17,69,70,71

%N a(n) is the largest unitary divisor of n that is an exponentially odd number (A268335).

%H Amiram Eldar, <a href="/A350389/b350389.txt">Table of n, a(n) for n = 1..10000</a>

%F Multiplicative with a(p^e) = p^e if e is odd and 1 otherwise.

%F a(n) = n/A350388(n).

%F A001222(a(n)) = A350387(n).

%F a(n) = 1 if and only if n is a positive square (A000290 \ {0}).

%F a(n) = n if and only if n is an exponentially odd number (A268335).

%F Sum_{k=1..n} a(k) ~ (1/2)*c*n^2, where c = Product_{p prime} (1 - p/(1+p+p^2+p^3)) = 0.7406196365...

%F Dirichlet g.f.: zeta(2*s-2) * zeta(2*s) * Product_{p prime} (1 + 1/p^(s-1) - 1/p^(2*s-2) - 1/p^(3*s-1)). - _Amiram Eldar_, Sep 18 2023

%t f[p_, e_] := If[OddQ[e], p^e, 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]

%o (Python)

%o from math import prod

%o from sympy import factorint

%o def A350389(n): return prod(p**e if e % 2 else 1 for p, e in factorint(n).items()) # _Chai Wah Wu_, Feb 24 2022

%o (PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i,2]%2, f[i,1]^f[i,2], 1));} \\ _Amiram Eldar_, Sep 18 2023

%Y Cf. A000290, A001222, A007913, A268335, A350387, A350388, A350390.

%K nonn,easy,mult

%O 1,2

%A _Amiram Eldar_, Dec 28 2021