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!)
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
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
Sequence in context: A182743 A222601 A104807 * A131793 A065186 A210521
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)