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.

Previous Showing 31-40 of 56 results. Next

A040031 Continued fraction for sqrt(38).

Original entry on oeis.org

6, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6
Offset: 0

Views

Author

Keywords

Examples

			6.1644140029689764502501923... = 6 + 1/(6 + 1/(12 + 1/(6 + 1/(12 + ...)))). - _Harry J. Smith_, Jun 04 2009
		

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 276.

Crossrefs

Cf. A010492 (decimal expansion), A040001.

Programs

  • Maple
    Digits := 100: convert(evalf(sqrt(N)),confrac,90,'cvgts'):
  • Mathematica
    ContinuedFraction[Sqrt[38],300] (* Vladimir Joseph Stephan Orlovsky, Mar 06 2011 *)
  • PARI
    { allocatemem(932245000); default(realprecision, 38000); x=contfrac(sqrt(38)); for (n=0, 20000, write("b040031.txt", n, " ", x[n+1])); } \\ Harry J. Smith, Jun 04 2009

Formula

From Stefano Spezia, Jul 27 2025: (Start)
a(n) = 6*A040001(n).
G.f.: 6*(1 + x + x^2)/(1 - x^2). (End)

A300953 Number T(n,k) of Dyck paths of semilength n such that 2*k is the difference between the area above the path and the area below the path, measured within the smallest enclosing rectangle based on the x-axis; triangle T(n,k), n>=0, -floor((n-1)^2/4) <= k <= floor((n-1)^2/4), read by rows.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 0, 7, 0, 5, 1, 2, 3, 6, 7, 8, 6, 6, 3, 2, 0, 9, 0, 20, 0, 35, 0, 34, 0, 25, 0, 7, 1, 2, 4, 8, 10, 17, 23, 30, 38, 43, 46, 48, 42, 41, 26, 26, 12, 8, 4, 2, 0, 11, 0, 29, 0, 63, 0, 115, 0, 176, 0, 238, 0, 255, 0, 230, 0, 169, 0, 92, 0, 41, 0, 9
Offset: 0

Views

Author

Alois P. Heinz, Mar 16 2018

Keywords

Examples

			              .______.
              | /\/\ |  ,  rectangle area: 12, above path area: 5,
T(3,-1) = 1:  |/____\|  ,  below path area: 7, difference: (5-7) = 2 * (-1).
.
                 /\
                /  \
T(3,0) = 2:    /    \   /\/\/\  .
.
                /\         /\
T(3,1) = 2:    /  \/\   /\/  \  .
.
Triangle T(n,k) begins:
:                                   1                                    ;
:                                   1                                    ;
:                                   2                                    ;
:                               1,  2,  2                                ;
:                           2,  0,  7,  0,  5                            ;
:                   1,  2,  3,  6,  7,  8,  6,  6,  3                    ;
:           2,  0,  9,  0, 20,  0, 35,  0, 34,  0, 25,  0,  7            ;
:  1, 2, 4, 8, 10, 17, 23, 30, 38, 43, 46, 48, 42, 41, 26, 26, 12, 8, 4  ;
		

Crossrefs

Row sums give A000108.
Column k=0 gives A300952.

Formula

Sum_{k = -floor((n-1)^2/4)..floor((n-1)^2/4)} k * T(n,k) = A300996(n).
T(n,-floor((n-1)^2/4)) = A040001(n).
T(n, floor((n-1)^2/4)) = A026741(n+1) for n > 2.
T(n,k) = 0 iff n is even and k is odd or abs(k) > floor(n*(n-1)/6).

A327767 Period 2: repeat [1, -2].

Original entry on oeis.org

1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2
Offset: 1

Views

Author

Michael Somos, Sep 24 2019

Keywords

Examples

			G.f. = x - 2*x^2 + x^3 - 2*x^4 + x^5 - 2*x^6 + x^7 - 2*x^8 + ...
		

Crossrefs

