OFFSET
1,2
COMMENTS
Alternate definition: a(1) = 1; for n > 1, if row n of table A238744 is {k(1), k(2),...,k(A051903(n))}, then a(n) = Product {i = 1 to A051903(n)} prime(k(i)).
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
EXAMPLE
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 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Matthew Vandermast, Apr 28 2014
STATUS
approved