A343430 Part of n composed of prime factors of the form 3k-1.
1, 2, 1, 4, 5, 2, 1, 8, 1, 10, 11, 4, 1, 2, 5, 16, 17, 2, 1, 20, 1, 22, 23, 8, 25, 2, 1, 4, 29, 10, 1, 32, 11, 34, 5, 4, 1, 2, 1, 40, 41, 2, 1, 44, 5, 46, 47, 16, 1, 50, 17, 4, 53, 2, 55, 8, 1, 58, 59, 20, 1, 2, 1, 64, 5, 22, 1, 68, 23, 10, 71, 8, 1, 2, 25, 4, 11, 2, 1, 80, 1, 82, 83, 4, 85
Offset: 1
Examples
n = 60 has prime factorization 60 = 2 * 2 * 3 * 5. Factors 2 = 3*1 - 1 and 5 = 3*2 - 1 have form 3k-1, whereas 3 does not (having form 3k). Multiplying the factors of form 3k-1, we get 2 * 2 * 5 = 20. So a(60) = 20.
Crossrefs
Programs
-
Mathematica
f[p_, e_] := If[Mod[p, 3] == 2, p^e, 1]; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jun 11 2021 *)
-
PARI
a(n) = {my(f = factor(n)); for (i=1, #f~, if ((f[i, 1] + 1) % 3, f[i, 1] = 1); ); factorback(f); } \\ after Michel Marcus at A248909
-
Python
from math import prod from sympy import factorint def A343430(n): return prod(p**e for p, e in factorint(n).items() if p%3==2) # Chai Wah Wu, Dec 23 2022
Formula
Completely multiplicative with a(p) = p if p is of the form 3k-1, otherwise a(p) = 1.
For k >= 1, a(n) = a(k*n) / gcd(k, a(k*n)).
Comments