Programs

  • Magma
    &cat [[1, -2]^^50]; // Vincenzo Librandi, Feb 29 2020
  • Mathematica
    a[ n_] := If[ n < 1, 0, -2 + 3 Mod[n, 2]];
    a[ n_] := Which[ n < 1, 0, OddQ[n], 1, True, -2];
    a[ n_] := SeriesCoefficient[ (x - 2*x^2) / (1 - x^2), {x, 0, n}];
    PadRight[{}, 100, {1, -2}] (* Vincenzo Librandi, Feb 29 2020 *)
  • PARI
    {a(n) = if( n<1, 0, -(1 + 3*(-1)^n)/2)};
    
  • PARI
    {a(n) = if( n<1, 0, -2 + 3*(n%2))};
    
  • PARI
    {a(n) = if( n<1, 0, [-2, 1][n%2 + 1])};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (x - 2*x^2) / (1 - x^2) + x * O(x^n), n))};
    

Formula

G.f.: x * (1 - 2*x) / (1 - x^2) = x / (1 + 2*x / (1 - 3*x / (2 - x))).
E.g.f.: (exp(x) - 1)*(3/exp(x) - 1)/2.
a(n) is multiplicative with a(2^e) = -2 if e>0, a(p^e) = 1 otherwise.
Moebius transform is length 2 sequence [1, -3].
a(n) = -(1 + 3*(-1)^n)/2 if n>=1.
a(2*n) = -2, a(2*n + 1) = 1, a(0) = 0.
a(n) = -(-1)^n * A134451(n) for all n in Z.
a(n) = a(n+2) = -(-1)^n * A000034(n-1) = -A168361(n+1) for n>=1.
Dirichlet g.f.: zeta(s)*(1-3/2^s). - Amiram Eldar, Jan 03 2023

A067881 Factorial expansion of sqrt(3) = Sum_{n>=1} a(n)/n!.

Original entry on oeis.org

1, 1, 1, 1, 2, 5, 0, 4, 2, 5, 10, 8, 1, 5, 6, 8, 5, 13, 18, 0, 7, 20, 9, 6, 14, 2, 7, 7, 18, 11, 0, 12, 20, 10, 31, 28, 27, 34, 29, 18, 13, 8, 28, 14, 9, 12, 39, 5, 15, 8, 5, 0, 7, 21, 54, 13, 16, 20, 24, 18, 12, 14, 6, 53, 21, 42, 47, 14, 46, 14, 42, 71, 41, 63, 24, 28, 32, 61, 35
Offset: 1

Views

Author

Benoit Cloitre, Mar 10 2002

Keywords

Examples

			sqrt(3) = 1 + 1/2! + 1/3! + 1/4! + 2/5! + 5/6! + 0/7! + 4/8! + 2/9! + ...
		

Crossrefs

Cf. A002194 (decimal expansion), A040001 (continued fraction).
Cf. A009949 (sqrt(2)), A068446 (sqrt(5)), A320839 (sqrt(7)).

Programs

  • Magma
    SetDefaultRealField(RealField(250));  [Floor(Sqrt(3))] cat [Floor(Factorial(n)*Sqrt(3)) - n*Floor(Factorial((n-1))*Sqrt(3)) : n in [2..80]]; // G. C. Greubel, Dec 10 2018
    
  • Maple
    Digits:=200: a:=n->`if`(n=1,floor(sqrt(3)),floor(factorial(n)*sqrt(3))-n*floor(factorial(n-1)*sqrt(3))): seq(a(n),n=1..90); # Muniru A Asiru, Dec 11 2018
  • Mathematica
    With[{b = Sqrt[3]}, Table[If[n == 1, Floor[b], Floor[n!*b] - n*Floor[(n - 1)!*b]], {n, 1, 100}]] (* G. C. Greubel, Dec 10 2018 *)
  • PARI
    default(realprecision, 250); {b = sqrt(3); a(n) = if(n==1, floor(b), floor(n!*b) - n*floor((n-1)!*b))};
    for(n=1, 80, print1(a(n), ", ")) \\ G. C. Greubel, Dec 10 2018
    
  • PARI
    apply( A067881(n)=if(n>1,sqrt(precision(3., n*log(n/2.5)\2.3+2))*(n-1)!%1*n\1,1), [1..79]) \\ M. F. Hasler, Dec 14 2018
    
  • Sage
    b=sqrt(3);
    def a(n):
        if (n==1): return floor(b)
        else: return expand(floor(factorial(n)*b) - n*floor(factorial(n-1)*b))
    [a(n) for n in (1..80)] # G. C. Greubel, Dec 10 2018

