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 48 results. Next

A227321 a(n) is the least r>=3 such that the difference between the nearest r-gonal number >= n and n is an r-gonal number.

Original entry on oeis.org

3, 3, 3, 3, 4, 3, 3, 3, 4, 3, 3, 5, 3, 8, 3, 3, 4, 5, 3, 11, 3, 3, 3, 5, 4, 3, 10, 3, 3, 11, 3, 17, 4, 3, 5, 3, 3, 7, 14, 3, 4, 15, 3, 23, 3, 3, 5, 11, 4, 3, 5, 5, 3, 19, 3, 3, 3, 8, 5, 21, 3, 32, 14, 3, 4, 3, 3, 15, 3, 5, 5, 25, 3, 38, 7, 3, 6, 3, 3, 13, 4, 3
Offset: 0

Views

Author

Vladimir Shevelev, Jul 30 2013

Keywords

Comments

The n-th r-gonal numbers is n((n-1)r-2(n-2))/2, such that 3-gonal numbers are triangular numbers, 4-gonal numbers are squares, etc.

Crossrefs

Cf. A000217 (r=3), A000290 (r=4), A000326 (r=5), A000384 (r=6), A000566 (r=7), A000567 (r=8), A001106-7 (r=9,10), A051682 (r=11), A051624 (r=12), A051865-A051876 (r=13-24).

