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.

A158138 Number of nondecreasing integer sequences of length 4 with sum zero and sum of absolute values 2n.

This page as a plain text file.
%I A158138 #12 Sep 10 2024 15:41:37
%S A158138 1,4,6,11,13,22,24,35,39,52,56,73,77,96,102,123,129,154,160,187,195,
%T A158138 224,232,265,273,308,318,355,365,406,416,459,471,516,528,577,589,640,
%U A158138 654,707,721,778,792,851,867,928,944,1009,1025,1092,1110,1179,1197,1270,1288
%N A158138 Number of nondecreasing integer sequences of length 4 with sum zero and sum of absolute values 2n.
%C A158138 a(n) = A000041(n)^2 for n<=2
%C A158138 a(n) = A000041(n)^2 - cumulative A000712(2*n-1-length), 0 <= 2*n-1-length <= floor(n/2) [empirical].
%H A158138 R. H. Hardin, <a href="/A158138/b158138.txt">Table of n, a(n) for n=1..999</a>
%F A158138 a(n) = (floor(n/2) + 1)^2 + 2*A069905(n). - _Georg Fischer_, Apr 20 2022
%e A158138 For n = 6, we count the possible concatenations of the 4 pairs in the list (-6,0),(-5,-1),(-4,-2),(-3,-3) with their negative reversed correspondants (starting with (-6,0,0,6)), giving (6/2 + 1)^2 = 16 quadruples, plus the 3 quadruples (-6,1,1,4), (-6,1,2,3), (-6,2,2,2) and their 3 negative reversed correspondants, giving a total of 22 possibilities. - _Georg Fischer_, Apr 20 2022
%o A158138 (AWK) # empirical
%o A158138 function a(n) { s=1; for(i=1; i<n; i++) { if(i%2==0)s+=2*int((i+5)/6); else s+=(i+2)+2*int((i+1)/6); } return s; }
%Y A158138 Cf. A069905, A158139-A158184 (for length 5..50).
%K A158138 nonn
%O A158138 1,2
%A A158138 _R. H. Hardin_, Mar 13 2009