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 11-20 of 29 results. Next

A054040 a(n) terms of series {1/sqrt(j)} are >= n.

Original entry on oeis.org

1, 3, 5, 7, 10, 14, 18, 22, 27, 33, 39, 45, 52, 60, 68, 76, 85, 95, 105, 115, 126, 138, 150, 162, 175, 189, 202, 217, 232, 247, 263, 280, 297, 314, 332, 351, 370, 389, 409, 430, 451, 472, 494, 517, 540, 563, 587, 612, 637, 662, 688, 715, 741, 769, 797, 825
Offset: 1

Views

Author

Asher Auel, Apr 13 2000

Keywords

Comments

In many cases the first differences have the form {2k, 2k, 2k, 2k+1} (A004524). In such cases the second differences are {0, 0, 1, 1}. See A082915 for the exceptions. In as many as these, the first differences have the form {2k-1, 2k-1, 2k-1, 2k}. - Robert G. Wilson v, Apr 18 2003 [Corrected by Carmine Suriano, Nov 08 2013]
a(100)=2574, a(1000)=250731 & a(10000)=25007302 which differs from Sum{i=4..104}A004524(i)=2625, Sum{i=4..1004}A004524(i)=251250 & Sum{i=4..10004}A004524(i)=25012500. - Robert G. Wilson v, Apr 18 2003
A054040(n) <= A011848(n+2), A054040(10000)=25007302 and A011848(n+2)=25007500. - Robert G. Wilson v, Apr 18 2003

Examples

			Let b(k) = 1 + 1/sqrt(2) + 1/sqrt(3) + ... + 1/sqrt(k):
.k.......1....2.....3.....4.....5.....6.....7
-------------------------------------------------
b(k)...1.00..1.71..2.28..2.78..3.23..3.64..4.01
For A019529 we have:
n=0: smallest k is a(0) = 1 since 1.00 > 0
n=1: smallest k is a(1) = 2 since 1.71 > 1
n=2: smallest k is a(2) = 3 since 2.28 > 2
n=3: smallest k is a(3) = 5 since 3.23 > 3
n=4: smallest k is a(4) = 7 since 4.01 > 4
For this sequence we have:
n=1: smallest k is a(1) = 1 since 1.00 >= 1
n=2: smallest k is a(2) = 3 since 2.28 >= 2
n=3: smallest k is a(3) = 5 since 3.23 >= 3
n=4: smallest k is a(4) = 7 since 4.01 >= 4
		

Crossrefs

See A019529 for a different version.

