cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A168198 a(n) = 3*n - a(n-1) + 1 with n > 1, a(1)=1.

This page as a plain text file.
%I A168198 #44 Feb 23 2023 03:46:24
%S A168198 1,6,4,9,7,12,10,15,13,18,16,21,19,24,22,27,25,30,28,33,31,36,34,39,
%T A168198 37,42,40,45,43,48,46,51,49,54,52,57,55,60,58,63,61,66,64,69,67,72,70,
%U A168198 75,73,78,76,81,79,84,82,87,85,90,88,93,91,96,94,99,97,102,100,105,103,108
%N A168198 a(n) = 3*n - a(n-1) + 1 with n > 1, a(1)=1.
%C A168198 Alternately add 5 and subtract 2, starting with 1. Apparently this was a test question: Find the next two numbers after 1,6,4,9,7,12,10. - _N. J. A. Sloane_, Dec 18 2010
%H A168198 Vincenzo Librandi, <a href="/A168198/b168198.txt">Table of n, a(n) for n = 1..1000</a>
%H A168198 David Klein, <a href="http://www.ams.org/journals/notices/201101/rtx110100053p.pdf">What do the NAEP math tests really measure?</a>, Notices Amer. Math. Soc., 58 (No. 1, 2011), 53-55.
%H A168198 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1).
%F A168198 a(n) = (6*n + 5 + 7*(-1)^n)/4. - _Jon E. Schoenfield_, Jun 24 2010
%F A168198 G.f.: x*(1+5*x-3*x^2)/((1+x)(1-x)^2). - _Bruno Berselli_, Feb 28 2012
%F A168198 Sum_{n>=1} (-1)^(n+1)/a(n) = 1/3 + Pi/(6*sqrt(3)) + log(3)/2. - _Amiram Eldar_, Feb 23 2023
%e A168198 From _Muniru A Asiru_, Mar 20 2018: (Start)
%e A168198 For n = 2, a(2) = 3*2 - a[2-1] + 1 = 6 - a[1] + 1 = 6 - 1 + 1 = 6.
%e A168198 For n = 3, a(3) = 3*3 - a[3-1] + 1 = 9 - a[2] + 1 = 9 - 6 + 1 = 4.
%e A168198 For n = 4, a(4) = 3*4 - a[4-1] + 1 = 12 - a[3] + 1 = 12 - 4 + 1 = 9.
%e A168198 ... (End)
%p A168198 a:= proc(n) option remember: if n = 1 then 1 elif n >= 2 then 3*n - procname(n-1) + 1 fi; end:
%p A168198 seq(a(n), n = 1..70); # _Muniru A Asiru_, Mar 20 2018
%t A168198 LinearRecurrence[{1,1,-1},{1,6,4},100] (* _Vincenzo Librandi_, Feb 28 2012 *)
%o A168198 (PARI) a(n)=(6*n+5+7*(-1)^n)/4 \\ _Charles R Greathouse IV_, Jan 11 2012
%o A168198 (Magma) I:=[1,6,4]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..60]]; // _Vincenzo Librandi_, Feb 28 2012
%o A168198 (GAP) a:=[1];; for n in [2..80] do a[n]:=3*n-a[n-1]+1; od; a; # _Muniru A Asiru_, Mar 20 2018
%Y A168198 Cf. A084964, A103889, A168199, A168200.
%K A168198 nonn,easy
%O A168198 1,2
%A A168198 _Vincenzo Librandi_, Nov 20 2009