A343431 Part of n composed of prime factors of the form 6k-1.
1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 11, 1, 1, 1, 5, 1, 17, 1, 1, 5, 1, 11, 23, 1, 25, 1, 1, 1, 29, 5, 1, 1, 11, 17, 5, 1, 1, 1, 1, 5, 41, 1, 1, 11, 5, 23, 47, 1, 1, 25, 17, 1, 53, 1, 55, 1, 1, 29, 59, 5, 1, 1, 1, 1, 5, 11, 1, 17, 23, 5, 71, 1, 1, 1, 25, 1, 11, 1, 1, 5, 1, 41, 83, 1, 85, 1, 29, 11, 89, 5
Offset: 1
Crossrefs
Programs
-
Mathematica
f[p_, e_] := If[Mod[p, 6] == 5, p^e, 1]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* after Amiram Eldar at A248909 *)
-
PARI
a(n) = {my(f = factor(n)); for (i=1, #f~, if ((f[i, 1] + 1) % 6, f[i, 1] = 1); ); factorback(f); } \\ after Michel Marcus at A248909
-
Python
from math import prod from sympy import factorint def A343431(n): return prod(p**e for p, e in factorint(n).items() if not (p+1)%6) # Chai Wah Wu, Dec 26 2022
Comments