Formula

a(1) = 1; for n > 1, a(n) = floor(n!*sqrt(3)) - n*floor((n-1)!*sqrt(3)).

A082953 a(n) = A000252(n) / A070732(n).

Original entry on oeis.org

1, 2, 4, 8, 16, 8, 36, 32, 36, 32, 100, 32, 144, 72, 64, 128, 256, 72, 324, 128, 144, 200, 484, 128, 400, 288, 324, 288, 784, 128, 900, 512, 400, 512, 576, 288, 1296, 648, 576, 512, 1600, 288, 1764, 800, 576, 968, 2116
Offset: 1

Views

Author

Yuval Dekel (dekelyuval(AT)hotmail.com), May 26 2003

Keywords

Comments

From Jianing Song, Apr 20 2019: (Start)
a(n) is the number of split complex numbers z = x + yj in a reduced system modulo n where x, y are integers, j^2 = 1; number of solutions to gcd(x^2 - y^2, n)=1 with x, y in [0, n-1].
a(n) is the number of invertible elements in the ring Z_n[x]/(x^2 - 1) with discriminant d = 4, where Z_n is the ring of integers modulo n. (End)

Crossrefs

Similar sequences: A127473 (size of (Z_n[x]/(x^2 - x))*, d = 1), A002618 ((Z_n[x]/(x^2))*, d = 0), A079458 ((Z_n[x]/(x^2 + 1))*, d = -4), A319445 ((Z_n[x]/(x^2 - x + 1))* or (Z_n[x]/(x^2 + x + 1))*, d = -3).

