OFFSET
3,1
LINKS
Robert Israel, Table of n, a(n) for n = 3..10000
Mattias Svanstrom, A lower bound for ternary constant weight codes, IEEE Trans. on Information Theory, Vol. 43 (Sep. 1997), pp. 1630-1632.
Index entries for linear recurrences with constant coefficients, signature (2,-1,1,-2,1).
FORMULA
a(n) = ceiling(binomial(n, w) * 2^w / (2*n + 1)) with w = 3.
Conjectures from Colin Barker, Aug 02 2019: (Start)
G.f.: x^3*(2 + 2*x^2 - x^3 + x^4) / ((1 - x)^3*(1 + x + x^2)).
a(n) = 2*a(n-1) - a(n-2) + a(n-3) - 2*a(n-4) + a(n-5) for n > 7. (End)
From Robert Israel, Jul 09 2020: (Start)
Conjectures confirmed.
a(n) = (2*n^2-7*n+8)/3 if n == 1 (mod 3), otherwise a(n) = (2*n^2-7*n+9)/3. (End)
E.g.f.: (2*exp(x)*(26 - 15*x + 6*x^2) - 9*(6 + 2*x + x^2)+ 2*exp(-x/2)*(cos(sqrt(3)*x/2) - sqrt(3)*sin(sqrt(3)*x/2)))/18. - Stefano Spezia, May 12 2026
For n>2, a(n) = 1+floor(8*binomial(n,3)/(2*n+1)). - Chai Wah Wu, May 12 2026
MAPLE
g:= n -> (2*n^2-7*n+`if`(n mod 3 = 1, 8, 9))/3:
map(g, [$3..100]); # Robert Israel, Jul 09 2020
MATHEMATICA
a[n_] := Ceiling[Binomial[n, 3] * 2^3 / (2*n + 1)]; Array[a, 52, 3] (* Amiram Eldar, Oct 31 2025 *)
PROG
(Python)
from math import comb
def A030503(n): return 1+(comb(n, 3)<<3)//(2*n+1) if n>2 else 0 # Chai Wah Wu, May 12 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Mattias Svanstrom (mattias(AT)isy.liu.se)
STATUS
approved