Programs

  • Mathematica
    f[n_] := Block[{k = 0, s = 0}, While[s < n, k++; s = N[s + 1/Sqrt[k], 50]]; k]; Table[f[n], {n, 1, 60}]
  • PARI
    a(n)=if(n<0,0,t=1;z=1;while(zBenoit Cloitre, Sep 23 2012

Formula

Let f(n) = (1/4)*(n^2-2*zeta(1/2)*n) then we have a(n) = f(n) + O(1). More precisely we claim that for n >= 2 we have a(n) = floor(f(n)+c) where c > Max{a(n)-f(n) : n>=1} = a(153) - f(153) = 1.032880076066608813953... and we believe we can take c = 1.033. - Benoit Cloitre, Sep 23 2012

Extensions

Definition and offset modified by N. J. A. Sloane, Sep 01 2009

A281026 a(n) = floor(3*n*(n+1)/4).

Original entry on oeis.org

0, 1, 4, 9, 15, 22, 31, 42, 54, 67, 82, 99, 117, 136, 157, 180, 204, 229, 256, 285, 315, 346, 379, 414, 450, 487, 526, 567, 609, 652, 697, 744, 792, 841, 892, 945, 999, 1054, 1111, 1170, 1230, 1291, 1354, 1419, 1485, 1552, 1621, 1692, 1764, 1837, 1912, 1989, 2067, 2146
Offset: 0

Views

Author

Bruno Berselli, Jan 13 2017

Keywords

Crossrefs

Subsequence of A214068.
Partial sums of A047273.
Cf. A011865, A045943, A274757 (subsequence).
Cf. sequences with formula floor(k*n*(n+1)/4): A011848 (k=1), A000217 (k=2), this sequence (k=3), A002378 (k=4).
Cf. sequences with formula floor(k*n*(n+1)/(k+1)): A000217 (k=1), A143978 (k=2), this sequence (k=3), A281151 (k=4), A194275 (k=5).

Programs

  • Magma
    [3*n*(n+1) div 4: n in [0..60]];
  • Maple
    A281026:=n->floor(3*n*(n+1)/4): seq(A281026(n), n=0..100); # Wesley Ivan Hurt, Jan 13 2017
  • Mathematica
    Table[Floor[3 n (n + 1)/4], {n, 0, 60}]
    LinearRecurrence[{3,-4,4,-3,1},{0,1,4,9,15},60] (* Harvey P. Dale, Jun 04 2023 *)
  • Maxima
    makelist(floor(3*n*(n+1)/4), n, 0, 60);
    
  • PARI
    vector(60, n, n--; floor(3*n*(n+1)/4))
    
  • Python
    [int(3*n*(n+1)/4) for n in range(60)]
    
  • Sage
    [floor(3*n*(n+1)/4) for n in range(60)]
    

Formula

O.g.f.: x*(1 + x + x^2)/((1 + x^2)*(1 - x)^3).
E.g.f.: -(1 - 6*x - 3*x^2)*exp(x)/4 - (1 + i)*(i - exp(2*i*x))*exp(-i*x)/8, where i=sqrt(-1).
a(n) = a(-n-1) = 3*a(n-1) - 4*a(n-2) + 4*a(n-3) - 3*a(n-4) + a(n-5) = a(n-4) + 6*n - 9.
a(n) = 3*n*(n+1)/4 + (i^(n*(n+1)) - 1)/4. Therefore:
a(4*k+r) = 12*k^2 + 3*(2*r+1)*k + r^2, where 0 <= r <= 3.
a(n) = n^2 - floor((n-1)*(n-2)/4).
a(n) = A011865(3*n+2).

A288852 Number T(n,k) of matchings of size k in the n X n X n triangular grid; triangle T(n,k), n>=0, 0<=k<=floor(n*(n+1)/4), read by rows.

Original entry on oeis.org

1, 1, 1, 3, 1, 9, 15, 2, 1, 18, 99, 193, 108, 6, 1, 30, 333, 1734, 4416, 5193, 2331, 240, 1, 45, 825, 8027, 45261, 151707, 298357, 327237, 180234, 40464, 2238, 1, 63, 1710, 26335, 255123, 1629474, 6995539, 20211423, 38743020, 47768064, 35913207, 15071019
Offset: 0

Views

Author

Alois P. Heinz, Jun 18 2017

Keywords

Comments

The n X n X n triangular grid has n rows with i vertices in row i. Each vertex is connected to the neighbors in the same row and up to two vertices in each of the neighboring rows. The graph has A000217(n) vertices and 3*A000217(n-1) edges altogether.

Examples

			Triangle T(n,k) begins:
  1;
  1;
  1,  3;
  1,  9,  15,    2;
  1, 18,  99,  193,   108,      6;
  1, 30, 333, 1734,  4416,   5193,   2331,    240;
  1, 45, 825, 8027, 45261, 151707, 298357, 327237, 180234, 40464, 2238;
		

Crossrefs

Columns k=0-1 give: A000012, A045943(n-1) for n>0.
Row sums give A269869.
Last elements of rows give A271610.

Programs

  • Maple
    b:= proc(l) option remember;  local n, k; n:= nops(l);
          if n=0 then 1
        elif min(l)>0 then b(subsop(-1=NULL, map(h-> h-1, l)))
        else for k to n while l[k]>0 do od; b(subsop(k=1, l))+
             expand(x*(`if`(k1 and l[k-1]=1, b(subsop(k=1, k-1=2, l)), 0)))
          fi
        end:
    T:= n-> (p-> seq(coeff(p,x,i), i=0..degree(p)))(b([0$n])):
    seq(T(n), n=0..10);
  • Mathematica
    b[l_] := b[l] = Module[{n = Length[l], k}, Which[n == 0, 1, Min[l] > 0, b[ReplacePart[l - 1, -1 -> Nothing]], True, For[k = 1, k <= n && l[[k]] > 0, k++]; b[ReplacePart[l, k -> 1]] + x*Expand[If[k < n, b[ReplacePart[l, k -> 2]], 0] + If[k < n && l[[k + 1]] == 0, b[ReplacePart[l, {k -> 1, k + 1 -> 1}]], 0] + If[k > 1 && l[[k - 1]] == 1, b[ReplacePart[l, {k -> 1, k - 1 -> 2}]], 0]]]];
    T[n_] := Table[Coefficient[#, x, i], {i, 0, Exponent[#, x]}]&[b[Table[0, n] ]];
    Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, May 24 2018, translated from Maple *)

Formula

T(n,floor(n*(n+1)/4)) = A271610(n).
Sum_{i=0..1} T(n,floor(n*(n+1)/4)-i) = A271612(n).
Sum_{i=0..2} T(n,floor(n*(n+1)/4)-i) = A271614(n).
Sum_{i=0..3} T(n,floor(n*(n+1)/4)-i) = A271616(n).

A166454 Triangle read by rows: T(n, k) = (1/2)*(A007318(n,k) - A047999(n,k)).

Original entry on oeis.org

1, 1, 1, 2, 3, 2, 2, 5, 5, 2, 3, 7, 10, 7, 3, 3, 10, 17, 17, 10, 3, 4, 14, 28, 35, 28, 14, 4, 4, 18, 42, 63, 63, 42, 18, 4, 5, 22, 60, 105, 126, 105, 60, 22, 5, 5, 27, 82, 165, 231, 231, 165, 82, 27, 5, 6, 33, 110, 247, 396, 462, 396, 247, 110, 33, 6
Offset: 2

Views

Author

Gary W. Adamson, Oct 14 2009

Keywords

Comments

Row sums = A120739: (1, 2, 7, 14, 30, 60, 127, 254, ...).

Examples

			First few rows of the triangle:
  1;
  1,   1;
  2,   3,   2;
  2,   5,   5,   2;
  3,   7,  10,   7,   3;
  3,  10,  17,  17,  10,   3;
  4,  14,  28,  35,  28,  14,   4;
  4,  18,  42,  63,  63,  42,  18,   4;
  5,  22,  60, 105, 126, 105,  60,  22,   5;
  5,  27,  82, 165, 231, 231, 165,  82,  27,   5;
  6,  33, 110, 247, 396, 462, 396, 247, 110,  33,   6;
  ...
		

Crossrefs

Cf. A007318, A011848, A001700 (central terms).

Programs

  • GAP
    Flat(List([2..12],n->List([1..n-1],m->Int(Binomial(n,m)/2)))); # Muniru A Asiru, Apr 14 2019
    
  • Haskell
    Following Bagula's formula
    a166454 n k = a166454_tabl !! (n-2) !! (k-1)
    a166454_row n = a166454_tabl !! (n-2)
    a166454_tabl = map (map (flip div 2) . init . tail) $ drop 2 a007318_tabl
    -- Reinhard Zumkeller, Mar 04 2015
    
  • Magma
    [[Floor(Binomial(n,k)/2): k in [1..n-1]]: n in [2..12]]; // G. C. Greubel, Apr 16 2019
    
  • Maple
    seq(seq(floor(binomial(n,m)/2),m=1..n-1),n=2..12); # Muniru A Asiru, Apr 14 2019
  • Mathematica
    T[n_, m_] = Floor[Binomial[n, m]/2]; Table[T[n, m], {n, 2, 12}, {m, 1, n-1}]//Flatten (* Roger L. Bagula, Mar 07 2010*)
  • PARI
    {T(n,k) = binomial(n,k)\2 };
    for(n=2,12, for(k=1,n-1, print1(T(n,k), ", "))) \\ G. C. Greubel, Apr 16 2019
    
  • Sage
    [[floor(binomial(n,k)/2) for k in (1..n-1)] for n in (2..12)] # G. C. Greubel, Apr 16 2019

Formula

T(n, k) = (1/2)*(A007318(n,k) - A047999(n,k)), nonzero terms.
T(n, m) = floor(binomial(n, m)/2). - Roger L. Bagula, Mar 07 2010

A350393 Smallest degree of x with the largest coefficient in Product_{k=1..n} (1 + x^k).

Original entry on oeis.org

0, 0, 0, 3, 3, 5, 9, 12, 18, 21, 27, 33, 39, 45, 52, 60, 68, 76, 85, 95, 105, 115, 126, 138, 150, 162, 175, 189, 203, 217, 232, 248, 264, 280, 297, 315, 333, 351, 370, 390, 410, 430, 451, 473, 495, 517, 540, 564, 588, 612, 637, 663, 689, 715, 742, 770, 798, 826, 855, 885, 915, 945, 976
Offset: 0

Views

Author

Max Alekseyev, Dec 28 2021

Keywords

Comments

Apparently, a(n) = A011848(n+1) for n >= 10. - Hugo Pfoertner, Dec 30 2021

Crossrefs

Cf. A025591 (largest coefficient), A350394 (largest degree of x), A350395, A350396.
Cf. A011848.

Programs

  • PARI
    { A350393(n) = my(v,t,x='x); v = Vecrev(prod(k=1,n,1+x^k)); vecmax(v,&t); t-1; }

A118404 Triangle T, read by rows, where all columns of T are different and yet all columns of the matrix square T^2 (A118407) are equal; also equals the matrix inverse of triangle A118400.

Original entry on oeis.org

1, 1, -1, -1, 0, 1, -1, 1, -1, -1, 1, 0, 0, 2, 1, 1, -1, 0, -2, -3, -1, -1, 0, 1, 2, 5, 4, 1, -1, 1, -1, -3, -7, -9, -5, -1, 1, 0, 0, 4, 10, 16, 14, 6, 1, 1, -1, 0, -4, -14, -26, -30, -20, -7, -1, -1, 0, 1, 4, 18, 40, 56, 50, 27, 8, 1, -1, 1, -1, -5, -22, -58, -96, -106, -77, -35, -9, -1, 1, 0, 0, 6, 27, 80, 154, 202, 183, 112, 44, 10, 1, 1, -1, 0, -6, -33, -107, -234, -356, -385, -295, -156, -54, -11, -1, -1, 0, 1, 6, 39, 140, 341, 590, 741, 680, 451, 210, 65, 12, 1, -1, 1, -1, -7, -45, -179, -481, -931, -1331, -1421, -1131, -661, -275, -77, -13, -1, 1, 0, 0, 8, 52, 224, 660, 1412, 2262, 2752, 2552, 1792, 936, 352, 90, 14, 1
Offset: 0

Views

Author

Paul D. Hanna, Apr 27 2006

Keywords

Comments

Appears to coincide with triangle (5.2) in Lee-Oh (2016), although there is no obvious connection! - N. J. A. Sloane, Dec 07 2016

Examples

			Triangle begins:
1;
1,-1;
-1, 0, 1;
-1, 1,-1,-1;
1, 0, 0, 2, 1;
1,-1, 0,-2,-3,-1;
-1, 0, 1, 2, 5, 4, 1;
-1, 1,-1,-3,-7,-9,-5,-1;
1, 0, 0, 4, 10, 16, 14, 6, 1;
1,-1, 0,-4,-14,-26,-30,-20,-7,-1;
-1, 0, 1, 4, 18, 40, 56, 50, 27, 8, 1;
-1, 1,-1,-5,-22,-58,-96,-106,-77,-35,-9,-1;
1, 0, 0, 6, 27, 80, 154, 202, 183, 112, 44, 10, 1;
1, -1, 0, -6, -33, -107, -234, -356, -385, -295, -156, -54, -11, -1;
-1, 0, 1, 6, 39, 140, 341, 590, 741, 680, 451, 210, 65, 12, 1;
-1, 1, -1, -7, -45, -179, -481, -931, -1331, -1421, -1131, -661, -275, -77, -13, -1;
1, 0, 0, 8, 52, 224, 660, 1412, 2262, 2752, 2552, 1792, 936, 352, 90, 14, 1;
1, -1, 0, -8, -60, -276, -884, -2072, -3674, -5014, -5304, -4344, -2728, -1288, -442, -104, -15, -1;
-1, 0, 1, 8, 68, 336, 1160, 2956, 5746, 8688, 10318, 9648, 7072, 4016, 1730, 546, 119, 16, 1; ...
The matrix square is A118407:
1;
0, 1;
-2, 0, 1;
2,-2, 0, 1;
0, 2,-2, 0, 1;
-2, 0, 2,-2, 0, 1;
4,-2, 0, 2,-2, 0, 1;
-6, 4,-2, 0, 2,-2, 0, 1;
4,-6, 4,-2, 0, 2,-2, 0, 1;
6, 4,-6, 4,-2, 0, 2,-2, 0, 1; ...
in which all columns are equal.
		

Crossrefs

Cf. A118405 (row sums), A118406 (unsigned row sums), A118407 (matrix square), A118400 (matrix inverse).
Columns or diagonals (modulo offsets): A219977, A011848, A212342, A007598, A005581, A007910.

Programs

  • Mathematica
    T[n_, k_] := SeriesCoefficient[(-1)^k/((1+x^2)(1+x)^(k-1)), {x, 0, n-k}];
    Table[T[n, k], {n, 0, 16}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 26 2018 *)
  • PARI
    {T(n,k)=polcoeff(polcoeff((1+x)^2/(1+x^2)/(1+x+x*y +x*O(x^n)),n,x)+y*O(y^k),k,y)}
    for(n=0, 16, for(k=0, n, print1(T(n, k), ", ")); print(""))

Formula

G.f.: A(x,y) = (1+x)^2 / ( (1+x^2) * (1+x + x*y) ).
G.f. of column k: (-1)^k / ( (1+x^2) * (1+x)^(k-1) ) for k>=0.

A231754 Products of distinct primes congruent to 1 modulo 4 (A002144).

Original entry on oeis.org

1, 5, 13, 17, 29, 37, 41, 53, 61, 65, 73, 85, 89, 97, 101, 109, 113, 137, 145, 149, 157, 173, 181, 185, 193, 197, 205, 221, 229, 233, 241, 257, 265, 269, 277, 281, 293, 305, 313, 317, 337, 349, 353, 365, 373, 377, 389, 397, 401, 409, 421, 433, 445, 449
Offset: 1

Views

Author

Michel Marcus, Nov 13 2013

Keywords

Comments

Contains A002144 as a subsequence, and is a subsequence of A016813 and of A005117.
Also, these numbers satisfy A231589(n) = floor(n*(n-1)/4) (A011848).

Examples

			65 = 5*13 is in the sequence since both 5 and 13 are congruent to 1 modulo 4.
		

Crossrefs

Intersection of A005117 and A004613.

Programs

  • Maple
    isA231754 := proc(n)
        local d;
        for d in ifactors(n)[2] do
            if op(2,d) > 1 then
                return false;
            elif modp(op(1,d),4) <> 1 then
                return false;
            end if;
        end do:
        true ;
    end proc:
    for n from 1 to 500 do
        if isA231754(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Mar 16 2016
  • Mathematica
    Select[Range[500], # == 1 || AllTrue[FactorInteger[#], Last[#1] == 1 && Mod[First[#1], 4] == 1 &] &] (* Amiram Eldar, Mar 08 2024 *)
  • PARI
    isok(n) = if (! issquarefree(n), return (0)); if (n > 1, f = factor(n); for (i=1, #f~, if (f[i, 1] % 4 != 1, return (0)))); 1

Formula

The number of terms that do not exceed x is ~ c * x / sqrt(log(x)), where c = A088539 * sqrt(A175647) / Pi = 0.3097281805... (Jakimczuk, 2024, Theorem 3.10, p. 26). - Amiram Eldar, Mar 08 2024

A160438 Number of partitions of n*(n+1)/2 with at most four parts that can be obtained from grouping (with parentheses) a permutation of the sum 1+2+...+n.

Original entry on oeis.org

1, 1, 2, 5, 13, 35, 93, 215, 437, 815, 1436, 2413, 3886, 6041, 9125, 13436, 19323, 27221, 37670, 51293, 68797, 91025, 118982, 153797, 196721, 249206, 312935, 389761, 481709, 591080, 720485, 872763, 1050980, 1258565, 1499351, 1777462
Offset: 0

Views

Author

Hagen von Eitzen, May 13 2009

Keywords

Comments

a(n) is the number of integer quadruples (x,y,z,w) with x >= y >= z >= w >= 0 and x+y+z+w = n*(n+1)/2 such that the set {1,2,...,n} can be partitioned into four (possibly empty) subsets with respective element sums x, y, z, w.

Examples

			For n = 3 the a(3) = 5 solutions are 6 = (1+2+3), 5+1 = (2+3)+(1), 4+2 = (1+3)+(2), 3+3 = (3)+(1+2), 3+2+1 = (3)+(2)+(1). Note that 3+3 = (1+2)+(3) is the same as (3)+(1+2) as both are 3+3.
For n = 6 the partition 10+4+4+3 is *not* among the a(6) = 93 solutions because 4 can only come from grouping either (4) or (1+3), hence both groupings would have to occur; but (1+3) conflicts with both possible groupings (3) and (1+2) which could produce 3.
		

Formula

If n >= 8 then a(n) = A001400(n*(n+1)/2) - 2*A011848(n+1) - 5.

A160637 Hankel transform of A114464(n+1).

Original entry on oeis.org

1, 1, -2, -8, -32, -128, 1024, 16384, 262144, 4194304, -134217728, -8589934592, -549755813888, -35184372088832, 4503599627370496, 1152921504606846976, 295147905179352825856, 75557863725914323419136, -38685626227668133590597632, -39614081257132168796771975168
Offset: 0

Views

Author

Paul Barry, May 21 2009

Keywords

Comments

Hankel transform of A114464(n) is A160636.
This is a generalized Somos-4 sequence. - Michael Somos, Mar 14 2020

Crossrefs

Programs

  • Magma
    [(-2)^Floor(Binomial(n+1,2)/2): n in [0..50]]; // G. C. Greubel, May 03 2018
  • Mathematica
    Table[(-2)^Floor[Binomial[n + 1, 2]/2], {n, 0, 50}] (* G. C. Greubel, May 03 2018 *)
    a[ n_] := (-2)^Quotient[n (n + 1), 4]; (* Michael Somos, Mar 14 2020 *)
  • PARI
    for(n=0, 50, print1((-2)^floor(binomial(n+1,2)/2), ", ")) \\ G. C. Greubel, May 03 2018
    

Formula

a(n) = (-2)^floor(C(n+1,2)/2) = (-2)^A011848(n+1).
0 = a(n)*a(n+4) - 2*a(n+1)*a(n+3) + 4*a(n+2)^2 = a(n)*a(n+5) - 4*a(n+1)*a(n+4) for all n in Z. - Michael Somos, Mar 14 2020

A120739 a(n) = Sum_{k=0..n} floor(C(n,k)/2).

Original entry on oeis.org

0, 0, 1, 2, 7, 14, 30, 60, 127, 254, 510, 1020, 2046, 4092, 8188, 16376, 32767, 65534, 131070, 262140, 524286, 1048572, 2097148, 4194296, 8388606, 16777212, 33554428, 67108856, 134217724, 268435448, 536870904, 1073741808, 2147483647
Offset: 0

Views

Author

Paul Barry, Jun 29 2006

Keywords

Comments

Nonzero terms = row sums of triangle A166454. - Gary W. Adamson, Oct 14 2009

Crossrefs

Programs

  • Haskell
    a120739 n = if n < 2 then 0 else sum $ a166454_row n
    -- Reinhard Zumkeller, Mar 04 2015
    
  • Magma
    [(&+[Floor(Binomial(n,k)/2): k in [0..n]]): n in [0..40]]; // G. C. Greubel, Apr 18 2019
    
  • Mathematica
    Table[Sum[Floor[Binomial[n,k]/2], {k,0,n}], {n,0,40}] (* G. C. Greubel, Apr 18 2019 *)
  • PARI
    a(n)=(2^n-2^norml2(binary(n)))/2
    
  • PARI
    {a(n) = sum(k=0,n, binomial(n,k)\2)}; \\ G. C. Greubel, Apr 18 2019
    
  • Sage
    [sum(floor(binomial(n,k)/2) for k in (0..n)) for n in (0..40)] # G. C. Greubel, Apr 18 2019

Formula

a(n) = (2^n - A001316(n))/2.
Previous Showing 11-20 of 29 results. Next