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.

A166514 Zig-zag function for first two columns of a matrix (take numbers in consecutive pairs).

This page as a plain text file.
%I A166514 #15 Aug 03 2024 01:50:58
%S A166514 0,1,1,0,2,1,3,0,4,1,5,0,6,1,7,0,8,1,9,0,10,1,11,0,12,1,13,0,14,1,15,
%T A166514 0,16,1,17,0,18,1,19,0,20,1,21,0,22,1,23,0,24,1,25,0,26,1,27,0,28,1,
%U A166514 29,0,30,1,31,0,32,1,33,0,34,1,35,0,36,1,37,0,38,1,39,0,40,1,41,0,42,1,43,0
%N A166514 Zig-zag function for first two columns of a matrix (take numbers in consecutive pairs).
%H A166514 G. C. Greubel, <a href="/A166514/b166514.txt">Table of n, a(n) for n = 0..1000</a>
%H A166514 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,0,1,0,-1).
%F A166514 G.f.: x*(1+x-x^2+x^3)/((1+x)^2*(1-x)^2*(1+x^2)) = x*(1+x-x^2+x^3)/(1-x^2-x^4+x^6).
%F A166514 a(n) = sin(Pi*n/2)/2 + (n-1)*(1 + (-1)^n)/4.
%F A166514 E.g.f.: (1/2)*(sin(x) + (1 + x)*sinh(x)). - _G. C. Greubel_, Aug 03 2024
%t A166514 CoefficientList[Series[(x + x^2 - x^3 + x^4)/((1 + x)^2*(1 - x)^2*(1 + x^2)), {x, 0, 50}], x] (* _G. C. Greubel_, May 15 2016 *)
%o A166514 (Magma)
%o A166514 A166514:= func< n | ((n mod 2)*(1-(-1)^Floor((n+1)/2)) +((n+1) mod 2)*n)/2 >;
%o A166514 [A166514(n): n in [0..100]]; // _G. C. Greubel_, Aug 03 2024
%o A166514 (SageMath)
%o A166514 def A166514(n): return ((n%2)*(1+(-1)^((n-1)//2)) +((n+1)%2)*n)/2
%o A166514 [A166514(n) for n in range(101)] # _G. C. Greubel_, Aug 03 2024
%K A166514 easy,nonn
%O A166514 0,5
%A A166514 _Paul Barry_, Oct 16 2009