login
A343315
a(n) is the number of nonnegative integers that can be represented in a 7-segment display by using only n segments (version A277116).
5
0, 0, 1, 1, 2, 6, 6, 14, 19, 36, 67, 103, 194, 315, 560, 971, 1651, 2895, 4933, 8581, 14798, 25515, 44165, 76067, 131563, 227034, 392032, 677152, 1168742, 2018769, 3485255, 6018422, 10392472, 17943750, 30985861, 53501944, 92385050, 159523542, 275451221, 475633952
OFFSET
0,5
COMMENTS
The nonnegative integers are displayed as in A277116.
Given the set S = {2, 3, 4, 5, 6, 7}, the function f defined in S as f(5) = 4, f(6) = 2 and f(s) = 1 elsewhere, 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 third formula).
FORMULA
G.f.: x^2*(1 - x)*(1 + x)*(1 - x + x^2)*(1 + x + x^2)*(1 + x + x^2 + 4*x^3 + 2*x^4 + x^5)/(1 - x^2 - x^3 - x^4 - 4*x^5 - 2*x^6 - x^7).
a(n) = a(n-2) + a(n-3) + a(n-4) + 4*a(n-5) + 2*a(n-6) + a(n-7) for n > 13.
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) = x^2 + x^3 + x^4 + 4*x^5 + 2*x^6 + x^7.
EXAMPLE
a(5) = 6 since 2, 3, 5, 9, 17 and 71 are displayed by 5 segments.
__ __ __ __ __ __
__| __| |__ |__| | | | |
|__ __| __| | | | | |
(2) (3) (5) (9) (17) (71)
MATHEMATICA
P[x_]:=x^2+x^3+x^4+4x^5+2x^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, 40, 0]
KEYWORD
nonn,base,easy
AUTHOR
Stefano Spezia, Apr 11 2021
STATUS
approved