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.

A064455 a(2n) = 3n, a(2n-1) = n.

This page as a plain text file.
%I A064455 #84 Feb 15 2025 02:10:42
%S A064455 1,3,2,6,3,9,4,12,5,15,6,18,7,21,8,24,9,27,10,30,11,33,12,36,13,39,14,
%T A064455 42,15,45,16,48,17,51,18,54,19,57,20,60,21,63,22,66,23,69,24,72,25,75,
%U A064455 26,78,27,81,28,84,29,87,30,90,31,93,32,96,33,99,34,102,35,105,36,108
%N A064455 a(2n) = 3n, a(2n-1) = n.
%C A064455 Also number of 1's in n-th row of triangle in A071030. - _Hans Havermann_, May 26 2002
%C A064455 Number of ON cells at generation n of 1-D CA defined by Rule 54. - _N. J. A. Sloane_, Aug 09 2014
%C A064455 a(n)*A098557(n) equals the second right hand column of A167556. - _Johannes W. Meijer_, Nov 12 2009
%C A064455 Given a(1) = 1, for all n > 1, a(n) is the least positive integer not equal to a(n-1) such that the arithmetic mean of the first n terms is an integer. The sequence of arithmetic means of the first 1, 2, 3, ..., terms is 1, 2, 2, 3, 3, 4, 4, ... (A004526 disregarding its first three terms). - _Rick L. Shepherd_, Aug 20 2013
%H A064455 Harry J. Smith, <a href="/A064455/b064455.txt">Table of n, a(n) for n = 1..1000</a>
%H A064455 A. J. Macfarlane, <a href="http://www.damtp.cam.ac.uk/user/ajm/Papers2016/GFsForCAsOfEvenRuleNo.ps">Generating functions for integer sequences defined by the evolution of cellular automata with even rule numbers</a>, 2016.
%H A064455 S. Wolfram, <a href="http://dx.doi.org/10.1103/RevModPhys.55.601">Statistical mechanics of cellular automata</a>, Rev. Mod. Phys., 55 (1983), 601--644.
%H A064455 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1)
%F A064455 a(n) = (1/2)*n*(-1)^n + n + (1/4)*(1 - (-1)^n). - _Stephen Crowley_, Aug 10 2009
%F A064455 G.f.: x*(1+3*x) / ( (1-x)^2*(1+x)^2 ). - _R. J. Mathar_, Mar 30 2011
%F A064455 From _Jaroslav Krizek_, Mar 22 2011: (Start)
%F A064455 a(n) = n - A123684(n-1) for odd n.
%F A064455 a(n) = n + a(n-1) for even n.
%F A064455 a(n) = A123684(n) + A137501(n).
%F A064455 Abs( a(n) - A123684(n) ) =  A052928(n). (End)
%F A064455 a(n) = Sum_{i=n..2*n} i*(-1)^i. - _Bruno Berselli_, Jun 05 2013
%F A064455 a(n) = n + floor(n/2)*(-1)^(n mod 2). - _Bruno Berselli_, Dec 14 2015
%F A064455 a(n) = (n^2-3*n+2) mod (2*n-1) for n>2. - _Jim Singh_, Oct 31 2018
%F A064455 E.g.f.: (1/2)*(x*cosh(x) + (1+3*x)*sinh(x)). - _G. C. Greubel_, Jan 30 2025
%e A064455 a(13) = a(2*7 - 1) = 7, a(14) = a(2*7) = 21.
%e A064455 a(8) = 8-9+10-11+12-13+14-15+16 = 12. - _Bruno Berselli_, Jun 05 2013
%p A064455 A064455 := proc(n)
%p A064455     if type(n,'even') then
%p A064455         3*n/2 ;
%p A064455     else
%p A064455         (n+1)/2 ;
%p A064455     end if;
%p A064455 end proc: # _R. J. Mathar_, Aug 03 2015
%t A064455 Table[ If[ EvenQ[n], 3n/2, (n + 1)/2], {n, 1, 70} ]
%o A064455 (ARIBAS) maxarg := 75; for n := 1 to maxarg do if n mod 2 = 1 then write((n+1) div 2, " ") else write((n div 2)*3," "); end; end;
%o A064455 (PARI) a(n) = { if (n%2, (n + 1)/2, 3*n/2) } \\ _Harry J. Smith_, Sep 14 2009
%o A064455 (PARI) a(n)=if(n<3,2*n-1,((n-1)*(n-2))%(2*n-1)) \\ _Jim Singh_, Oct 14 2018
%o A064455 (Haskell)
%o A064455 import Data.List (transpose)
%o A064455 a064455 n = n + if m == 0 then n' else - n'  where (n',m) = divMod n 2
%o A064455 a064455_list = concat $ transpose [[1 ..], [3, 6 ..]]
%o A064455 -- _Reinhard Zumkeller_, Oct 12 2013
%o A064455 (Magma) [(1/2)*n*(-1)^n+n+(1/4)*(1-(-1)^n): n in [1..80]]; // _Vincenzo Librandi_, Aug 10 2014
%o A064455 (GAP) a:=[];;  for n in [1..75] do if n mod 2 = 0 then Add(a,3*n/2); else Add(a,(n+1)/2); fi; od; a; # _Muniru A Asiru_, Oct 28 2018
%o A064455 (Python)
%o A064455 def A064455(n): return (3*n - (2*n-1)*(n%2))//2
%o A064455 print([A064455(n) for n in range(1,81)]) # _G. C. Greubel_, Jan 30 2025
%Y A064455 Interleaving of A000027 and A008585 (without first term).
%Y A064455 Cf. A004526, A052928, A064433, A071030, A080512, A098557, A123684, A137501, A167556, A225144, A265888.
%K A064455 nonn,easy
%O A064455 1,2
%A A064455 _N. J. A. Sloane_, Oct 02 2001