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.

A212570 Number of (w,x,y,z) with all terms in {1,...,n} and |w-x|=|x-y|+|y-z|.

This page as a plain text file.
%I A212570 #16 Oct 02 2021 13:30:39
%S A212570 0,1,6,23,52,105,178,287,424,609,830,1111,1436,1833,2282,2815,3408,
%T A212570 4097,4854,5719,6660,7721,8866,10143,11512,13025,14638,16407,18284,
%U A212570 20329,22490,24831,27296,29953,32742,35735,38868,42217,45714,49439
%N A212570 Number of (w,x,y,z) with all terms in {1,...,n} and |w-x|=|x-y|+|y-z|.
%C A212570 For a guide to related sequences, see A211795.
%C A212570 Apart from the first term, partial sums of A220082. [_Bruno Berselli_, Dec 05 2012]
%H A212570 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-4,1,2,-1).
%F A212570 a(n) = 2a(n-1)+a(n-2)-4a(n-3)+a(n-4)+2a(n-5)-a(n-6).
%F A212570 a(n) = n*(-1-3*(-1)^n+10*n^2)/12. G.f.: x*(x^4+4*x^3+10*x^2+4*x+1)/((x-1)^4*(x+1)^2). [_Colin Barker_, Oct 04 2012]
%t A212570 t = Compile[{{n, _Integer}}, Module[{s = 0},
%t A212570 (Do[If[Abs[w - x] == Abs[x - y] + Abs[y - z], s = s + 1],
%t A212570 {w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
%t A212570 Map[t[#] &, Range[0, 40]]   (* A212570 *)
%t A212570 LinearRecurrence[{2,1,-4,1,2,-1},{0,1,6,23,52,105},40] (* _Harvey P. Dale_, Oct 02 2021 *)
%Y A212570 Cf. A211795.
%K A212570 nonn,easy
%O A212570 0,3
%A A212570 _Clark Kimberling_, May 22 2012