A211422 Number of ordered triples (w,x,y) with all terms in {-n,...,0,...,n} and w^2 + x*y = 0.
1, 9, 17, 25, 41, 49, 57, 65, 81, 105, 113, 121, 137, 145, 153, 161, 193, 201, 225, 233, 249, 257, 265, 273, 289, 329, 337, 361, 377, 385, 393, 401, 433, 441, 449, 457, 505, 513, 521, 529, 545, 553, 561, 569, 585, 609, 617, 625, 657, 713, 753, 761
Offset: 0
Keywords
A029578 The natural numbers interleaved with the even numbers.
0, 0, 1, 2, 2, 4, 3, 6, 4, 8, 5, 10, 6, 12, 7, 14, 8, 16, 9, 18, 10, 20, 11, 22, 12, 24, 13, 26, 14, 28, 15, 30, 16, 32, 17, 34, 18, 36, 19, 38, 20, 40, 21, 42, 22, 44, 23, 46, 24, 48, 25, 50, 26, 52, 27, 54, 28, 56, 29, 58, 30, 60, 31, 62, 32, 64, 33, 66, 34, 68, 35, 70, 36, 72
Offset: 0
Comments
a(n) = number of ordered, length two, compositions of n with at least one odd summand - Len Smiley, Nov 25 2001
Also number of 0's in n-th row of triangle in A071037. - Hans Havermann, May 26 2002
For n > 2: a(n) = number of odd terms in row n-2 of triangle A265705. - Reinhard Zumkeller, Dec 15 2015
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
- Index entries for two-way infinite sequences
- Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
Crossrefs
Programs
-
Haskell
import Data.List (transpose) a029578 n = (n - n `mod` 2) `div` (2 - n `mod` 2) a029578_list = concat $ transpose [a001477_list, a005843_list] -- Reinhard Zumkeller, Nov 27 2012
-
Magma
A029578:= func< n | (n + (n-2)*(n mod 2))/2 >; [A029578(n): n in [0..80]]; // G. C. Greubel, Jan 22 2025
-
Mathematica
With[{nn=40},Riffle[Range[0,nn],Range[0,2nn,2]]] (* or *) LinearRecurrence[ {0,2,0,-1},{0,0,1,2},80] (* Harvey P. Dale, Aug 23 2015 *)
-
PARI
a(n)=if(n%2,n-1,n/2)
-
Python
def A029578(n): return (n + (n-2)*(n%2))//2 print([A029578(n) for n in range(81)]) # G. C. Greubel, Jan 22 2025
Formula
a(n) = (3*n - 2 - (-1)^n*(n - 2))/4.
a(n+4) = 2*a(n+2) - a(n).
G.f.: x^2*(1 + 2*x)/(1-x^2)^2.
a(n) = floor((n+1)/2) + (n is odd)*floor((n+1)/2).
a(n) = (n - n mod 2)/(2 - n mod 2). - Reinhard Zumkeller, Jul 30 2002
a(n) = floor(n/2)*binomial(2, mod(n, 2)) - Paul Barry, May 25 2003
a(2*n) = n.
a(2*n-1) = 2*n-2.
a(-n) = -A065423(n+2).
a(n) = Sum_{k=0..floor((n-2)/2)} (C(n-k-2, k) mod 2)((1+(-1)^k)/2)*2^A000120(n-2k-2). - Paul Barry, Jan 06 2005
a(n) = Sum_{k=0..n-2} gcd(n-k-1, k+1). - Paul Barry, May 03 2005
For n>6: a(n) = floor(a(n-1)*a(n-2)/a(n-3)). - Reinhard Zumkeller, Mar 06 2011
E.g.f.: (1/4)*((x+2)*exp(-x) + (3*x-2)*exp(x)). - G. C. Greubel, Jan 22 2025
Extensions
Explicated definition by Reinhard Zumkeller, Nov 27 2012
Title simplified by Sean A. Irvine, Feb 29 2020
A211539 Number of ordered triples (w,x,y) with all terms in {1,...,n} and 2w = 2n - 2x + y.
0, 0, 2, 3, 7, 9, 15, 18, 26, 30, 40, 45, 57, 63, 77, 84, 100, 108, 126, 135, 155, 165, 187, 198, 222, 234, 260, 273, 301, 315, 345, 360, 392, 408, 442, 459, 495, 513, 551, 570, 610, 630, 672, 693, 737, 759, 805, 828, 876, 900, 950, 975, 1027, 1053
Offset: 0
Comments
For a guide to related sequences, see A211422.
a(n) = sum of natural numbers in interval (floor((n+1)/2),n]. - Jaroslav Krizek, Mar 05 2014
For n > 0, 2*a(n-1) is the sum of the largest parts of the partitions of 2n into two distinct even parts. - Wesley Ivan Hurt, Dec 19 2017
From Paul Curtz, Oct 23 2018: (Start)
Consider the 51 first nonnegative numbers in the following boustrophedon distribution:
35--36--37--38--39--40--41--42--43--44--45
34--33--32--31--30--29--28--27--26--46
12--13--14--15--16--17--18--25--47
11--10---9---8---7--19--24--48
1---2---3---6--20--23--49
0---4---5--21--22--50
a(n+1) is the union of the main vertical (0,2, 9,15, 30,40, ... ) and of the shifted main antidiagonal (3,7, 18,26, 45,57, ... ). (End)
Sum of the shortest side lengths of all integer-sided triangles with perimeter 3(n+1) whose sides lengths are in arithmetic progression (For example, when n=4 there are two triangles with perimeter 3(4+1) = 15 whose side lengths are in arithmetic progression: [3,5,7] and [4,5,6]; thus a(4) = 3+4 = 7). - Wesley Ivan Hurt, Nov 01 2020
Examples
G.f. = 2*x^2 + 3*x^3 + 7*x^4 + 9*x^5 + 15*x^6 + 18*x^7 + ... - _Michael Somos_, Nov 14 2018
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
Programs
-
GAP
a:=[0];; for n in [2..55] do if n mod 2 = 0 then Add(a,a[n-1]+n); else Add(a,a[n-1]+(n-1)/2); fi; od; Concatenation([0],a); # Muniru A Asiru, Oct 26 2018
-
Magma
I:=[0,0,2,3,7]; [n le 5 select I[n] else Self(n-1)+2*Self(n-2)-2*Self(n-3)-Self(n-4)+Self(n-5): n in [1..60]]; // Vincenzo Librandi, Mar 12 2014
-
Maple
a:=n->add(k,k=floor((n+1)/2)+1..n): seq(a(n),n=0..55); # Muniru A Asiru, Oct 26 2018
-
Mathematica
t[n_] := t[n] = Flatten[Table[2 w + 2 x - y - 2 n, {w, 1, n}, {x, 1, n}, {y, 1, n}]] c[n_] := Count[t[n], 0] t = Table[c[n], {n, 0, 70}] (* A211539 *) FindLinearRecurrence[t] CoefficientList[Series[(x^3 + 2 x^2)/((1 + x)^2 (1 - x)^3), {x, 0, 60}], x] (* Vincenzo Librandi, Mar 12 2014 *)
-
PARI
a(n)=(1/16)*(6*n^2+2*n-3+(2*n+3)*(-1)^n) \\ Ralf Stephan, Mar 10 2014
Formula
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
From Jaroslav Krizek, Mar 05 2014: (Start)
a(n) = T(n+1) - T(floor((n+1)/2)) - (n+1), where T(k) = A000217(k).
a(n) = Sum_{k=floor((n+1)/2)+1..n} k.
a(n) = a(n-1) + n for even n; a(n) = a(n-1) + (n-1)/2 for odd n. (End)
From Ralf Stephan, Mar 10 2014: (Start)
a(n) = (1/16) * (6n^2 + 2n - 3 + (2n+3)*(-1)^n ).
G.f.: (x^3+2x^2)/((1+x)^2*(1-x)^3). (End)
From Paul Curtz, Oct 22 2018: (Start)
a(2n) + a(2n+1) = A045944(n).
a(3n) = 3*(0, 1, 5, 10, 19, 28, 42, ...).
a(n+1) = a(n) + A065423(n+2).
a(-n) = A211538(n+2). (End)
E.g.f.: (3*x*(1 + x)*cosh(x) + (-3 + 5*x + 3*x^2)*sinh(x))/8. - Stefano Spezia, Nov 02 2020
a(n) = A001318(n+1) - (n+1). - Davide Rotondo, Apr 07 2024
A268351 a(n) = 3*n*(9*n - 1)/2.
0, 12, 51, 117, 210, 330, 477, 651, 852, 1080, 1335, 1617, 1926, 2262, 2625, 3015, 3432, 3876, 4347, 4845, 5370, 5922, 6501, 7107, 7740, 8400, 9087, 9801, 10542, 11310, 12105, 12927, 13776, 14652, 15555, 16485, 17442, 18426, 19437, 20475, 21540, 22632, 23751, 24897, 26070, 27270
Offset: 0
Comments
First trisection of pentagonal numbers (A000326).
More generally, the ordinary generating function for the first trisection of k-gonal numbers is 3*x*(k - 1 + (2*k - 5)*x)/(1 - x)^3.
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Eric Weisstein's World of Mathematics, Pentagonal Number.
- Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
Programs
-
Magma
[3*n*(9*n-1)/2: n in [0..50]]; // Vincenzo Librandi, Feb 04 2016
-
Mathematica
Table[3 n (9 n - 1)/2, {n, 0, 45}] Table[Binomial[9 n, 2]/3, {n, 0, 45}] LinearRecurrence[{3, -3, 1}, {0, 12, 51}, 45]
-
PARI
a(n)=3*n*(9*n-1)/2 \\ Charles R Greathouse IV, Jul 26 2016
Formula
G.f.: 3*x*(4 + 5*x)/(1 - x)^3.
a(n) = binomial(9*n,2)/3.
a(n) = A211538(6*n+2).
Sum_{n>=1} 1/a(n) = 0.132848490245209886617568... = (-Pi*cot(Pi/9) + 5*log(3) + 4*cos(Pi/9)*log(cos(Pi/18)) - 4*cos(2*Pi/9)*log(sin(Pi/9)) - 4*log(sin(2*Pi/9))*sin(Pi/18))/3. [Corrected by Vaclav Kotesovec, Feb 25 2016]
From Elmo R. Oliveira, Dec 27 2024: (Start)
E.g.f.: 3*exp(x)*x*(8 + 9*x)/2.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2.
a(n) = A022284(n) - n. (End)
Extensions
Edited by Bruno Berselli, Feb 03 2016
A238738 Expansion of (1 + 2*x + 2*x^2)/(1 - x - 2*x^3 + 2*x^4 + x^6 - x^7).
1, 3, 5, 7, 11, 15, 18, 24, 30, 34, 42, 50, 55, 65, 75, 81, 93, 105, 112, 126, 140, 148, 164, 180, 189, 207, 225, 235, 255, 275, 286, 308, 330, 342, 366, 390, 403, 429, 455, 469, 497, 525, 540, 570, 600, 616, 648, 680, 697, 731, 765, 783, 819, 855, 874
Offset: 0
Comments
Examples
G.f.: 1 + 3*x + 5*x^2 + 7*x^3 + 11*x^4 + 15*x^5 + 18*x^6 + 24*x^7 + ...
Links
- Bruno Berselli, Table of n, a(n) for n = 0..1000
- Bruno Berselli, Illustration of the initial terms.
- Index entries for linear recurrences with constant coefficients, signature (1,0,2,-2,0,-1,1).
Programs
-
Magma
m:=60; R
:=PowerSeriesRing(Integers(), m); Coefficients(R!((1+2*x+2*x^2)/(1-x-2*x^3+2*x^4+x^6-x^7))); -
Mathematica
CoefficientList[Series[(1 + 2 x + 2 x^2)/(1 - x - 2 x^3 + 2 x^4 + x^6 - x^7), {x, 0, 60}], x]
-
Maxima
makelist(coeff(taylor((1+2*x+2*x^2)/(1-x-2*x^3+2*x^4+x^6-x^7), x, 0, n), x, n), n, 0, 60);
-
PARI
Vec((1+2*x+2*x^2)/(1-x-2*x^3+2*x^4+x^6-x^7)+O(x^60))
-
Sage
m = 60; L.
= PowerSeriesRing(ZZ, m); f = (1+2*x+2*x^2)/(1-x-2*x^3+2*x^4+x^6-x^7); print(f.coefficients())
Formula
G.f.: (1 + 2*x + 2*x^2) / ((1 - x)^3*(1 + x + x^2)^2).
a(n) = a(n-1) + 2*a(n-3) - 2*a(n-4) - a(n-6) + a(n-7), with n>6.
a(3k) = k*(5*k + 7)/2 + 1 (A000566);
a(3k+1) = k*(5*k + 11)/2 + 3 (A005475);
a(3k+2) = k*(5*k + 15)/2 + 5 (A028895).
a(n) = (floor(n/3)+1)*(4*n-7*floor(n/3)+2)/2. [Luce ETIENNE, Jun 14 2014]
A079811 Sum of numbers read upward at a 45-degree angle in A079809.
1, 2, 2, 6, 7, 10, 10, 18, 19, 24, 24, 36, 37, 44, 44, 60, 61, 70, 70, 90, 91, 102, 102, 126, 127, 140, 140, 168, 169, 184, 184, 216, 217, 234, 234, 270, 271, 290, 290, 330, 331, 352, 352, 396, 397, 420, 420, 468, 469, 494, 494, 546, 547, 574, 574, 630, 631
Offset: 1
Links
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,2,-2,0,0,-1,1).
Crossrefs
Extensions
Terms a(8) and beyond from Andrey Zabolotskiy, Jan 18 2024
A305499 Square array A(n,k), n > 0 and k > 0, read by antidiagonals, with initial values A(1,k) = k and recurrence equations A(n+1,k) = A(n,k) for 0 < k <= n and A(n+1,k) = A(n,k) - A000035(n+k) for 0 < n < k.
1, 1, 2, 1, 1, 3, 1, 1, 3, 4, 1, 1, 2, 3, 5, 1, 1, 2, 3, 5, 6, 1, 1, 2, 2, 4, 5, 7, 1, 1, 2, 2, 4, 5, 7, 8, 1, 1, 2, 2, 3, 4, 6, 7, 9, 1, 1, 2, 2, 3, 4, 6, 7, 9, 10, 1, 1, 2, 2, 3, 3, 5, 6, 8, 9, 11, 1, 1, 2, 2, 3, 3, 5, 6, 8, 9, 11, 12, 1, 1, 2, 2, 3, 3, 4, 5, 7, 8, 10, 11, 13
Offset: 1
Examples
The square array begins: n\k | 1 2 3 4 5 6 7 8 9 10 11 12 ====+======================================= 1 | 1 2 3 4 5 6 7 8 9 10 11 12 2 | 1 1 3 3 5 5 7 7 9 9 11 11 3 | 1 1 2 3 4 5 6 7 8 9 10 11 4 | 1 1 2 2 4 4 6 6 8 8 10 10 5 | 1 1 2 2 3 4 5 6 7 8 9 10 6 | 1 1 2 2 3 3 5 5 7 7 9 9 7 | 1 1 2 2 3 3 4 5 6 7 8 9 8 | 1 1 2 2 3 3 4 4 6 6 8 8 9 | 1 1 2 2 3 3 4 4 5 6 7 8 10 | 1 1 2 2 3 3 4 4 5 5 7 7 11 | 1 1 2 2 3 3 4 4 5 5 6 7 etc.
Crossrefs
Formula
A(n,k) = floor((k+1)/2) for 1 <= k <= n and A(n,k) = floor((k+1)/2) + floor((k+1-n)/2) for 1 <= n < k.
A(n+m,n) = floor((n+1)/2) for n > 0 and some fixed m >= 0.
A(n,n+m) = floor((m+1)/2) + floor((n+1+m)/2) for n>0 and some fixed m >= 0.
A(n+1,k+1) = A(n,k+1) + A(n,k) - A(n-1,k) for k > 0 and n > 1.
A(n,k) = A(n,k-1) + 2*A(n,k-2) - 2*A(n,k-3) - A(n,k-4) + A(n,k-5) for n > 0 and k > 5.
A(n,n) = A008619(n-1) for n > 0.
A(n+1,2*n-1) = A001651(n) for n > 0.
Sum_{i=1..n} A(i,i)*A209229(i) = 2^floor(log_2(n)) for n > 0.
P(n,x) = Sum_{k>0} A(n,k)*x^(k-1) = (1-x^(2*n))/((1-x^n)*(1-x^2)*(1-x)) = (1+x^n)/((1-x^2)*(1-x)) for n > 0.
P(n+1,x) = P(n,x) - x^n/(1-x^2) for n > 0 and P(1,x) = 1/(1-x)^2.
G.f.: Sum_{n>0, k>0} A(n,k)*x^(k-1)*y^(n-1) = (1+x-2*x*y)/((1-x)*(1-x^2) * (1-y)*(1-x*y)).
Conjecture: Sum_{i=1..n} A(n+1-i,i) = A211538(n+3) for n > 0.
Comments
Examples
Links
Crossrefs
Programs
Mathematica