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.

Showing 1-10 of 27 results. Next

A130404 Partial sums of A093178.

Original entry on oeis.org

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
Offset: 1

Views

Author

Klaus Brockhaus, May 25 2007

Keywords

Comments

Numbers n such that floor(n/2) is a positive triangular number. - Bruno Berselli, Sep 15 2014

Crossrefs

Programs

  • Magma
    &cat[ [ n^2-n+1, n*(n+1) ]: n in [1..29] ];
  • Mathematica
    Table[If[EvenQ[n], 1, n], {n, 0, 56}] // Accumulate (* Jean-François Alcover, Jun 10 2013 *)
    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 *)
  • 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), ","))}
    

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(n) = A093178(n) - A093178(n-1).
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

A133935 A007318 * A093178 as a diagonalized matrix.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 1, 3, 9, 1, 1, 4, 18, 4, 5, 1, 5, 30, 10, 25, 1, 1, 6, 45, 20, 75, 6, 7, 1, 7, 63, 35, 175, 21, 49, 1, 1, 8, 84, 56, 350, 56, 196, 8, 9, 1, 9, 108, 84, 630, 126, 588, 36, 81, 1
Offset: 0

Views

Author

Gary W. Adamson, Sep 29 2007

Keywords

Comments

Row sums = A133936: (1, 2, 6, 14, 32, 72, 160, ...).

Examples

			First few rows of the triangle:
  1;
  1, 1;
  1, 2,  3;
  1, 3,  9,  1;
  1, 4, 18,  4,   5;
  1, 5, 30, 10,  25,  1;
  1, 6, 45, 20,  75,  6,  7;
  1, 7, 63, 35, 175, 21, 49, 1;
  ...
		

Crossrefs

Formula

Binomial transform of an infinite lower triangular matrix with A093178: (1, 1, 3, 1, 5, 1, 7, ...) in the main diagonal and the rest zeros.

A133080 Interpolation operator: Triangle with an even number of zeros in each line followed by 1 or 2 ones.

Original entry on oeis.org

1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1
Offset: 1

Views

Author

Gary W. Adamson, Sep 08 2007

Keywords

Comments

A133080 * [1,2,3,...] = A114753: (1, 3, 3, 7, 5, 11, 7, 15, ...).
Inverse of A133080: subdiagonal changes to (-1, 0, -1, 0, -1, ...); main diagonal unchanged.
A133080^(-1) * [1,2,3,...] = A093178: (1, 1, 3, 1, 5, 1, 7, 1, 9, ...).
In A133081, diagonal terms are switched with subdiagonal terms.

Examples

			First few rows of the triangle are:
  1;
  1, 1;
  0, 0, 1;
  0, 0, 1, 1;
  0, 0, 0, 0, 1;
  0, 0, 0, 0, 1, 1;
  0, 0, 0, 0, 0, 0, 1;
  ...
		

Crossrefs

Cf. A000034 (row sums), A114753, A093178, A133081.

Programs

  • Maple
    A133080 := proc(n,k)
        if n = k then
            1;
        elif  k=n-1 and type(n,even) then
            1;
        else
            0 ;
        end if;
    end proc: # R. J. Mathar, Jun 20 2015
  • Mathematica
    T[n_, k_] := If[k == n, 1, If[k == n - 1, (1 + (-1)^n)/2 , 0]];
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] (* G. C. Greubel, Oct 21 2017 *)
  • PARI
    T(n, k) = if (k==n, 1, if (k == (n-1), 1 - (n % 2), 0)); \\ Michel Marcus, Feb 13 2014
    
  • PARI
    firstrows(n) = {my(res = vector(binomial(n + 1, 2)), t=0); for(i=1, n, t+=i; res[t] = 1; if(i%2==0, res[t-1]=1)) ;res} \\ David A. Corneth, Oct 21 2017

Formula

Infinite lower triangular matrix, (1,1,1,...) in the main diagonal and (1,0,1,0,1,...) in the subdiagonal.
Odd rows, (n-1) zeros followed by "1". Even rows, (n-2) zeros followed by "1, 1".
T(n,n)=1. T(n,k)=0 if 1 <= k < n-1. T(n,n-1)=1 if n even. T(n,n-1)=0 if n odd. - R. J. Mathar, Feb 14 2015

A049471 Decimal expansion of tan(1).

Original entry on oeis.org

