# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a289205 Showing 1-1 of 1 %I A289205 #15 Aug 20 2017 13:03:14 %S A289205 1,1,1,3,1,4,2,1,6,1,9,2,1,11,1,14,2,1,16,1,19,2,1,21,1,24,2,1,26,1, %T A289205 29,2,1,31,1,34,2,1,36,1,39,2,1,41,1,44,2,1,46,1,49,2,1,51,1,54,2,1, %U A289205 56,1,59,2,1,61,1,64,2,1,66,1,69,2,1,71,1,74,2,1,76,1,79,2,1,81,1,84,2,1,86,1,89,2,1,91,1,94,2,1,96,1,99,2,1,101 %N A289205 a(1) = a(2) = a(3) = 1, a(4) = 3; a(n) = n - a(n-a(n-1)) - a(n-a(n-2)) for n > 4. %H A289205 Colin Barker, Table of n, a(n) for n = 1..1000 %H A289205 Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,2,0,0,0,0,-1). %F A289205 a(5k) = a(5k + 3) = 1, a(5k + 1) = 5k - 1, a(5k + 2) = 2, a(5k + 4) = 5k + 1 for k > 0. %F A289205 From _Colin Barker_, Jun 28 2017: (Start) %F A289205 G.f.: x*(1 + x)*(1 + x^2 + 2*x^3 - x^4 + 3*x^5 - 3*x^6 + 2*x^7 - 2*x^8 + x^9 + x^10 - 2*x^11 + 2*x^12) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)^2). %F A289205 a(n) = 2*a(n-5) - a(n-10) for n>12. %F A289205 (End) %t A289205 LinearRecurrence[{0,0,0,0,2,0,0,0,0,-1},{1,1,1,3,1,4,2,1,6,1,9,2,1,11},120] (* _Harvey P. Dale_, Aug 20 2017 *) %o A289205 (PARI) q=vector(10^5); q[1]=q[2]=q[3]=1;q[4]=3; for(n=5, #q, q[n] = n-q[n-q[n-1]]-q[n-q[n-2]]); q %o A289205 (PARI) Vec(x*(1 + x)*(1 + x^2 + 2*x^3 - x^4 + 3*x^5 - 3*x^6 + 2*x^7 - 2*x^8 + x^9 + x^10 - 2*x^11 + 2*x^12) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)^2) + O(x^100)) \\ _Colin Barker_, Jun 28 2017 %Y A289205 Cf. A244477. %K A289205 nonn,easy %O A289205 1,4 %A A289205 _Altug Alkan_, Jun 28 2017 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE