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!)
A133579 a(0)=a(1)=1; for n > 1, a(n) = 3*a(n-1) if a(n-1) and n are coprime, otherwise a(n) = a(n-1)/gcd(a(n-1), n). 7
1, 1, 3, 1, 3, 9, 3, 9, 27, 3, 9, 27, 9, 27, 81, 27, 81, 243, 27, 81, 243, 81, 243, 729, 243, 729, 2187, 81, 243, 729, 243, 729, 2187, 729, 2187, 6561, 729, 2187, 6561, 2187, 6561, 19683, 6561, 19683, 59049, 6561, 19683, 59049, 19683, 59049, 177147 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
MAPLE
f:=proc(n) option remember;
if n <= 1 then 1
elif gcd(n, f(n-1))>1 then f(n-1)/gcd(n, f(n-1))
else 3*f(n-1); fi; end;
[seq(f(n), n=0..50)];
# N. J. A. Sloane, Feb 14 2015
MATHEMATICA
nxt[{n_, a_}]:={n+1, If[CoprimeQ[a, n+1], 3a, a/GCD[a, n+1]]}; Join[{1}, Transpose[ NestList[nxt, {1, 1}, 50]][[2]]] (* Harvey P. Dale, Feb 14 2015 *)
PROG
(PARI) A=vector(1000, i, 1); for(n=2, #A, A[n]=if(gcd(A[n-1], n)>1, A[n-1]/gcd(A[n-1], n), A[n-1]*3)) \\ M. F. Hasler, Feb 15 2015
CROSSREFS
Sequence in context: A164308 A082511 A265307 * A088442 A037095 A160654
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Dec 26 2007
EXTENSIONS
Offset, definition, and terms corrected by N. J. A. Sloane, Feb 14 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 15 05:31 EDT 2024. Contains 371667 sequences. (Running on oeis4.)