1, 5, 5, 7, 4, 0, 7, 7, 2, 4, 6, 5, 4, 9, 0, 2, 2, 3, 0, 5, 0, 6, 9, 7, 4, 8, 0, 7, 4, 5, 8, 3, 6, 0, 1, 7, 3, 0, 8, 7, 2, 5, 0, 7, 7, 2, 3, 8, 1, 5, 2, 0, 0, 3, 8, 3, 8, 3, 9, 4, 6, 6, 0, 5, 6, 9, 8, 8, 6, 1, 3, 9, 7, 1, 5, 1, 7, 2, 7, 2, 8, 9, 5, 5, 5, 0, 9, 9, 9, 6, 5, 2, 0, 2, 2, 4, 2, 9, 8
Offset: 1

Views

Author

Albert du Toit (dutwa(AT)intekom.co.za), N. J. A. Sloane

Keywords

Comments

By the Lindemann-Weierstrass theorem, this constant is transcendental. - Charles R Greathouse IV, May 13 2019

Examples

			1.5574077246549022305...
		

Crossrefs

Cf. A093178 (continued fraction), A009001, A073449.

Programs

  • Mathematica
    RealDigits[Tan[1], 10, 100][[1]] (* Amiram Eldar, May 15 2021 *)
  • PARI
    default(realprecision, 20080); x=tan(1); for (n=1, 20000, d=floor(x); x=(x-d)*10; write("b049471.txt", n, " ", d)); \\

Formula

Equals Sum_{k>=1} (-1)^(k+1) * B(2*k) * 2^(2*k) * (2^(2*k) - 1) / (2*k)!, where B(k) is the k-th Bernoulli number. - Amiram Eldar, May 15 2021

A124625 Even numbers sandwiched between 1's.

Original entry on oeis.org

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
Offset: 0

Views

Author

N. J. A. Sloane, Jun 13 2007

Keywords

Comments

Interleaving of A000012 and A005843.
Created to simplify the definition of A129952.
a(n) = abs(A009531(n-1)).
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
Also !(n+2) mod n for n>0 where !n is a subfactorial number (A000166). - Michel Lagneau, Sep 05 2012
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.

Crossrefs

Cf. A000012 (all 1's), A005843 (even numbers), A009531, A093178, A152271.

Programs

  • Magma
    &cat[[1, 2*k]: k in [0..42]];
    
  • Maple
    A124625:=n->(n-(n-2)*(-1)^n)/2; seq(A124625(k), k=0..100); # Wesley Ivan Hurt, Oct 19 2013
  • Mathematica
    Join[{1},Riffle[2Range[0,50],1]] (* Harvey P. Dale, Nov 02 2011 *)
  • PARI
    {for(n=0, 85, print1(if(n%2>0, n-1, 1), ","))}
    
  • Python
    print([(n-1)**(n%2) for n in range(0, 86)]) # Karl V. Keller, Jr., Jul 26 2020

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).
a(n) = (n - (n - 2)*(-1)^n)/2. - Bruno Berselli, May 06 2011
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) = 2*floor(n/2) - (n-1)*((n-1) mod 2). - Wesley Ivan Hurt, Oct 19 2013
a(n) = (n-1)^((1-(-1)^n)/2). - Wesley Ivan Hurt, Mar 21 2015
a(n) = (n-1) - a(a(n-1))*a(n-1), a(0) = 0. - Eli Jaffe, Jun 07 2016
E.g.f.: (x + 1)*cosh(x) - sinh(x). - Ilya Gutkovskiy, Jun 07 2016
a(n) = (-1)^n mod n for n > 0. - Franz Vrabec, Mar 06 2020
a(n) = (n-1)^(n mod 2). - Karl V. Keller, Jr., Aug 01 2020

Extensions

More terms from Klaus Brockhaus, Jun 16 2007
Edited by N. J. A. Sloane, May 21 2008 at the suggestion of R. J. Mathar

A243366 Number T(n,k) of Dyck paths of semilength n having exactly k (possibly overlapping) occurrences of the consecutive steps UDUUDU (with U=(1,1), D=(1,-1)); triangle T(n,k), n>=0, 0<=k<=max(0,floor(n/2)-1), read by rows.

Original entry on oeis.org

1, 1, 2, 5, 13, 1, 37, 5, 112, 19, 1, 352, 70, 7, 1136, 259, 34, 1, 3742, 962, 149, 9, 12529, 3585, 627, 54, 1, 42513, 13399, 2584, 279, 11, 145868, 50201, 10529, 1334, 79, 1, 505234, 188481, 42606, 6092, 474, 13, 1764157, 709001, 171563, 27048, 2561, 109, 1
Offset: 0