Programs

  • Maple
    A082953 := proc(n) numtheory[phi](n)*numtheory[phi](2*n) ; end proc:
    seq(A082953(n),n=1..100) ; # R. J. Mathar, Jan 07 2011
  • Mathematica
    Array[Times @@ Map[EulerPhi, {#, 2 #}] &, 47] (* Michael De Vlieger, Apr 21 2019 *)
  • PARI
    a(n) = eulerphi(n)*eulerphi(2*n); \\ Michel Marcus, Jun 04 2025

Formula

a(n) = phi(n)*phi(2*n) = A000010(n)*A062570(n). - Vladeta Jovovic, May 02 2005
Multiplicative with a(2^e) = 2^(2e-1) and a(p^e) = (p-1)^2*p^(2e-2) for p > 2. - R. J. Mathar, Apr 14 2011
a(n) = phi(n)^2 if n odd; 2*phi(n)^2 if n even, where phi(n) = A000010(n). - Jianing Song, Apr 20 2019
Sum_{k=1..n} a(k) ~ c * n^3, where c = (2/5) * Product_{p prime} (1 - (2*p-1)/p^3) = (2/5) * A065464 = 0.171299... . - Amiram Eldar, Oct 30 2022
a(n) = gcd(n,2)*phi(n)^2 = A040001(n)*A127473(n). - Ridouane Oudra, Jun 04 2025

A133081 An interpolation operator, companion to A133080.

Original entry on oeis.org

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

Views

Author

Gary W. Adamson, Sep 09 2007

Keywords

Comments

A133081 * [1,2,3,...] = A133090: (1, 1, 5, 3, 9, 5, 13, 7, 17, ...).
A133080: diagonal and subdiagonal are switched.

Examples

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

Crossrefs

Cf. A133080, A133090, A040001 (row sums).

Programs

  • PARI
    row(n) = vector(n, k, if (k==n-1, 1, if (k==n, n%2)));
    lista(nn) = my(list=List()); for (n=1, nn, my(v=row(n)); for (k=1, #v, listput(list, v[k]))); Vec(list); \\ Michel Marcus, Mar 06 2022

Formula

Infinite lower triangular matrix, (1,0,1,0,...) in the main diagonal and (1,1,1,...) in the subdiagonal.

Extensions

More terms from Michel Marcus, Mar 06 2022

A181655 Expansion of (1+2x-x^3+x^4)/(1-4x^2+3x^4).

Original entry on oeis.org

1, 2, 4, 7, 14, 22, 44, 67, 134, 202, 404, 607, 1214, 1822, 3644, 5467, 10934, 16402, 32804, 49207, 98414, 147622, 295244, 442867, 885734, 1328602, 2657204, 3985807, 7971614, 11957422, 23914844, 35872267, 71744534, 107616802, 215233604
Offset: 0

Views

Author

Paul Barry, Nov 03 2010

Keywords

Comments

Row sums of A181654.

Crossrefs

Cf. A060816, A198643 (bisections).

Programs

  • Mathematica
    CoefficientList[Series[(1+2x-x^3+x^4)/(1-4x^2+3x^4),{x,0,40}],x] (* or *) Join[{1},LinearRecurrence[{0,4,0,-3},{2,4,7,14},40]] (* Harvey P. Dale, Jan 11 2012 *)
  • PARI
    A181655(n)=if(bitand(n,1), 3^(n\2)*5\2, n, 3^(n\2-1)*5-1, 1) \\ M. F. Hasler, Apr 06 2019

Formula

G.f.: (1+2*x-x^3+x^4)/((1-x^2)*(1-3*x^2)).
a(n) = 5*A038754(n+1)/6 - A040001(n)/2. - R. J. Mathar, May 14 2016
a(2n-1) = A060816(n-1), a(2n) = A198643(n-1); n >= 1. a(n+1) = 2*a(n) if n is odd. - M. F. Hasler, Apr 06 2019

A184324 The number of disconnected k-regular simple graphs on 2k+4 vertices.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 5, 5, 7, 9, 11, 13, 18, 21, 26, 33, 40, 49, 61, 73, 89, 110, 131, 158, 192, 230, 274, 331, 392, 468, 557, 660, 780, 927, 1088, 1284, 1511, 1775, 2076, 2438, 2843, 3323, 3873, 4510, 5238, 6095, 7057, 8182, 9466, 10945, 12626, 14578, 16780, 19323, 22211
Offset: 0

Views

Author

Jason Kimberley, Jan 11 2011

Keywords

Examples

			The a(0)=1 graph is 4K_1. The a(1)=1 graph is 3K_2. The a(2)=2 graphs are C_3+C_5 and C_4+C_4.
		

Crossrefs

This sequence is the third highest diagonal of D=A068933: that is a(n)=D(2k+4, k).
Cf. A184325(k) = D(4k+5, 2k) and A184326(k) = D(2k+6, k).

Programs

  • Magma
    A184324 := func< n | n eq 0 select 1 else (n+1)mod 2 + A008483(n+3) >; // see A008483 for its MAGMA code.

Formula

a(0)=1. For k>0, a(k) = (k+1) mod 2 + A008483(k+3).
For k>=0, a(k) = A040001(k) + A165652(k+3).
Proof: Let C=A068934, D=A068933, and E=A051031. Now a(n) = D(2k+4, k) = C(k+1, k) C(k+3, k) + A000217(C(k+2,k)), from the disconnected Euler transform. C(k+1, k)=1 because K_{k+1} is connected and the unique k-regular graph on k+1 vertices. For k > 1, since D(k+3,k)=0, then C(k+3,k) = E(k+3,k) = E(k+3,2) = A008483(k + 3). Also, for k >0, since D(k+2,k)=0, then C(k+2,k) = E(k+2,k) = E(k+2,1) = (k+1) mod 2. With the examples below and A165652(n)=0 for n < 6 = offset, QED.

A226555 Numerators of row sums of the triangular enumeration of rational numbers A226314(n,k) / A054531(n,k), 1 <= k <= n.

Original entry on oeis.org

1, 5, 4, 13, 7, 25, 10, 33, 17, 45, 16, 69, 19, 65, 38, 81, 25, 109, 28, 125, 55, 105, 34, 177, 53, 125, 68, 181, 43, 241, 46, 193, 89, 165, 100, 301, 55, 185, 106, 321, 61, 349, 64, 293, 167, 225, 70, 433, 109, 341, 140, 349, 79, 433, 162, 465, 157, 285, 88
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 10 2013

Keywords

Examples

			.   n         A226314(n,k) / A054531(n,k), 1<=k<=n<=12           row sums
.  --   -------------------------------------------------------- --------
.   1:  1                                                           1
.   2:  1/2 2                                                       5/2
.   3:  1/3 2/3 3                                                   4
.   4:  1/4 3/2 3/4 4                                              13/2
.   5:  1/5 2/5 3/5 4/5 5                                           7
.   6:  1/6 4/3 5/2 5/3 5/6 6                                      25/2
.   7:  1/7 2/7 3/7 4/7 5/7 6/7 7                                  10
.   8:  1/8 5/4 3/8 7/2 5/8 7/4 7/8 8                              33/2
.   9:  1/9 2/9 7/3 4/9 5/9 8/3 7/9 8/9 9                          17
.  10:  1/10 6/5 3/10 7/5 9/2 8/5 7/10 9/5 9/10 10                 45/2
.  11:  1/11 2/11 3/11 4/11 5/11 6/11 7/11 8/11 9/11 10/11 11      16
.  12:  1/12 7/6 9/4 10/3 5/12 11/2 7/12 11/3 11/4 11/6 11/12 12   69/2 .
		

Crossrefs

Cf. A040001 (denominators).

Programs

  • Haskell
    import Data.Ratio ((%), numerator); import Data.Function (on)
    a226555 n = numerator $ sum $
                zipWith ((%) `on` toInteger) (a226314_row n) (a054531_row n)

A257088 a(2*n) = 4*n if n>0, a(2*n + 1) = 2*n + 1, a(0) = 1.

Original entry on oeis.org

1, 1, 4, 3, 8, 5, 12, 7, 16, 9, 20, 11, 24, 13, 28, 15, 32, 17, 36, 19, 40, 21, 44, 23, 48, 25, 52, 27, 56, 29, 60, 31, 64, 33, 68, 35, 72, 37, 76, 39, 80, 41, 84, 43, 88, 45, 92, 47, 96, 49, 100, 51, 104, 53, 108, 55, 112, 57, 116, 59, 120, 61, 124, 63, 128
Offset: 0

Views

Author

Michael Somos, Apr 16 2015

Keywords

Examples

			G.f. = 1 + x + 4*x^2 + 3*x^3 + 8*x^4 + 5*x^5 + 12*x^6 + 7*x^7 + 16*x^8 + ...
		

Crossrefs

CF. A257083 (partial sums), A246695.

Programs

  • Haskell
    import Data.List (transpose)
    a257088 n = a257088_list !! n
    a257088_list = concat $ transpose [a008574_list, a005408_list]
    -- Reinhard Zumkeller, Apr 17 2015
  • Mathematica
    a[ n_] := Which[ n < 1, Boole[n == 0], OddQ[n], n, True, 2 n];
    a[ n_] := SeriesCoefficient[ (1 + x + 2*x^2 + x^3 + x^4) / (1 - 2*x^2 + x^4), {x, 0, n}];
  • PARI
    {a(n) = if( n<1, n==0, n%2, n, 2*n)};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (1 + x + 2*x^2 + x^3 + x^4) / (1 - 2*x^2 + x^4) + x * O(x^n), n))};
    

Formula

Euler transform of length 4 sequence [ 1, 3, -1, -1].
a(n) is multiplicative with a(2^e) = 2^(e+1) if e>0, otherwise a(p^e) = p^e.
G.f.: (1 + x + 2*x^2 + x^3 + x^4) / (1 - 2*x^2 + x^4).
G.f.: (1 - x^3) * (1 - x^4) / ((1 - x) * (1 - x^2)^3).
MOBIUS transform of A215947 is [1, 4, 3, 8, 5, ...].
a(n) = n * A040001(n) if n>0.
a(n) + a(n-1) = A007310(n) if n>0.
a(n) = A001082(n+1) - A001082(n) if n>0.
Binomial transform with a(0)=0 is A128543 if n>0.
a(2*n) = A008574(n). a(2*n + 1) = A005408(n).
a(n) = A022998(n) if n>0. - R. J. Mathar, Apr 19 2015
From Amiram Eldar, Jan 28 2025: (Start)
Dirichlet g.f.: (1+2^(1-s)) * zeta(s-1).
Sum_{k=1..n} a(k) ~ (3/4) * n^2. (End)
a(n) = gcd(n^n, 2*n). - Mia Boudreau, Jun 27 2025
Previous Showing 31-40 of 56 results. Next