A331530 a(n) is the number of nonnegative integers that can be represented in a 7-segment display by using only n segments (version A010371).
0, 0, 1, 0, 3, 3, 8, 7, 16, 23, 48, 70, 125, 192, 345, 561, 972, 1578, 2683, 4436, 7537, 12536, 21114, 35163, 59123, 98837, 166006, 277650, 465619, 779296, 1306674, 2188248, 3667717, 6142653, 10293460, 17242678, 28892956, 48402553, 81099234, 135863965, 227636213
Offset: 0
Examples
a(6) = 8 since 0, 6, 9, 14, 17, 41, 71, 111 are displayed by 6 segments. __ __ __ | | |__ |__| | |__| |__| |__| __| | | (0) (6) (9) (14) __ __ | | | |__| | | | | | | | | | | | | | | | | (17) (41) (71) (111)
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Steffen Eger, Restricted Weighted Integer Compositions and Extended Binomial Coefficients, Journal of Integer Sequences, Vol. 16, Article 13.1.3, (2013).
- Index entries for linear recurrences with constant coefficients, signature (0,1,0,2,3,3,1).
- Index entries for sequences related to calculator display
- Index entries for sequences related to compositions
Programs
-
Mathematica
P[x_]:=x^2+2x^4+3x^5+3x^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]
-
PARI
concat([0,0], Vec(x^2*(1 - x)*(1 + x)*(1 - x + x^2)*(1 + x + x^2)*(1 + 2*x^2 + 3*x^3 + 3*x^4 + x^5) / (1 - x^2 - 2*x^4 - 3*x^5 - 3*x^6 - x^7) + O(x^41))) \\ Colin Barker, Jan 20 2020
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) = x^2 + 2*x^4 + 3*x^5 + 3*x^6 + x^7.
From Colin Barker, Jan 20 2020: (Start)
G.f.: x^2*(1 - x)*(1 + x)*(1 - x + x^2)*(1 + x + x^2)*(1 + 2*x^2 + 3*x^3 + 3*x^4 + x^5) / (1 - x^2 - 2*x^4 - 3*x^5 - 3*x^6 - x^7).
a(n) = a(n-2) + 2*a(n-4) + 3*a(n-5) + 3*a(n-6) + a(n-7) for n>13.
(End)
Comments