login
A366387
Divide n by its smallest prime factor, then multiply with the index of that same prime; a(1) = 0 by convention.
4
0, 1, 2, 2, 3, 3, 4, 4, 6, 5, 5, 6, 6, 7, 10, 8, 7, 9, 8, 10, 14, 11, 9, 12, 15, 13, 18, 14, 10, 15, 11, 16, 22, 17, 21, 18, 12, 19, 26, 20, 13, 21, 14, 22, 30, 23, 15, 24, 28, 25, 34, 26, 16, 27, 33, 28, 38, 29, 17, 30, 18, 31, 42, 32, 39, 33, 19, 34, 46, 35, 20, 36, 21, 37, 50, 38, 44, 39, 22, 40, 54, 41, 23, 42, 51
OFFSET
1,3
FORMULA
a(n) = A032742(n) * A055396(n) = (n/A020639(n)) * A000720(A020639(n)).
a(2n) = n, a(3*(2n+1)) = 2*(2n+1) = 4n + 2.
MATHEMATICA
Array[PrimePi[#2]*#1/#2 & @@ {#, FactorInteger[#][[1, 1]]} &, 85] (* Michael De Vlieger, Oct 23 2023 *)
PROG
(PARI)
A020639(n) = if(1==n, n, vecmin(factor(n)[, 1]));
A366387(n) = { my(spf=A020639(n)); primepi(spf)*(n/spf); };
CROSSREFS
Cf. A196050 (number of iterations needed to reach 1), A324923.
Cf. also A366385, and A060681 (divide by the smallest prime p, then multiply with p-1),
Sequence in context: A152162 A030699 A363959 * A083802 A325691 A326668
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 23 2023
STATUS
approved