Search: a093178 -id:a093178
|
|
A100727
|
|
Continued fraction expansion of (1/2) [tan(1) + sec(1)].
|
|
+0
0
|
|
|
1, 1, 2, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 5, 1, 2, 1, 6, 1, 2, 1, 7, 1, 2, 1, 8, 1, 2, 1, 9, 1, 2, 1, 10, 1, 2, 1, 11, 1, 2, 1, 12, 1, 2, 1, 13, 1, 2, 1, 14, 1, 2, 1, 15, 1, 2, 1, 16, 1, 2, 1, 17, 1, 2, 1, 18, 1, 2, 1, 19, 1, 2, 1, 20, 1, 2, 1, 21, 1, 2, 1, 22, 1, 2, 1, 23, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Periodic part is ...1,2,1,k,..., for k=2..oo.
|
|
LINKS
|
|
|
FORMULA
|
G.f.: (x^4-x^2-1)*(x^6+x^5+x^4-x^3-x^2-x-1) / ((x-1)^2*(x+1)^2*(x^2+1)^2). - Colin Barker, Jul 16 2013
|
|
EXAMPLE
|
1.704111721167913924209364024428505183278823713737764668609552441...
|
|
MATHEMATICA
|
ContinuedFraction[(Tan[1]+Sec[1])/2, 100] (* Harvey P. Dale, Feb 11 2015 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,cofr,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A124625
|
|
Even numbers sandwiched between 1's.
|
|
+0
11
|
|
|
1, 0, 1, 2, 1, 4, 1, 6, 1, 8, 1, 10, 1, 12, 1, 14, 1, 16, 1, 18, 1, 20, 1, 22, 1, 24, 1, 26, 1, 28, 1, 30, 1, 32, 1, 34, 1, 36, 1, 38, 1, 40, 1, 42, 1, 44, 1, 46, 1, 48, 1, 50, 1, 52, 1, 54, 1, 56, 1, 58, 1, 60, 1, 62, 1, 64, 1, 66, 1, 68, 1, 70, 1, 72, 1, 74, 1, 76, 1, 78, 1, 80, 1, 82, 1, 84
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
Created to simplify the definition of A129952.
Starting (1, 2, 1, 4,...): square (1 + x - x^2 - x^3 + x^4 + x^5 - ...) = (1 + 2x - x^2 - 4x^3 + x^4 + 6x^5 - ...).
With a(3) taken as 0, a(n+2) = n^k+1 mod 2*n, n>=1, for any k>=2, also for k=n. - Wolfdieter Lang, Dec 21 2011
Greatest common divisor of n-1 and (n-1) mod 2. - Bruno Berselli, Mar 07 2017
|
|
REFERENCES
|
Murat Sahin and Elif Tan, Conditional (strong) divisibility sequences, Fib. Q., 56 (No. 1, 2018), 18-31.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 1 for even n, a(n) = n-1 for odd n.
a(2*k) = 1, a(2*k+1) = 2*k.
G.f.: (1 - x^2 + 2*x^3)/((1 - x)^2*(1 + x)^2).
E.g.f.: 1 + x^2*U(0)/2 where U(k)= 1 + 2*x*(k+1)/(2*k + 3 - x*(2*k+3)/(x + 4*(k+2)*(k+1)/U(k+1)) (continued fraction, 3rd kind, 3-step). - Sergei N. Gladkovskii, Oct 20 2012
a(n) = (n-1) - a(a(n-1))*a(n-1), a(0) = 0. - Eli Jaffe, Jun 07 2016
|
|
MAPLE
|
|
|
MATHEMATICA
|
|
|
PROG
|
(PARI) {for(n=0, 85, print1(if(n%2>0, n-1, 1), ", "))}
(Magma) &cat[[1, 2*k]: k in [0..42]];
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
A009001
|
|
Expansion of e.g.f: (1+x)*cos(x).
|
|
+0
6
|
|
|
1, 1, -1, -3, 1, 5, -1, -7, 1, 9, -1, -11, 1, 13, -1, -15, 1, 17, -1, -19, 1, 21, -1, -23, 1, 25, -1, -27, 1, 29, -1, -31, 1, 33, -1, -35, 1, 37, -1, -39, 1, 41, -1, -43, 1, 45, -1, -47, 1, 49, -1, -51, 1, 53, -1, -55, 1, 57, -1, -59, 1, 61, -1, -63, 1, 65, -1, -67, 1, 69, -1, -71, 1, 73, -1, -75, 1, 77, -1, -79, 1, 81, -1, -83, 1, 85
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
If signs are ignored, continued fraction for tan(1) (cf. A093178).
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (-1)^(n/2) if n is even, n*(-1)^((n-1)/2) if n is odd.
a(n) = -a(n-2) if n is even, 2*a(n-1) - a(n-2) if n is odd. - Michael Somos, Jan 26 2014
a(n) = (n^n mod (n+1))*(-1)^floor(n/2) for n > 0.
a(n) = (-1)^n*(a(n-2) - a(n-1)) - a(n-3) for n > 2. (End)
G.f.: (1+x+x^2-x^3)/(1+x^2)^2.
a(0) = 1; for n > 1,
a(n) = a(n-1) * n if n mod 4 = 1,
a(n-1) - n if n mod 4 = 2,
a(n-1) * n if n mod 4 = 3,
a(n-1) + n if n mod 4 = 4. (End)
|
|
EXAMPLE
|
tan(1) = 1.557407724654902230... = 1 + 1/(1 + 1/(1 + 1/(3 + 1/(1 + ...)))). - Harry J. Smith, Jun 15 2009
G.f. = 1 + x - x^2 - 3*x^3 + x^4 + 5*x^5 - x^6 - 7*x^7 + x^8 + 9*x^9 - x^10 + ...
|
|
MAPLE
|
seq(coeff(series(factorial(n)*(1+x)*cos(x), x, n+1), x, n), n=0..90); # Muniru A Asiru, Jul 21 2018
|
|
MATHEMATICA
|
With[{nn=90}, CoefficientList[Series[(1+x)Cos[x], {x, 0, nn}], x]Range[0, nn]!] (* Harvey P. Dale, Jul 15 2012 *)
FoldList[If[Mod[#2, 4]==1, #1*#2, If[Mod[#2, 4]==2, #1-#2, If[Mod[#2, 4] ==3, #1*#2, #1+#2]]]&, 1, Range[1, 85]] (* James C. McMahon, Oct 12 2023 *)
|
|
PROG
|
(PARI) {a(n) = (-1)^(n\2) * if( n%2, n, 1)} /* Michael Somos, Oct 16 2006 */
(PARI) { allocatemem(932245000); default(realprecision, 79000); x=contfrac(tan(1)); for (n=0, 20000, write("b009001.txt", n, " ", (-1)^(n\2)*x[n+1])); } \\ Harry J. Smith, Jun 15 2009
(Magma) m:=50; R<x>:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!((1+x)*Cos(x))); [Factorial(n-1)*b[n]: n in [1..m]]; // G. C. Greubel, Jul 21 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,easy,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
A226725
|
|
Denominator of the median of {1, 1/2, 1/3, ..., 1/n}.
|
|
+0
2
|
|
|
1, 4, 2, 12, 3, 24, 4, 40, 5, 60, 6, 84, 7, 112, 8, 144, 9, 180, 10, 220, 11, 264, 12, 312, 13, 364, 14, 420, 15, 480, 16, 544, 17, 612, 18, 684, 19, 760, 20, 840, 21, 924, 22, 1012, 23, 1104, 24, 1200, 25, 1300, 26, 1404, 27, 1512, 28, 1624, 29, 1740, 30
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (n+1)/2 if n is odd, a(n) = n*(n/2+1) if n is even.
G.f.: W(0), where W(k)= 1 + 2*x*(k+2)/( 1 - x/(x + 2*(k+1)/W(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 16 2013
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6). - Colin Barker, Feb 27 2015
G.f.: x*(x^2-4*x-1) / ((x-1)^3*(x+1)^3). - Colin Barker, Feb 27 2015
a(n) = n^(1/2 + (-1)^n/2)*(n + 2^(1/2 + (-1)^n/2))/2. - Wesley Ivan Hurt, Feb 27 2015
|
|
EXAMPLE
|
median{1, 1/2, 1/3, 1/4} = (1/2 + 1/3)/2 = 7/12, so that a(4) = 12.
|
|
MAPLE
|
|
|
MATHEMATICA
|
Denominator[Table[Median[Table[1/k, {k, n}]], {n, 120}]]
f[n_] := If[ OddQ@ n, Floor[(n + 1)/2], n(n/2 + 1)]; Array[f, 59] (* Robert G. Wilson v, Feb 27 2015 *)
With[{nn=30}, Riffle[Range[nn], Table[2n+2n^2, {n, nn}]]] (* Harvey P. Dale, May 26 2019 *)
Riffle[Range[60], LinearRecurrence[{3, -3, 1}, {4, 12, 24}, 60]] (* Harvey P. Dale, Oct 03 2023 *)
|
|
PROG
|
(PARI) Vec(x*(x^2-4*x-1)/((x-1)^3*(x+1)^3) + O(x^100)) \\ Colin Barker, Feb 27 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
A019426
|
|
Continued fraction for tan(1/3).
|
|
+0
4
|
|
|
0, 2, 1, 7, 1, 13, 1, 19, 1, 25, 1, 31, 1, 37, 1, 43, 1, 49, 1, 55, 1, 61, 1, 67, 1, 73, 1, 79, 1, 85, 1, 91, 1, 97, 1, 103, 1, 109, 1, 115, 1, 121, 1, 127, 1, 133, 1, 139, 1, 145, 1, 151, 1, 157, 1, 163, 1, 169, 1, 175, 1, 181, 1, 187, 1, 193, 1, 199, 1, 205, 1, 211, 1, 217, 1, 223, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
The simple continued fraction expansion of 3*tan(1/3) is [1; 25, 1, 3, 1, 61, 1, 7, 1, 97, 1, 11, 1, ..., 36*n + 25, 1, 4*n + 3, 1, ...], while the simple continued fraction expansion of (1/3)*tan(1/3) is [0; 8, 1, 1, 1, 43, 1, 5, 1, 79, 1, 9, 1, 115, 1, 13, 1, ..., 36*n + 7, 1, 4*n + 1, 1, ...]. See my comment in A019425. - Peter Bala, Sep 30 2023
|
|
LINKS
|
|
|
FORMULA
|
G.f.: x*(2+x+3*x^2-x^3+x^4)/(1-x^2)^2.
a(n) = 2*a(n-2)-a(n-4) with n>4, a(0)=0, a(1)=2, a(2)=1, a(3)=7, a(4)=1.
a(n) = 1+3*(1-(-1)^n)*(n-1)/2 with n>1, a(0)=0, a(1)=2.
For k>0: a(2k) = 1, a(4k+1) = 2*a(2k+1)-1 and a(4k+3) = 2*a(2k+1)+5, with a(0)=0, a(1)=2. (End)
|
|
EXAMPLE
|
0.346253549510575491038543565... = 0 + 1/(2 + 1/(1 + 1/(7 + 1/(1 + ...)))). - Harry J. Smith, Jun 13 2009
|
|
MATHEMATICA
|
|
|
PROG
|
(PARI) { allocatemem(932245000); default(realprecision, 88000); x=contfrac(tan(1/3)); for (n=0, 20000, write("b019426.txt", n, " ", x[n+1])); } \\ Harry J. Smith, Jun 13 2009
(Magma) [n le 1 select 2*n else 1+3*(1-(-1)^n)*(n-1)/2: n in [0..80]]; // Bruno Berselli, Sep 21 2012
|
|
CROSSREFS
|
Cf. A161012 (decimal expansion of tan(1/3)).
|
|
KEYWORD
|
nonn,easy,cofr
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A241269
|
|
Denominator of c(n) = (n^2+n+2)/((n+1)*(n+2)*(n+3)).
|
|
+0
8
|
|
|
3, 6, 15, 60, 105, 21, 126, 360, 495, 330, 429, 1092, 1365, 420, 1020, 2448, 2907, 1710, 1995, 4620, 5313, 759, 3450, 7800, 8775, 4914, 5481, 12180, 13485, 3720, 8184, 17952, 19635, 10710, 11655, 25308, 27417, 3705, 15990, 34440, 37023, 19866, 21285, 45540
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
All terms are multiples of 3.
Difference table of c(n):
1/3, 1/6, 2/15, 7/60, 2/21,...
-1/6, -1/30, -1/60, -1/84, -1/105,...
2/15, 1/60, 1/210, 1/420, 1/630,...
-7/60, -1/84, -1/420, -1/1260, -1/2520,... .
This is an autosequence of the second kind; the inverse binomial transform is the signed sequence. The main diagonal is the first upper diagonal multiplied by 2.
Denominators of the main diagonal: A051133(n+1).
Denominators of the first upper diagonal; A000911(n).
Based on the Akiyama-Tanigawa transform applied to 1/(n+1) which yields the Bernoulli numbers A164555(n)/A027642(n).
Are the numerators of the main diagonal (-1)^n? If yes, what is the value of 1/3 - 1/30 + 1/210,... or 1 - 1/10 + 1/70 - 1/420, ... , from A002802(n)?
Is a(n+40) - a(n) divisible by 10?
Are the common divisors to A014206(n) and A007531(n+3) of period 16: repeat 2, 4, 4, 2, 2, 16, 4, 2, 2, 4, 4, 2, 2, 8, 4, 2?
Reduce c(n) = f(n) = b(n)/a(n) = 1/3, 1/6, 2/15, 7/60, 11/105, 2/21, 11/126, 29/360, ... .
Consider the successively interleaved autosequences (also called eigensequences) of the second kind and of the first kind
1, 1/2, 1/3, 1/4, 1/5, 1/6, ...
0, 1/6, 1/6, 3/20, 2/15, 5/42, ...
1/3, 1/6, 2/15, 7/60, 11/105, 2/21, ...
0, 1/10, 1/10, 13/140, 3/35, 5/63, ...
1/5, 1/10, 3/35, 11/140, 23/315, 43/630, ...
0, 1/14, 1/14, 17/252, 4/63, ...
This array is Au1(m,n). Au1(0,0)=1, Au1(0,1)=1/2.
Au1(m+1,n) = 2*Au1(m,n+1) - Au1(m,n).
First row: see A003506, Leibniz's Harmonic Triangle.
a(n) is the denominator of the third row f(n).
The first column is 1, 0, 1/3, 0, 1/5, 0, 1/7, 0, ... . Numerators: A093178(n+1). This incites, considering tan(1), to introduce before the first row
Ta0(n) = 0, 1/2, 1/2, 5/12, 1/3, 4/15, 13/60, 151/840, ... .
|
|
LINKS
|
|
|
FORMULA
|
The sum of the difference table main diagonal is 1/3 - 1/30 + 1/210 - ... = 10*A086466-4 = 4*(sqrt(5)*log(phi)-1) = 0.3040894... - Jean-François Alcover, Apr 22 2014
a(n) = (n+1)*(n+2)*(n+3)/gcd(4*n - 4, n^2 + n + 2), where gcd(4*n - 4, n^2 + n + 2) is periodic with period 16. - Robert Israel, Jul 17 2023
|
|
MAPLE
|
seq(denom((n^2+n+2)/((n+1)*(n+2)*(n+3))), n=0..1000);
|
|
MATHEMATICA
|
Denominator[Table[(n^2+n+2)/Times@@(n+{1, 2, 3}), {n, 0, 50}]] (* Harvey P. Dale, Mar 27 2015 *)
|
|
PROG
|
(PARI) for(n=0, 100, print1(denominator((n^2+n+2)/((n+1)*(n+2)*(n+3))), ", ")) \\ Colin Barker, Apr 18 2014
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
A289296
|
|
a(n) = (n - 1)*(2*floor(n/2) + 1).
|
|
+0
4
|
|
|
-1, 0, 3, 6, 15, 20, 35, 42, 63, 72, 99, 110, 143, 156, 195, 210, 255, 272, 323, 342, 399, 420, 483, 506, 575, 600, 675, 702, 783, 812, 899, 930, 1023, 1056, 1155, 1190, 1295, 1332, 1443, 1482, 1599, 1640, 1763, 1806, 1935, 1980, 2115, 2162, 2303, 2352, 2499, 2550, 2703, 2756, 2915
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Summing a(n) by pairs, one gets -1, 9, 35, 77, 135, ... = A033566.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n^2-1 if n is even and n^2-n if n is odd.
G.f.: -(1 - x - 5*x^2 - x^3 - 2*x^4) / ((1 - x)^3*(1 + x)^2).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4. (End)
|
|
MATHEMATICA
|
Table[(n - 1) (2 Floor[n/2] + 1), {n, 0, 60}] (* or *) LinearRecurrence[{1, 2, -2, -1, 1}, {-1, 0, 3, 6, 15}, 61]
|
|
PROG
|
(PARI) Vec(-(1 - x - 5*x^2 - x^3 - 2*x^4) / ((1 - x)^3*(1 + x)^2) + O(x^60)) \\ Colin Barker, Jul 02 2017
(Python)
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A161738
|
|
Sequence related to the column sums of the BG2 matrix
|
|
+0
4
|
|
|
1, 1, 3, 15, 35, 315, 693, 9009, 19305, 328185, 692835, 14549535, 30421755, 760543875, 1579591125, 45808142625, 94670161425, 3124115327025, 6432002143875, 237984079323375, 488493636505875, 20028239096740875
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
FORMULA
|
a(n) = product((2*n-3-2*k), k=0..floor(n/2-1)).
numer(a(n+2)/a(n+1)) = A005408(n) for n=>0.
denom(a(n+2)/a(n+1)) = A093178(n) for n=>0.
|
|
MATHEMATICA
|
Table[Product[(2*n - 3 - 2*k), {k, 0, Floor[n/2 - 1]}], {n, 1, 50}] (* G. C. Greubel, Sep 26 2018 *)
|
|
PROG
|
(PARI) for(n=1, 50, print1(prod(k=0, floor(n/2 -1), 2*n-2*k-3), ", ")) \\ G. C. Greubel, Sep 26 2018
(Magma) [1] cat [(&*[2*n-2*k-3:k in [0..Floor(n/2 -1)]]): n in [2..50]]; // G. C. Greubel, Sep 26 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|
|
A129779
|
|
a(1) = 1, a(2) = -1, a(3) = 2; for n > 3, a(n) = -(2*n-5)*a(n-1).
|
|
+0
3
|
|
|
1, -1, 2, -6, 30, -210, 1890, -20790, 270270, -4054050, 68918850, -1309458150, 27498621150, -632468286450, 15811707161250, -426916093353750, 12380566707258750, -383797567925021250, 12665319741525701250
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
Sequence is also the first column of the inverse of the infinite lower triangular matrix M, where M(j,k) = 1+2*(k-1)*(j-k) for k < j, M(j,k) = 1 for k = j, M(j,k) = 0 for k > j.
Upper left 6 X 6 submatrix of M is
[ 1 0 0 0 0 0 ]
[ 1 1 0 0 0 0 ]
[ 1 3 1 0 0 0 ]
[ 1 5 5 1 0 0 ]
[ 1 7 9 7 1 0 ]
[ 1 9 13 13 9 1 ],
and upper left 6 X 6 submatrix of M^-1 is
[ 1 0 0 0 0 0 ]
[ -1 1 0 0 0 0 ]
[ 2 -3 1 0 0 0 ]
[ -6 10 -5 1 0 0 ]
[ 30 -50 26 -7 1 0 ]
[ -210 350 -182 50 -9 1 ].
Row sums of M are 1, 2, 5, 12, 25, 46, ... (see A116731); diagonal sums of M are 1, 1, 2, 4, 7, 13, 20, 32, 45, 65, 86, 116, 147, 189, ... with first differences 0, 1, 2, 3, 6, 7, 12, 13, 20, 21, 30, 31, 42, ... and second differences 1, 1, 1, 3, 1, 5, 1, 7, 1, 9, 1, 11, ... (see A093178).
|
|
LINKS
|
|
|
FORMULA
|
a(n) = (-1)^(n-1)*A097801(n-2) = (-1)^(n-1)*(2*(n-2))!/((n-2)!*2^(n-3)) for n > 2, with a(1)=1, a(2)=-1.
G.f.: 1 + x - x*W(0) , where W(k) = 1 + 1/( 1 - x*(2*k+1)/( x*(2*k+1) - 1/W(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 22 2013
|
|
MAPLE
|
seq(`if`(n<3, (-1)^(n-1), (-1)^(n-1)*(2*n-5)!/(2^(n-4)*(n-3)!)), n=1..25); # G. C. Greubel, Nov 25 2019
|
|
MATHEMATICA
|
Table[If[n<3, (-1)^(n-1), (-1)^(n+1)*(2*n-5)!/(2^(n-4)*(n-3)!)], {n, 25}] (* G. C. Greubel, Nov 25 2019 *)
|
|
PROG
|
(PARI) {m=19; print1(1, ", ", -1, ", "); print1(a=2, ", "); for(n=4, m, k=-(2*n-5)*a; print1(k, ", "); a=k)} \\ Klaus Brockhaus, May 21 2007
(PARI) {print1(1, ", ", -1, ", "); for(n=3, 19, print1((-1)^(n-1)*(2*(n-2))!/((n-2)!*2^(n-3)), ", "))} \\ Klaus Brockhaus, May 21 2007
(PARI) {m=19; M=matrix(m, m, j, k, if(k>j, 0, if(k==j, 1, 1+2*(k-1)*(j-k)))); print((M^-1)[, 1]~)} \\ Klaus Brockhaus, May 21 2007
(Magma) m:=19; M:=Matrix(IntegerRing(), m, m, [< j, k, Maximum(0, 1+2*(k-1)*(j-k)) > : j, k in [1..m] ] ); Transpose(ColumnSubmatrix(M^-1, 1, 1)); \\ Klaus Brockhaus, May 21 2007
(Magma) F:=Factorial; [1, -1] cat [(-1)^(n+1)*F(2*n-5)/(2^(n-4)*F(n-3)): n in [3..25]]; // G. C. Greubel, Nov 25 2019
(Sage) f=factorial; [1, -1]+[(-1)^(n+1)*f(2*n-5)/(2^(n-4)*f(n-3)) for n in (3..25)] # G. C. Greubel, Nov 25 2019
(GAP) F:=Factorial;; Concatenation([1, -1], List([3..25], n-> (-1)^(n+1)*F(2*n-5)/(2^(n-4)*F(n-3)) )); # G. C. Greubel, Nov 25 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|
|
|
|
1, 2, 3, 6, 7, 12, 13, 20, 21, 30, 31, 42, 43, 56, 57, 72, 73, 90, 91, 110, 111, 132, 133, 156, 157, 182, 183, 210, 211, 240, 241, 272, 273, 306, 307, 342, 343, 380, 381, 420, 421, 462, 463, 506, 507, 552, 553, 600, 601, 650, 651, 702, 703, 756, 757, 812, 813
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Numbers n such that floor(n/2) is a positive triangular number. - Bruno Berselli, Sep 15 2014
|
|
LINKS
|
|
|
FORMULA
|
a(1) = 1; for n > 1, a(n) = a(n-1)+1 if n is odd, a(n) = a(n-1)+(n-1) if n is even.
a(n) = A002061((n+1)/2) = (n^2+3)/4 if n is odd, a(n) = A002378(n/2) = (n^2+2*n)/4) if n is even.
G.f.: x*(1+x-x^2+x^3)/((1-x)^3*(1+x)^2).
a(1) = 1; a(n) = a(n-1) + n^(n mod 2) = (1/4)*(n^2 + 2n + 4 + (n mod 2)*(2n-1)). - Rolf Pleisch, Feb 04 2008
a(n) = (2*(n-1)*(n+2) + (2*n-3)*(-1)^n+7)/8. - Bruno Berselli, Mar 31 2011
|
|
MATHEMATICA
|
Accumulate[Join[{1}, Riffle[Range[1, 85, 2], 1]]] (* or *) LinearRecurrence[ {1, 2, -2, -1, 1}, {1, 2, 3, 6, 7}, 90] (* Harvey P. Dale, Jun 01 2016 *)
|
|
PROG
|
(PARI) {s=0; for(n=1, 57, s=s+if(n%2>0, 1, n-1); print1(s, ", "))}
(PARI) {for(n=1, 57, print1(if(n%2>0, (n^2+3)/4, (n^2+2*n)/4), ", "))}
(Magma) &cat[ [ n^2-n+1, n*(n+1) ]: n in [1..29] ];
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
Search completed in 0.013 seconds
|