Programs

  • Mathematica
    rGonalQ[r_,0]:=True; rGonalQ[r_,n_]:=IntegerQ[(Sqrt[((8r-16)n+(r-4)^2)]+r-4)/(2r-4)]; nthrGonal[r_,n_]:=(n (r-2)(n-1))/2+n; nextrGonal[r_,n_]:=nthrGonal[r,Ceiling[(Sqrt[((8r-16)n+(r-4)^2)]+r-4)/(2r-4)]]; (* next r-gonal number greater than or equal to n *) Table[NestWhile[#+1&,3,!rGonalQ[#,nextrGonal[#,n]-n]&],{n,0,99}] (* Peter J. C. Moses, Aug 03 2013 *)

Formula

If n is prime, then n == 1 or 2 mod (a(n)-2). If n >= 13 is the greater of a pair of twin primes (A006512), then a(n) = (n+3)/2. - Vladimir Shevelev, Aug 07 2013

Extensions

More terms from Peter J. C. Moses, Jul 30 2013

A236257 a(n) = 2*n^2 - 7*n + 9.

Original entry on oeis.org

9, 4, 3, 6, 13, 24, 39, 58, 81, 108, 139, 174, 213, 256, 303, 354, 409, 468, 531, 598, 669, 744, 823, 906, 993, 1084, 1179, 1278, 1381, 1488, 1599, 1714, 1833, 1956, 2083, 2214, 2349, 2488, 2631, 2778, 2929, 3084, 3243, 3406, 3573, 3744, 3919, 4098, 4281, 4468
Offset: 0

Views

Author

Vladimir Shevelev, Jan 21 2014

Keywords

Comments

If zero polygonal numbers are ignored, then for n >= 3, the a(n)-th n-gonal number is a sum of the (a(n)-1)-th n-gonal number and the (2*n-3)-th n-gonal number.

Examples

			a(7)=58. This means that the 58th heptagonal number 8323 (cf. A000566) is a sum of two heptagonal numbers. We have 8323 = 8037 + 286 with indices in A000566 58,57,11.
		

Crossrefs

Programs

  • Mathematica
    Table[2 n^2 - 7 n + 9, {n, 0, 48}] (* Michael De Vlieger, Apr 19 2015 *)
    LinearRecurrence[{3,-3,1},{9,4,3},50] (* Harvey P. Dale, Nov 24 2017 *)
  • PARI
    Vec(-(18*x^2-23*x+9)/(x-1)^3 + O(x^100)) \\ Colin Barker, Jan 21 2014

Formula

From Colin Barker, Jan 21 2014: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: -(18*x^2 - 23*x + 9)/(x-1)^3. (End)
E.g.f.: exp(x)*(9 - 5*x + 2*x^2). - Elmo R. Oliveira, Nov 13 2024

A287152 Number T(n,k) of tilings of a 2 X n X n box using k bricks of shape 2 X 1 X 1 and 2*(n^2-k) bricks of shape 1 X 1 X 1; triangle T(n,k), n>=0, 0<=k<=n^2, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 12, 42, 44, 9, 1, 33, 436, 2984, 11434, 24766, 29180, 16984, 3993, 229, 1, 64, 1816, 30208, 328214, 2456736, 13022504, 49492032, 135062729, 262610832, 357580896, 331384336, 200032432, 73483328, 14707328, 1308928, 32000, 1, 105, 5112, 153364, 3178256
Offset: 0

Views

Author

Alois P. Heinz, May 20 2017

Keywords

Examples

			Triangle T(n,k) begins:
1;
1,  1;
1, 12,  42,   44,     9;
1, 33, 436, 2984, 11434, 24766, 29180, 16984, 3993, 229;
		

Crossrefs

Columns k=0-1 give: A000012, A051624.
Row sums give A287153.
T(n,n^2) gives A181205.

A214421 Numbers not representable as the sum of three 12-gonal numbers.

Original entry on oeis.org

4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 26, 27, 28, 29, 30, 31, 32, 37, 38, 39, 40, 41, 42, 43, 44, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 68, 69, 70, 71, 72, 73, 74, 75, 79, 80, 81, 82, 83, 84, 85, 86, 87, 89
Offset: 1

Views

Author

T. D. Noe, Jul 17 2012

Keywords

Comments

There are an infinite number of numbers that are not the sum of three 12-gonal numbers.

References

  • R. K. Guy, Unsolved Problems in Number Theory, D3.

Crossrefs

Cf. A051624 (12-gonal numbers).

Programs

  • Mathematica
    nn = 100; dod = Table[n*(5n-4), {n, 0, nn}]; t = Table[0, {dod[[-1]]}]; Do[n = dod[[i]] + dod[[j]] + dod[[k]]; If[n <= dod[[-1]], t[[n]] = 1], {i, nn}, {j, i, nn}, {k, j, nn}]; Flatten[Position[t, 0]]

A366827 -a(n)/7! is the coefficient of x^7 in the Taylor expansion of the k-th iteration of sin(x).

Original entry on oeis.org

0, 1, 128, 731, 2160, 4765, 8896, 14903, 23136, 33945, 47680, 64691, 85328, 109941, 138880, 172495, 211136, 255153, 304896, 360715, 422960, 491981, 568128, 651751, 743200, 842825, 950976, 1068003, 1194256, 1330085, 1475840, 1631871, 1798528, 1976161, 2165120, 2365755, 2578416
Offset: 0

Views

Author

Jianing Song, Oct 25 2023

Keywords

Comments

a(n)/7! is the coefficient of x^7 in the Taylor expansion of the k-th iteration of sinh(x). This is most easily seen from the relation -i*sin(...sin(sin(sin(i*x)))...) = -i*sin(...sin(sin(i*sinh(x)))...) = -i*sin(...sin(i*sinh(sinh(x)))...) = ... = sinh(...sinh(sinh(sinh(x)))...).

Examples

			sin(sin(x)) = x - 2*x^3/3! + 12*x^5/5! - 128*x^7/7! + ...;
sin(sin(sin(x))) = x - 3*x^3/3! + 33*x^5/5! - 731*x^7/7! + ...;
sin(sin(sin(sin(x)))) = x - 4*x^3/3! + 64*x^5/5! - 2160*x^7/7! + ....
		

Crossrefs

Cf. A366834 (main sequence), A051624 (coefficient of x^5), A285018, A285019.

Programs

  • PARI
    a(n) = (175/3)*n^3 - 112*n^2 + (164/3)*n

Formula

a(n) = binomial(n,1) + 126*binomial(n,2) + 350*binomial(n,3) = (175*n^2 - 336*n + 164)*n/3. See A366834.
G.f.: x/(1-x)^2 + 126*x^2/(1-x)^3 + 350*x^3/(1-x)^4.

A366834 Square array read by descending antidiagonals: (-1)^n*T(n,k)/n! is the coefficient of x^(2*n+1) in the Taylor expansion of the k-th iteration of sin(x).

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 12, 1, 0, 1, 4, 33, 128, 1, 0, 1, 5, 64, 731, 1872, 1, 0, 1, 6, 105, 2160, 25857, 37600, 1, 0, 1, 7, 156, 4765, 121600, 1311379, 990784, 1, 0, 1, 8, 217, 8896, 368145, 10138880, 89060065, 32333824, 1, 0, 1, 9, 288, 14903, 873936, 42807605, 1162426880, 7778778091, 1272660224, 1, 0
Offset: 0

Views

Author

Jianing Song, Oct 25 2023

Keywords

Comments

T(n,k)/n! is the coefficient of x^(2*n+1) in the Taylor expansion of the k-th iteration of sinh(x). This is most easily seen from the relation -i*sin(...sin(sin(sin(i*x)))...) = -i*sin(...sin(sin(i*sinh(x)))...) = -i*sin(...sin(i*sinh(sinh(x)))...) = ... = sinh(...sinh(sinh(sinh(x)))...).

Examples

			G.f.s of the first few rows:
n = 0: 1/(1-x);
n = 1: x/(1-x)^2;
n = 2: x/(1-x)^2 + 10*x^2/(1-x)^3;
n = 3: x/(1-x)^2 + 126*x^2/(1-x)^3 + 350*x^3/(1-x)^4:
n = 4: x/(1-x)^2 + 1870*x^2/(1-x)^3 + 20244*x^3/(1-x)^4 + 29400*x^4/(1-x)^5;
n = 5: x/(1-x)^2 + 37598*x^2/(1-x)^3 + 1198582*x^3/(1-x)^4 + 5118960*x^4/(1-x)^5 + 4851000*x^5/(1-x)^6.
The explicit formulas for the first few rows:
T(0,k) = binomial(k,0) = 1 for k = 0, 0 for k > 0;
T(1,k) = binomial(k,1) = k;
T(2,k) = binomial(k,1) + 10*binomial(k,2) = 5*k^2 - 4*k;
T(3,k) = binomial(k,1) + 126*binomial(k,2) + 350*binomial(k,3) = (175/3)*k^3 - 112*k^2 + (164/3)*k;
T(4,k) = binomial(k,1) + 1870*binomial(k,2) + 20244*binomial(k,3) + 29400*binomial(k,4) = 1225*k^4 - 3976*k^3 + 4288*k^2 - 1536*k;
T(5,k) = binomial(k,1) + 37598*binomial(k,2) + 1198582*binomial(k,3) + 5118960*binomial(k,4) + 4851000*binomial(k,5) = 40425*k^5 - 190960*k^4 + (1004696/3)*k^3 - 255552*k^2 + (213568/3)*k.
Table of terms:
Row 0: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Row 1: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Row 2: 0, 1, 12, 33, 64, 105, 156, 217, 288, 369, 460
Row 3: 0, 1, 128, 731, 2160, 4765, 8896, 14903, 23136, 33945, 47680
Row 4: 0, 1, 1872, 25857, 121600, 368145, 873936, 1776817, 3244032, 5472225, 8687440
Row 5: 0, 1, 37600, 1311379, 10138880, 42807605, 130426016, 323774535, 698156544, 1358249385, 2442955360
Row 6: 0, 1, 990784, 89060065, 1162426880, 6937805945, 27344158016, 83303826249, 212901058560, 478937915985, 977877567040
Row 7: 0, 1, 32333824, 7778778091, 174394695680, 1487589904205, 7634965431296, 28668866786679, 87104014381056, 227079171721785, 527214112015360
Row 8: 0, 1, 1272660224, 849264442881, 33044097597440, 406373544070945, 2731282112246016, 12688038285458529, 45949019179646976, 139088689115885505, 367745105831952640
Row 9: 0, 1, 59527313920, 113234181108643, 7701145601933312, 137461463840219237, 1215573962763120128, 7008667055272520967, 30322784763588771840, 106757902382656031049, 321859857651846029824
Row 10: 0, 1, 3252626013184, 18073465545032353, 2162675327569362944, 56311245536706922889, 657730167421332884480, 4719958813316934631353, 24445625744089126797312, 100254353682662263787313, 345053755346367061654528
Demonstration of terms:
sin(sin(x)) = x - 2*x^3/3! + 12*x^5/5! - 128*x^7/7! + 1872*x^9/9! - 37600*x^11/11! + ...;
sin(sin(sin(x))) = x - 3*x^3/3! + 33*x^5/5! - 731*x^7/7! + 25857*x^9/9! - 1311379*x^11/11! + ...;
sin(sin(sin(sin(x)))) = x - 4*x^3/3! + 64*x^5/5! - 2160*x^7/7! + 121600*x^9/9! - 10138880*x^11/11! + ....
		

Crossrefs

Cf. A051624 (row n=2), A366827 (row n=3), A003712 (column k=2 signed), A003715 (column k=3 signed).

Programs

  • PARI
    A160562(n,k) = (-1)^k / (2*k+1)! * sum(j=0, k, (-1)^j * binomial(2*k+1, k-j) * (2*j+1)^(2*n+1)) / 2^(2*k)
    coeff_of_n_gfs(n) = my(M=matid(1)); for(k=1, n, M = matconcat([concat(M, matrix(k, 1)); concat(0, matrix(1, k, i, j, A160562(k, j-1))*M)])); M \\ The lower triangle matrix (C(i,j))_{0<=j<=i<=n}
    T_mat(n,k) = coeff_of_n_gfs(n)*matrix(n+1, k+1, i, j, binomial(j-1,i-1)) \\ gives T(i,j) for i=0..n and j=0..k

Formula

T(0,0) = 1, T(n,0) = 0 for n >= 1; T(n,k) = Sum_{i=0..n} A160562(n,i)*T(i,k-1) for k >= 1, where A160562(n,k) = ((-1)^(n-k)*(2*n+1)!/(2*k+1)!) * [x^(2*n+1)]sin(x)^(2*k+1). Note that this is not very efficient to calculate the terms.
A more efficient way would be to calculate the g.f. for each row: the g.f. of the n-th row is C(n,0)/(1-x) + C(n,1)*x/(1-x)^2 + ... + C(n,n)*x^n/(1-x)^(n+1), where C(0,0) = 1, C(n,0) = 0 for n >= 1; C(n,k) = A160562(n,k-1)*C(k-1,k-1) + ... + A160562(n,n-1)*C(n-1,k-1) for n >= k >= 1, so we have T(n,k) = C(n,0)*binomial(k,0) + C(n,1)*binomial(k,1) + ... + C(n,n)*binomial(k,n). See my pdf in the link section for the proof.
From the formula above we see that the n-th row is a degree-n polynomial of k with leading coefficient C(n,n)/n!. We have C(n,n) = A160562(n,n-1)*C(n-1,n-1) = A000447(n)*C(n-1,n-1) for n >= 1, so it can be shown that C(n,n)/n! = n! * A285018(n)/A285019(n).

A380353 a(n) = (n^2 - n + 2) * (5*n^2 - 5*n + 2) / 4.

Original entry on oeis.org

1, 12, 64, 217, 561, 1216, 2332, 4089, 6697, 10396, 15456, 22177, 30889, 41952, 55756, 72721, 93297, 117964, 147232, 181641, 221761, 268192, 321564, 382537, 451801, 530076, 618112, 716689, 826617, 948736, 1083916, 1233057, 1397089, 1576972, 1773696, 1988281, 2221777
Offset: 1

Views

Author

Kelvin Voskuijl, Jan 22 2025

Keywords

Comments

First differences of A072474 (sum of next n squares).

Crossrefs

Cf. A072474 (partial sums), A051624, A000124.
Cf. A005448 (first difference of sum of next n natural numbers).

Programs

  • Mathematica
    Table[((n^2 - n + 2)*(5*n^2 - 5*n + 2))/4, {n, 1, 40}]
  • PARI
    a(n) = (n^2 - n + 2) * (5*n^2 - 5*n + 2) / 4

Formula

a(n) = A051624(A000124(n-1)).
G.f.: x*(1+3*x+x^2)*(1+4*x+x^2)/(1-x)^5. - Jinyuan Wang, Jan 23 2025
E.g.f.: exp(x)*(4 + 22*x^2 + 20*x^3 + 5*x^4)/4 - 1. - Stefano Spezia, Jan 28 2025

A183224 Complement of the 12-gonal numbers.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101
Offset: 1

Views

Author

Clark Kimberling, Jan 01 2011

Keywords

Crossrefs

Cf. A051624 (12-gonal numbers.)

Programs

  • Mathematica
    Table[n+Floor[1/2+(n/5+1/5)^(1/2)], {n,100}]
  • Python
    from math import isqrt
    def A183224(n): return n+(isqrt((n<<2|2)//5)+1>>1) # Chai Wah Wu, Oct 06 2024

Formula

a(n) = n + floor(1/2+(n/5+1/5)^(1/2)).

A236333 The (n-2)-th (n>=3) triple of terms gives coefficients of double trinomial P_n(x) = ((n-2)^2*x^2 + n*x + 2)/2 (see comment).

Original entry on oeis.org

1, 3, 2, 4, 4, 2, 9, 5, 2, 16, 6, 2, 25, 7, 2, 36, 8, 2, 49, 9, 2, 64, 10, 2, 81, 11, 2, 100, 12, 2, 121, 13, 2, 144, 14, 2, 169, 15, 2, 196, 16, 2, 225, 17, 2, 256, 18, 2, 289, 19, 2, 324, 20, 2, 361, 21, 2, 400, 22, 2, 441, 23, 2, 484, 24, 2, 529, 25, 2, 576, 26, 2, 625, 27, 2, 676, 28, 2, 729, 29, 2
Offset: 3

Views

Author

Vladimir Shevelev, Jan 22 2014

Keywords

Comments

Let {G_n(k)}_(k>=0) be sequence of n-gonal numbers. Then G_n(P_n(k)) = G_n(P_n(k)-1) + G_n((n-2)*k+1).

Examples

			Let n=5, k=4. Then G_5(k)=k*(3*k-1)/2 (Cf. A000326) and the double trinomial 2*P_5(x)= 9*x^2+5*x+2, P_5(4)=(9*4^2+5*4+2)/2=83,
Thus, we have G_5(83)=G_5(82)+G_5(13), or 83*124 = 41*245 + 13*19 = 10292.
		

Crossrefs

Programs

  • Magma
    I:=[1,3,2,4,4,2,9,5,2]; [n le 9 select I[n] else 3*Self(n-3)-3*Self(n-6)+Self(n-9): n in [1..90]]; // Vincenzo Librandi, Feb 02 2014
  • Mathematica
    a[n_]:=Which[Mod[n,3]==0,n^2/9,Mod[n,3]==1,(n+5)/3,True,2]; Map[a,Range[3,103]]
    CoefficientList[Series[(-1-3 x-2 x^2-x^3+5 x^4+4 x^5-2 x^7-2 x^8)/((-1+x)^3 (1+x+x^2)^3),{x,0,100}],x]
  • PARI
    Vec(-x^3*(2*x^8+2*x^7-4*x^5-5*x^4+x^3+2*x^2+3*x+1)/((x-1)^3*(x^2+x+1)^3) + O(x^100)) \\ Colin Barker, Jan 23 2014
    

Formula

If n==0 (mod 3), then a(n) = n^2/9;
if n==1 (mod 3), then a(n) = (n+5)/3;
if n==2 (mod 3), then a(n) = 2.
G.f.: -x^3*(2*x^8+2*x^7-4*x^5-5*x^4+x^3+2*x^2+3*x+1) / ((x-1)^3*(x^2+x+1)^3). - Colin Barker, Jan 23 2014

A266088 Alternating sum of 12-gonal (or dodecagonal) numbers.

Original entry on oeis.org

0, -1, 11, -22, 42, -63, 93, -124, 164, -205, 255, -306, 366, -427, 497, -568, 648, -729, 819, -910, 1010, -1111, 1221, -1332, 1452, -1573, 1703, -1834, 1974, -2115, 2265, -2416, 2576, -2737, 2907, -3078, 3258, -3439, 3629, -3820, 4020, -4221, 4431, -4642
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 21 2015

Keywords

Comments

More generally, the ordinary generating function for the alternating sum of k-gonal numbers is -x*(1 - (k - 3)*x)/((1 - x)*(1 + x)^3).

Crossrefs

Programs

  • Magma
    [1+(-1)^n*(5*n^2+n-2)/2: n in [0..50]]; // Vincenzo Librandi, Dec 21 2015
    
  • Mathematica
    Table[1 + (-1)^n (5 n^2 + n - 2)/2, {n, 0, 43}]
    CoefficientList[Series[-x (1 - 9 x)/((1 - x) (1 + x)^3), {x, 0, 50}], x] (* Vincenzo Librandi, Dec 21 2015 *)
  • PARI
    x='x+O('x^100); concat(0, Vec(-x*(1-9*x)/((1-x)*(1+x)^3))) \\ Altug Alkan, Dec 21 2015

Formula

G.f.: -x*(1 - 9*x)/((1 - x)*(1 + x)^3).
a(n) = 1 + (-1)^n*(5*n^2 + n - 2)/2.
a(n) = Sum_{k = 0..n} (-1)^k*A051624(k).
Lim_{n -> infinity} a(n + 1)/a(n) = -1.
Previous Showing 31-40 of 48 results. Next