The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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

%I #25 Sep 08 2022 08:46:21

%S 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,

%T 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,

%U 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

%N 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.

%C A well-defined solution sequence for recurrence a(n) = a(n-a(n-2)) + a(n-a(n-3)).

%H Colin Barker, <a href="/A309492/b309492.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1,1,-1,1,-1).

%F For k > 2:

%F a(4*k) = 4*k+1,

%F a(4*k+1) = 4*k-2,

%F a(4*k+2) = 4,

%F a(4*k+3) = 3.

%F From _Colin Barker_, Aug 04 2019: (Start)

%F 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).

%F 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.

%F (End)

%t 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 *)

%o (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

%o (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

%o (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

%Y Cf. A063892, A244477.

%K nonn,easy

%O 1,3

%A _Altug Alkan_, Aug 04 2019

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 May 12 23:40 EDT 2024. Contains 372497 sequences. (Running on oeis4.)