Views

Author

Alois P. Heinz, Jun 03 2014

Keywords

Comments

Conjecture: Generally, column k is asymptotic to c(k) * d^n * n^(k-3/2), where d = 3.8821590268628506747194368909643384... is the root of the equation d^8 - 2*d^7 - 10*d^6 + 12*d^5 - 5*d^4 - 2*d^3 - 5*d^2 - 8*d - 3 = 0, and c(k) are specific constants (independent on n). - Vaclav Kotesovec, Jun 05 2014

Examples

			T(4,1) = 1: UDUUDUDD.
T(5,1) = 5: UDUDUUDUDD, UDUUDUDDUD, UDUUDUDUDD, UDUUDUUDDD, UUDUUDUDDD.
T(6,1) = 19: UDUDUDUUDUDD, UDUDUUDUDDUD, UDUDUUDUDUDD, UDUDUUDUUDDD, UDUUDUDDUDUD, UDUUDUDDUUDD, UDUUDUDUDDUD, UDUUDUDUDUDD, UDUUDUDUUDDD, UDUUDUUDDDUD, UDUUDUUDDUDD, UDUUDUUUDDDD, UUDDUDUUDUDD, UUDUDUUDUDDD, UUDUUDUDDDUD, UUDUUDUDDUDD, UUDUUDUDUDDD, UUDUUDUUDDDD, UUUDUUDUDDDD.
T(6,2) = 1: UDUUDUUDUDDD.
T(7,2) = 7: UDUDUUDUUDUDDD, UDUUDUDUUDUDDD, UDUUDUUDUDDDUD, UDUUDUUDUDDUDD, UDUUDUUDUDUDDD, UDUUDUUDUUDDDD, UUDUUDUUDUDDDD.
T(8,3) = 1: UDUUDUUDUUDUDDDD.
Triangle T(n,k) begins:
:  0 :     1;
:  1 :     1;
:  2 :     2;
:  3 :     5;
:  4 :    13,    1;
:  5 :    37,    5;
:  6 :   112,   19,   1;
:  7 :   352,   70,   7;
:  8 :  1136,  259,  34,  1;
:  9 :  3742,  962, 149,  9;
: 10 : 12529, 3585, 627, 54, 1;
		

Crossrefs

Row sums give A000108.
T(n,floor(n/2)-1) gives A093178(n) for n>3.
T(45,k) = A243752(45,k).
T(n,0) = A243753(n,45).

Programs

  • Maple
    b:= proc(x, y, t) option remember; `if`(y<0 or y>x, 0,
         `if`(x=0, 1, expand(b(x-1, y+1, [2, 2, 4, 5, 2, 4][t])*
         `if`(t=6, z, 1) +b(x-1, y-1, [1, 3, 1, 3, 6, 1][t]))))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(2*n, 0, 1)):
    seq(T(n), n=0..20);
  • Mathematica
    b[x_, y_, t_] := b[x, y, t] = If[y<0 || y>x, 0, If[x == 0, 1, Expand[b[x-1, y+1, {2, 2, 4, 5, 2, 4}[[t]]]*If[t == 6, z, 1] + b[x-1, y-1, {1, 3, 1, 3, 6, 1}[[t]]]]]]; T[n_] := Function[{p}, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][b[2*n, 0, 1]]; Table[T[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Feb 05 2015, after Alois P. Heinz *)

A241269 Denominator of c(n) = (n^2+n+2)/((n+1)*(n+2)*(n+3)).

Original entry on oeis.org

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
Offset: 0

Views

Author

Paul Curtz, Apr 18 2014

Keywords

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).
c(n) is a companion to A026741(n)/A045896(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?
No: a(5) = 21 but a(45) = 12972. # Robert Israel, Jul 17 2023
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.
Second row: A026741/A045896.
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, ... .

Programs

  • 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 *)
  • PARI
    for(n=0, 100, print1(denominator((n^2+n+2)/((n+1)*(n+2)*(n+3))), ", ")) \\ Colin Barker, Apr 18 2014

Formula

c(n) = A014206(n)/A007531(n+3).
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

Extensions

More terms from Colin Barker, Apr 18 2014

A009001 Expansion of e.g.f: (1+x)*cos(x).

Original entry on oeis.org

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
Offset: 0

Views

Author

Keywords

Comments

If signs are ignored, continued fraction for tan(1) (cf. A093178).

Examples

			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 + ...
		

