A053590 Product of the longest chain of consecutive primes (starting with A020639(n)) which divides n.
1, 2, 3, 2, 5, 6, 7, 2, 3, 2, 11, 6, 13, 2, 15, 2, 17, 6, 19, 2, 3, 2, 23, 6, 5, 2, 3, 2, 29, 30, 31, 2, 3, 2, 35, 6, 37, 2, 3, 2, 41, 6, 43, 2, 15, 2, 47, 6, 7, 2, 3, 2, 53, 6, 5, 2, 3, 2, 59, 30, 61, 2, 3, 2, 5, 6, 67, 2, 3, 2, 71, 6, 73, 2, 15, 2, 77, 6, 79, 2, 3, 2, 83, 6, 5, 2, 3, 2, 89, 30
Offset: 1
Examples
a(462)=6 because 462=2*3*7*11 and so the greatest product of the longest chain including 2 is 2*3=6.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a053590 1 = 1 a053590 n = last $ takeWhile ((== 0) . (mod n)) $ scanl1 (*) $ dropWhile (< a020639 n) a000040_list -- Reinhard Zumkeller, May 28 2012
-
Mathematica
a[1] = 1; a[n_] := Module[{pp}, For[pp = 1; p = FactorInteger[n][[1, 1]], Mod[n, p] == 0, p = NextPrime[p], pp *= p]; pp]; Table[a[n], {n, 1, 90}] (* Jean-François Alcover, Mar 04 2014 *)
-
PARI
A053590(n) = { local(a) ; if (n==1, return(1) ) ; a = A020639(n) ; p = nextprime(a+1) ; while(1, if ( n % p ==0, a *= p; p=nextprime(p+1), return(a) ) ; ) ; a ; } /* R. J. Mathar, Mar 02 2012 */
Extensions
Data corrected by Reinhard Zumkeller, May 28 2012