The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A309492 a(1) = a(2) = 1, a(3) = 3, a(4) = 5, a(5) = 2; a(n) = a(n-a(n-2)) + a(n-a(n-3)) for n > 5. 7
 1, 1, 3, 5, 2, 4, 3, 9, 6, 4, 3, 13, 10, 4, 3, 17, 14, 4, 3, 21, 18, 4, 3, 25, 22, 4, 3, 29, 26, 4, 3, 33, 30, 4, 3, 37, 34, 4, 3, 41, 38, 4, 3, 45, 42, 4, 3, 49, 46, 4, 3, 53, 50, 4, 3, 57, 54, 4, 3, 61, 58, 4, 3, 65, 62, 4, 3, 69, 66, 4, 3, 73, 70, 4, 3, 77, 74, 4, 3, 81, 78, 4, 3, 85, 82, 4, 3 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 COMMENTS A well-defined solution sequence for recurrence a(n) = a(n-a(n-2)) + a(n-a(n-3)). LINKS Colin Barker, Table of n, a(n) for n = 1..1000 Index entries for linear recurrences with constant coefficients, signature (1,-1,1,1,-1,1,-1). FORMULA For k > 2:   a(4*k)   = 4*k+1,   a(4*k+1) = 4*k-2,   a(4*k+2) = 4,   a(4*k+3) = 3. From Colin Barker, Aug 04 2019: (Start) G.f.: x*(1 + 3*x^2 + 2*x^3 - 2*x^4 + 4*x^5 - 7*x^6 + 6*x^7 - 3*x^8) / ((1 - x)^2*(1 + x)*(1 + x^2)^2). a(n) = a(n-1) - a(n-2) + a(n-3) + a(n-4) - a(n-5) + a(n-6) - a(n-7) for n > 9. (End) MATHEMATICA a[n_] := a[n] = If[n < 6, {1, 1, 3, 5, 2}[[n]], a[n - a[n-2]] + a[n - a[n-3]]]; Array[a, 87] (* Giovanni Resta, Aug 07 2019 *) PROG (PARI) q=vector(100); q[1]=1; q[2]=1; q[3]=3; q[4]=5; q[5]=2; for(n=6, #q, q[n]=q[n-q[n-2]]+q[n-q[n-3]]); q (PARI) Vec(x*(1 + 3*x^2 + 2*x^3 - 2*x^4 + 4*x^5 - 7*x^6 + 6*x^7 - 3*x^8) / ((1 - x)^2*(1 + x)*(1 + x^2)^2) + O(x^40)) \\ Colin Barker, Aug 15 2019 (MAGMA) I:=[1, 1, 3, 5, 2]; [n le 5 select I[n] else Self(n-Self(n-2))+Self(n-Self(n-3)): n in [1..90]]; // Marius A. Burtea, Aug 07 2019 CROSSREFS Cf. A063892, A244477. Sequence in context: A182743 A222601 A104807 * A131793 A065186 A210521 Adjacent sequences:  A309489 A309490 A309491 * A309493 A309494 A309495 KEYWORD nonn,easy AUTHOR Altug Alkan, Aug 04 2019 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 5 18:48 EDT 2020. Contains 334854 sequences. (Running on oeis4.)