Crossrefs

Cf. A009531, A049471 (decimal expansion of tan(1)).

Programs

  • Magma
    m:=50; R:=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
  • 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 *)
    LinearRecurrence[{0, -2, 0, -1}, {1, 1, -1, -3}, 100] (* Jean-François Alcover, Feb 21 2020 *)
    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 *)
  • PARI
    {a(n) = (-1)^(n\2) * if( n%2, n, 1)} /* Michael Somos, Oct 16 2006 */
    

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
From Henry Bottomley, Oct 19 2001: (Start)
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.
E.g.f.: (1+x)*cos(x) = U(0) where U(k) = 1 + x - x^2/((2*k+1)*(2*k+2)) * U(k+1). - Sergei N. Gladkovskii, Oct 17 2012 [Edited by Michael Somos, Jan 26 2014]
From James C. McMahon, Oct 12 2023: (Start)
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)

Extensions

Formula corrected by Olivier Gérard, Mar 15 1997
Definition clarified by Harvey P. Dale, Jul 15 2012

A019426 Continued fraction for tan(1/3).

Original entry on oeis.org

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
Offset: 0

Views

Author

Keywords

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

Examples

			0.346253549510575491038543565... = 0 + 1/(2 + 1/(1 + 1/(7 + 1/(1 + ...)))). - _Harry J. Smith_, Jun 13 2009
		

Crossrefs

Cf. A161012 (decimal expansion of tan(1/3)).
Cf. continued fractions for tan(1/m): A019425 (m=2), A019427 (m=4), A019428 (m=5), A019429 (m=6), A019430 (m=7), A019431 (m=8), A019432 (m=9), A019433 (m=10), A093178 (m=1).

Programs

  • 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
  • Mathematica
    ContinuedFraction[Tan[1/3], 80] (* Bruno Berselli, Sep 21 2012 *)
  • 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
    

Formula

From Bruno Berselli, Sep 21 2012: (Start)
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)

A224344 Number T(n,k) of compositions of n using exactly k primes (counted with multiplicity); triangle T(n,k), n>=0, 0<=k<=floor(n/2), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 2, 5, 1, 3, 8, 5, 5, 13, 13, 1, 7, 23, 27, 7, 11, 39, 52, 25, 1, 17, 65, 99, 66, 9, 27, 106, 186, 151, 41, 1, 40, 177, 340, 323, 133, 11, 61, 293, 608, 666, 358, 61, 1, 92, 482, 1076, 1330, 867, 236, 13, 142, 781, 1894, 2581, 1971, 737, 85, 1
Offset: 0

Views

Author

Alois P. Heinz, May 23 2013

Keywords

Examples

			A(5,1) = 8: [2,1,1,1], [1,2,1,1], [1,1,2,1], [1,1,1,2], [3,1,1], [1,3,1], [1,1,3], [5].
Triangle T(n,k) begins:
   1;
   1;
   1,   1;
   1,   3;
   2,   5,   1;
   3,   8,   5;
   5,  13,  13,   1;
   7,  23,  27,   7;
  11,  39,  52,  25,   1;
  17,  65,  99,  66,   9;
  27, 106, 186, 151,  41,  1;
  40, 177, 340, 323, 133, 11;
  ...
		

Crossrefs

Column k=0 gives: A052284.
Row sums are: A011782.
Row lengths are: A008619.
T(floor(n/2)) = A093178(n).
T(2n,n-1) = A001844(n-1) for n>0.

Programs

  • Maple
    T:= proc(n) option remember; local j; if n=0 then 1
          else []; for j to n do zip((x, y)->x+y, %,
          [`if`(isprime(j), 0, NULL), T(n-j)], 0) od; %[] fi
        end:
    seq(T(n), n=0..16);
  • Mathematica
    zip[f_, x_List, y_List, z_] :=  With[{m = Max[Length[x], Length[y]]},  Thread[f[PadRight[x, m, z], PadRight[y, m, z]]]]; T[n_] := T[n] =  Module[{j, pc}, If[n == 0, {1}, pc = {}; For[j = 1, j <= n, j++, pc = zip[Plus, pc, Join[If[PrimeQ[j], {0}, {}], T[n-j]], 0]]; pc]]; Table[T[n], {n, 0, 16}] // Flatten (* Jean-François Alcover, Jan 29 2014, after Alois P. Heinz *)

Formula

Sum_{k=1..floor(n/2)} k * T(n,k) = A102291(n).
Showing 1-10 of 27 results. Next