A238745 a(1) = 1; for n > 1, if the first integer with the same prime signature as n is factorized into primorials as Product A002110(i)^e(i), then a(n) = Product prime(i)^e(i).
1, 2, 2, 4, 2, 3, 2, 8, 4, 3, 2, 6, 2, 3, 3, 16, 2, 6, 2, 6, 3, 3, 2, 12, 4, 3, 8, 6, 2, 5, 2, 32, 3, 3, 3, 9, 2, 3, 3, 12, 2, 5, 2, 6, 6, 3, 2, 24, 4, 6, 3, 6, 2, 12, 3, 12, 3, 3, 2, 10, 2, 3, 6, 64, 3, 5, 2, 6, 3, 5, 2, 18, 2, 3, 6, 6, 3, 5, 2, 24, 16, 3, 2
Offset: 1
Keywords
Examples
The first integer with the same prime signature as 40 is 24 = 2^3*3. Since the factorization of 24 into primorials is 24 = 2^2*6 = A002110(1)^2*A002110(2), a(24) = a(40) = prime(1)^2*prime(2) = 2^2*3 = 12.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
f[n_] := Block[{k = 1, d, a}, While[n - Times @@ Prime@ Range[k + 1] >= 0, k++]; If[n == Product[Prime@ i, {i, k}], Prime@ k, d = Select[Reverse@ FoldList[#1 #2 &, Prime@ Range@ k], Divisible[n, #] &]; If[AllTrue[#, IntegerQ], Times @@ Map[(FactorInteger[#1][[-1, 1]])^#2 & @@ # &, Reverse@ Tally@ #], False] &@ Rest@ NestWhileList[Function[P, {#1/P, P}]@ SelectFirst[d, Function[k, Divisible[#1, k]]] & @@ # &, {n, 1}, First@ # > 1 &][[All, -1]]]]; Table[f@ Apply[Times, MapIndexed[Prime[First@ #2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]]] - Boole[n == 1], {n, 83}] (* Michael De Vlieger, May 19 2017, Version 10.2 *)
Comments