A330252 a(1) = 1; for n > 1, a(n) = n*a(n-1) if n is a prime, otherwise a(n) = floor(a(n-1)/A020639(n)), where A020639(n) is the smallest prime divisor of n.
1, 2, 6, 3, 15, 7, 49, 24, 8, 4, 44, 22, 286, 143, 47, 23, 391, 195, 3705, 1852, 617, 308, 7084, 3542, 708, 354, 118, 59, 1711, 855, 26505, 13252, 4417, 2208, 441, 220, 8140, 4070, 1356, 678, 27798, 13899, 597657, 298828, 99609, 49804, 2340788, 1170394, 167199, 83599
Offset: 1
Keywords
Examples
a(3) = 6 as n = 3 is prime and 3 * a(2) = 3 * 2 = 6. a(4) = 3 as n = 4 is composite with a smallest prime divisor of 2, thus a(4) = floor(a(3)/2) = floor(6/2) = 3. a(15) = 47 as n = 15 is composite with a smallest prime divisor of 3, thus a(15) = floor(a(14)/3) = floor(143/3) = 47.
Links
- Scott R. Shannon, Table of n, a(n) for n = 1..3292.
Programs
-
Mathematica
a[1] = 1; a[n_] := a[n] = If[PrimeQ[n], n*a[n - 1], Floor[a[n - 1] / FactorInteger[n][[1, 1]]]]; Array[a, 50] (* Amiram Eldar, Dec 07 2019 *)
Comments