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.

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

This page as a plain text file.
%I A385689 #11 Jul 12 2025 22:41:55
%S A385689 1,3,9,25,63,141,283,519,885,1423,2181,3213,4579,6345,8583,11371,
%T A385689 14793,18939,23905,29793,36711,44773,54099,64815,77053,90951,106653,
%U A385689 124309,144075,166113,190591,217683,247569,280435,316473,355881,398863,445629,496395,551383,610821,674943
%N A385689 a(n) = 6*binomial(n,4) + 6*binomial(n,3) + 4*binomial(n,2) + 2*n + 1.
%C A385689 a(n) is the number of ternary strings of length n that contain at most two 1's and at most two 2's.
%H A385689 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (5,-10,10,-5,1).
%F A385689 a(n) = (1/4)*n^4 - (1/2)*n^3 + (7/4)*n^2 + (1/2)*n + 1.
%F A385689 G.f.: (3*x^4 + 4*x^2 - 2*x + 1)/(1 - x)^5.
%F A385689 E.g.f.: exp(x)*(1 + x + x^2/2)^2.
%e A385689 a(3) = 25 since from the 27 ternary strings of length 3 we exclude the strings 111 and 222.
%t A385689 LinearRecurrence[{5,-10,10,-5,1},{1, 3, 9, 25, 63},42] (* _Stefano Spezia_, Jul 07 2025 *)
%o A385689 (Python)
%o A385689 def A385689(n): return (n*(n*(n*(n-2)+7)+2)>>2)+1 # _Chai Wah Wu_, Jul 12 2025
%Y A385689 Cf. A127873.
%K A385689 nonn,easy
%O A385689 0,2
%A A385689 _Enrique Navarrete_, Jul 07 2025