This site is supported by donations to The OEIS Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A255051 a(1)=1, a(n+1) = a(n)/gcd(a(n),n) if this GCD is > 1, else a(n+1) = a(n) + n + 1. 4
 1, 3, 6, 2, 1, 7, 14, 2, 1, 11, 22, 2, 1, 15, 30, 2, 1, 19, 38, 2, 1, 23, 46, 2, 1, 27, 54, 2, 1, 31, 62, 2, 1, 35, 70, 2, 1, 39, 78, 2, 1, 43, 86, 2, 1, 47, 94, 2, 1, 51, 102, 2, 1, 55, 110, 2, 1, 59, 118, 2, 1, 63, 126, 2, 1, 67, 134, 2, 1, 71, 142, 2, 1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS A somehow "trivial" variant of A133058 and A255140, both of which have very similar definitions, but enter 4-periodic loops only at later indices. There could be two motivated values for an initial term: either a(0)=0 which would yield a(1)=1 and the following values via the recursion formula, or a(0)=2 according to the general formula for a(4k). LINKS Index entries for linear recurrences with constant coefficients, signature (0,0,0,2,0,0,0,-1). FORMULA a(4k+1) = 1, a(4k+2) = 4k+3, a(4k+3) = 2*a(4k+2) = 8k+6, a(4k) = 2. G.f.: x*(1 + 3*x + 6*x^2 + 2*x^3 - x^4 + x^5 + 2*x^6 - 2*x^7)/((1 - x)^2*(1 + x)^2*(1 + x^2)^2). - Bruno Berselli, Feb 16 2015 a(n) = ( 2*(3 + (-1)^n) - (2 - 3*n + n*(-1)^n)*(1 - (-1)^((n-1)*n/2)) )/4. - Bruno Berselli, Feb 16 2015 EXAMPLE a(2) = a(1)+2 = 3, a(3) = a(2)+3 = 6, a(4) = a(3)/3 = 2, a(5) = a(4)/2 = 1; a(6) = a(5)+6 = 7, a(7) = a(6)+7 = 14, a(8) = a(7)/7 = 2, a(9) = a(8)/2 = 1; ... MATHEMATICA Table[(2 (3 + (-1)^n) - (2 - 3 n + n (-1)^n) (1 - (-1)^((n - 1) n/2)))/4, {n, 1, 80}] (* Bruno Berselli, Feb 16 2015 *) nxt[{n_, a_}]:={n+1, If[GCD[a, n]>1, a/GCD[a, n], a+n+1]}; Transpose[ NestList[ nxt, {1, 1}, 80]][] (* or *) LinearRecurrence[{0, 0, 0, 2, 0, 0, 0, -1}, {1, 3, 6, 2, 1, 7, 14, 2}, 80] (* Harvey P. Dale, Oct 13 2015 *) PROG (PARI) A = vector(1000, i, 1); for(n=1, #A-1, A[n+1] = if(gcd(A[n], n)>1, A[n]/gcd(A[n], n), A[n]+n+1)) (PARI) A255051(n)=if(n%4>1, if(bittest(n, 0), n*2, n+1), 2-bittest(n, 0)) \\ M. F. Hasler, Feb 18 2015 (MAGMA) &cat [[1, 4*n+3, 8*n+6, 2]: n in [0..20]]; // Bruno Berselli, Feb 16 2015 CROSSREFS Cf. A133058, A255140. Sequence in context: A016551 A238555 A176034 * A145896 A159963 A120907 Adjacent sequences:  A255048 A255049 A255050 * A255052 A255053 A255054 KEYWORD nonn,easy AUTHOR M. F. Hasler, Feb 15 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified June 16 11:12 EDT 2019. Contains 324152 sequences. (Running on oeis4.)