login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A068629 a(1) = 1. a(n) = n*a(n-1) if gcd(n,a(n-1)) = 1, a(n-1)/n if n divides a(n-1), otherwise a(n) = a(n-1). 2
1, 2, 6, 6, 30, 5, 35, 280, 2520, 252, 2772, 231, 3003, 3003, 3003, 48048, 816816, 816816, 15519504, 15519504, 739024, 33592, 772616, 772616, 19315400, 742900, 20058300, 20058300, 581690700, 19389690, 601080390, 601080390 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
The sequence can also be obtained by taking a(1) = 1 and then multiplying the previous term by n if n is coprime to the previous term a(n-1), dividing the previous term by n if n divides the previous term a(n-1), taking a(n) = a(n-1) if n is unrelated to a(n-1). - Amarnath Murthy, Oct 30 2002 (corrected by Franklin T. Adams-Watters, Dec 13 2006)
LINKS
MATHEMATICA
a = {1}; Do[AppendTo[a, If[GCD[a[[-1]], n] == 1, a[[-1]]*n, If[Divisible[a[[-1]], n], a[[-1]]/n, a[[-1]]]]], {n, 2, 32}]; a (* Ivan Neretin, May 21 2015 *)
PROG
(PARI) print1(k=1); for(n=2, 99, if(gcd(k, n)==1, k*=n, if(k%n==0, k/=n)); print1(", "k)) \\ Charles R Greathouse IV, May 21 2015
CROSSREFS
Sequence in context: A212397 A008339 A077139 * A144361 A366369 A163641
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, Feb 26 2002
EXTENSIONS
a(26)-a(32) corrected by Ivan Neretin, May 21 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 13:30 EDT 2024. Contains 371957 sequences. (Running on oeis4.)