login
Multiplicative with a(p^e) = p if e >= p, otherwise 1.
21

%I #15 Nov 07 2022 07:40:14

%S 1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,3,2,1,1,1,2,1,1,

%T 1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,3,1,2,1,1,1,2,1,1,1,2,1,1,1,2,

%U 1,1,1,2,1,1,1,2,1,1,1,2,3,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,1,1,1,6,1,1,1,2,1,1,1,2,1,1,1,2

%N Multiplicative with a(p^e) = p if e >= p, otherwise 1.

%H Antti Karttunen, <a href="/A327936/b327936.txt">Table of n, a(n) for n = 1..65537</a>

%F Multiplicative with a(p^e) = p if e >= p, otherwise 1.

%F A001221(a(n)) = A129251(n).

%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Product_{p prime} (1 + (p-1)/p^p) = 1.3443209052633459342... . - _Amiram Eldar_, Nov 07 2022

%e For n = 12 = 2^2 * 3^1, only prime factor p = 2 satisfies p^p | 12, thus a(12) = 2.

%e For n = 108 = 2^2 * 3^3, both prime factors p = 2 and p = 3 satisfy p^p | 108, thus a(108) = 2*3 = 6.

%t Array[Apply[Times, FactorInteger[#] /. {p_, e_} /; IntegerQ@ p :> If[e >= p, p, 1]] &, 120] (* _Michael De Vlieger_, Oct 01 2019 *)

%o (PARI) A327936(n) = { my(f = factor(n)); for(k=1, #f~, f[k,2] = (f[k,2]>=f[k,1])); factorback(f); };

%Y Cf. A001221, A129251, A327937, A327938, A327939.

%Y Differs from A129252 for the first time at n=108.

%K nonn,mult

%O 1,4

%A _Antti Karttunen_, Oct 01 2019