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.
%I A211441 #61 Sep 08 2022 08:46:02 %S A211441 0,3,15,33,57,87,123,165,213,267,327,393,465,543,627,717,813,915,1023, %T A211441 1137,1257,1383,1515,1653,1797,1947,2103,2265,2433,2607,2787,2973, %U A211441 3165,3363,3567,3777,3993,4215,4443,4677,4917,5163,5415,5673,5937 %N A211441 Number of ordered triples (w,x,y) with all terms in {-n,...,0,...,n} and w + x + y = 2. %C A211441 For a guide to related sequences, see A211422. %C A211441 From _Klaus Purath_, Jan 08 2019: (Start) %C A211441 Number of dots in a hexagon in which the sides are alternately n-1 and n+3 dots long for n >= 3. a(n) = 3*k^2 + 9*k + 3, where k = n - 1 denotes the number of dots at the shorter side of the hexagon. %C A211441 Let p be a prime number > 5. Then p divides exactly 2 terms out of any in p consecutive terms. If a(i) and a(k) contain the prime factor p, then i + k == -3 (mod p). (End) %C A211441 From _Klaus Purath_, Aug 08 2019: (Start) %C A211441 Proof of Colin Barker's formulas: The first differences of the sequence for n > 0 are equal to 6*n. We assume that the recurrence a(n) = a(n-1) + 6*n is valid for any n > 1. In it, a(n-1) denotes the number of all ordered triples with -n < w, x, y < n according to the definition of the sequence. Consequently, 6*n must denote the number of all ordered triples containing -n and/or n, which must be proved. %C A211441 The statement is empirically confirmed for the first n. We show that this applies to any n. With even n we determine all triples {w,x,y} with w = -n, x + y = n + 2 and start the enumeration of the triples with the highest possible value for x and end with the triple where x = y is: {-n, n, 2}, {-n, n-1, 3}, ..., {-n, n-i, 2+i}, ..., {-n, n-(n-2)/2, 2+(n-2)/2}. These are (n-2)/2 + 1 triples. %C A211441 Now we set w = n and determine all triples {w,x,y} with x + y = 2 - n. We start the enumeration with the smallest possible x and end again, when x = y: {n, -n, 2}, {n, 1-n, 1}, ..., {n, i-n, 2-i}, ..., {n, (n+2)/2-n, 2-(n+2)/2}. These are (n+2)/2 +1 triples. Altogether we get n + 2 triples. Since the first triples of the two enumerations are identical, n + 1 triples remain. To get the ordered triples, they have to be permuted. We take into account that the respectively last triples contain two identical components and that only n - 1 triples consist of three distinct components. Thus the number of ordered triples (w,x,y) totals (n-1)* 3! + 2* 3!/2! = 6*n, which had to be proven. %C A211441 With odd n we proceed in the same way with the difference that we end the two enumerations when |x - y| = 1. With w = -n we start with the largest possible x: {-n, n, 2}, {-n, n-1, 3}, ..., {-n, n-i, 2+i}, ..., {-n, n-(n-3)/2, 2+(n-3)/2}. These are (n-3)/2 + 1 triples. %C A211441 For w = n we start with the smallest possible x: {n, -n, 2}, {n, 1-n, 1}, ..., {n, i-n, 2-i}, ..., {n, (n+1)/2-n, 2-(n+1)/2}. These are (n+1)/2 + 1 triples. Altogether these are n + 1 triples. Because the respectively first triples are identical here, n triples remain, and by permutation this results in 6*n ordered triples. Thus the proof is complete. %C A211441 (End) %H A211441 Muniru A Asiru, <a href="/A211441/b211441.txt">Table of n, a(n) for n = 0..10000</a> %H A211441 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,1). %F A211441 From _Colin Barker_, Apr 18 2012: (Start) %F A211441 a(n) = 3*(n^2 + n - 1) for n > 0. %F A211441 a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 3. %F A211441 G.f.: 3*x*(1 + 2*x - x^2)/(1 - x)^3. (End) %F A211441 From _Klaus Purath_, Jan 08 2019: (Start) %F A211441 a(n) = 3*A028387(n-1). %F A211441 a(n) = 3*A028552(n-1) + 3. %F A211441 a(n) = 3*A002378(n) - 3. %F A211441 a(n) = 3*A003215(n) - 4. %F A211441 a(n) + a(n+1) + a(n+2) + a(n+3) = 3*(2*n+4)^2 = 12*(n+2)^2 for n > 0. %F A211441 a(n) + a(n+1) + a(n+2) = 3*A003215(n+1) - 6 for n > 0. (End) %F A211441 E.g.f.: 3 + 3*exp(x)*(-1 + 2*x + x^2). - _Stefano Spezia_, Aug 08 2019 %e A211441 From _Klaus Purath_, Jan 08 2019: (Start) %e A211441 Illustration of initial terms for n >= 3: %e A211441 . %e A211441 . o o o o o o o o %e A211441 . o o o o o o o o o o o o o o o o %e A211441 . o o o o o o o o o o o o o o o o o o o o o o o o %e A211441 . o o o o o o o o o o o o o o o o o o o o o o o o o o o %e A211441 . o o o o o o o o o o o o o o o o o o o o o o o o %e A211441 . o o o o o o o o o o o o o o o o o o o o o %e A211441 . o o o o o o o o o o o o o o o o o o %e A211441 . o o o o o o o o o o o o o o o %e A211441 . o o o o o o o o o o o o %e A211441 . o o o o o o o o %e A211441 . o o o o %e A211441 . %e A211441 . a(3) = 33 a(4) = 57 a(5) = 87 %e A211441 (End) %t A211441 t[n_]:= t[n]= Flatten[Table[w+x+y-2, {w, -n, n}, {x, -n, n}, {y, -n, n}]] %t A211441 c[n_]:= Count[t[n], 0] %t A211441 t = Table[c[n], {n, 0, 60}] (* A211441 *) %t A211441 t/3 (* A028387 *) %t A211441 Join[{0},LinearRecurrence[{3,-3,1},{3,15,33},50]] (* _Harvey P. Dale_, May 10 2012 *) %o A211441 (GAP) b:=[3,15,33];; for n in [4..50] do b[n]:=3*b[n-1]-3*b[n-2]+b[n-3]; od; a:=Concatenation([0],b);; Print(a); # _Muniru A Asiru_, Jan 23 2019 %o A211441 (PARI) vector(50, n, n--; if(n==0, 0, 3*(n^2+n-1))) \\ _G. C. Greubel_, Feb 10 2019 %o A211441 (Magma) [n le 0 select 0 else 3*(n^2+n-1): n in [0..50]]; // _G. C. Greubel_, Feb 10 2019 %o A211441 (Sage) [0] + [3*(n^2+n-1) for n in (1..50)] # _G. C. Greubel_, Feb 10 2019 %Y A211441 Cf. A211422. %K A211441 nonn,easy %O A211441 0,2 %A A211441 _Clark Kimberling_, Apr 11 2012