OFFSET
0,4
COMMENTS
The nonnegative integers are displayed as in A350131.
Given the set S = {3, 4, 5, 6, 7}, the function f defined in S as f(3) = f(5) = 2, f(4) = 3, and f(6) = f(7) = 1, a(n) is equal to the difference between the number b(n) of S-restricted f-weighted integer compositions of n with that of n-6, i.e., b(n-6). The latter one provides the number of all those excluded cases where a nonnegative integer is displayed with leading zeros. b(n) is calculated as the sum of polynomial coefficients or extended binomial coefficients (see Equation 3 in Eger) where the index of summation is positive and it covers the numbers of possible digits that can be displayed by n segments (see first formula).
LINKS
Steffen Eger, Restricted Weighted Integer Compositions and Extended Binomial Coefficients, Journal of Integer Sequences, Vol. 16, Article 13.1.3, (2013).
Wikipedia, Postal code template.
Wikipedia, Postal codes in Russia.
Index entries for linear recurrences with constant coefficients, signature (0,0,2,3,2,1,1).
FORMULA
a(n) = b(n) - b(n-6), where b(n) = [x^n] Sum_{k=max(1,ceiling(n/7))..floor(n/2)} P(x)^k with P(x) = 2*x^3 + 3*x^4 + 2*x^5 + x^6 + x^7.
G.f.: x^3*(1 - x)*(1 + x)*(1 - x + x^2)*(1 + x + x^2)*(2 + 3*x + 2*x^2 + x^3 + x^4)/(1 - 2*x^3 - 3*x^4 - 2*x^5 - x^6 - x^7).
a(n) = 2*a(n-3) + 3*a(n-4) + 2*a(n-5) + a(n-6) + a(n-7) for n > 13.
EXAMPLE
a(6) = 5 since 0, 11, 17, 71 and 77 are displayed by 6 segments.
_ _ _ _ _
| | /| /| /| / / /| / /
|_| | | | | | | | |
(0) (11) (17) (71) (77)
MATHEMATICA
P[x_]:=2x^3+3x^4+2x^5+x^6+x^7; b[n_]:=Coefficient[Sum[P[x]^k, {k, Max[1, Ceiling[n/7]], Floor[n/2]}], x, n]; a[n_]:=b[n]-b[n-6]; Array[a, 41, 0]
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Stefano Spezia, Dec 18 2021
STATUS
approved