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-12 of 12 results.

A385689 a(n) = 6*binomial(n,4) + 6*binomial(n,3) + 4*binomial(n,2) + 2*n + 1.

Original entry on oeis.org

1, 3, 9, 25, 63, 141, 283, 519, 885, 1423, 2181, 3213, 4579, 6345, 8583, 11371, 14793, 18939, 23905, 29793, 36711, 44773, 54099, 64815, 77053, 90951, 106653, 124309, 144075, 166113, 190591, 217683, 247569, 280435, 316473, 355881, 398863, 445629, 496395, 551383, 610821, 674943
Offset: 0

Views

Author

Enrique Navarrete, Jul 07 2025

Keywords

Comments

a(n) is the number of ternary strings of length n that contain at most two 1's and at most two 2's.

Examples

			a(3) = 25 since from the 27 ternary strings of length 3 we exclude the strings 111 and 222.
		

Crossrefs

Cf. A127873.

Programs

  • Mathematica
    LinearRecurrence[{5,-10,10,-5,1},{1, 3, 9, 25, 63},42] (* Stefano Spezia, Jul 07 2025 *)
  • Python
    def A385689(n): return (n*(n*(n*(n-2)+7)+2)>>2)+1 # Chai Wah Wu, Jul 12 2025

Formula

a(n) = (1/4)*n^4 - (1/2)*n^3 + (7/4)*n^2 + (1/2)*n + 1.
G.f.: (3*x^4 + 4*x^2 - 2*x + 1)/(1 - x)^5.
E.g.f.: exp(x)*(1 + x + x^2/2)^2.

A383343 a(n) = 3^n - 3*binomial(n,3) - 3*binomial(n,2) - 2*n - 1.

Original entry on oeis.org

0, 0, 1, 8, 42, 172, 611, 2004, 6292, 19304, 58533, 176464, 530558, 1593204, 4781575, 14347196, 43044648, 129137680, 387417545, 1162258008, 3486780370, 10460348540, 31381054251, 94143172708, 282429529532, 847288601592, 2541865819501, 7625597475104, 22876792443942, 68630377352644, 205891132081103
Offset: 0

Views

Author

Enrique Navarrete, Apr 23 2025

Keywords

Comments

a(n) is the number of ternary strings of length n that contain at least two 1s or at least three 2s (or both).

Examples

			a(3) = 8 since the strings are 110 (3 of this type), 112 (3 of this type), 111, and 222.
		

Crossrefs

Cf. A127873.

Programs

  • Mathematica
    a[n_] := 3^n - 3*Binomial[n, 3] - 3*Binomial[n, 2] - 2*n - 1; Array[a, 31, 0] (* Amiram Eldar, Apr 24 2025 *)

Formula

a(n) = 7*a(n-1) - 18*a(n-2) + 22*a(n-3) - 13*a(n-4) + 3*a(n-5), n>4.
From Stefano Spezia, Apr 24 2025: (Start)
G.f.: x^2*(1 + x + 4*x^2)/((1 - x)^4*(1 - 3*x)).
E.g.f.: exp(3*x) - exp(x)*(2 + 4*x + 3*x^2 + x^3)/2. (End)
a(n) = 3^n - A127873(n-1).
Previous Showing 11-12 of 12 results.