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.

A350438 a(n) is the number of integers that can be represented in a 7-segment display by using only n segments (version A010371).

Original entry on oeis.org

0, 0, 1, 1, 3, 6, 11, 14, 23, 39, 71, 118, 195, 317, 537, 906, 1533, 2550, 4261, 7119, 11973, 20073, 33650, 56277, 94286, 157960, 264843, 443656, 743269, 1244915, 2085970, 3494922, 5855965, 9810370, 16436113, 27536138, 46135634, 77295509, 129501787, 216963199, 363500178
Offset: 0

Views

Author

Stefano Spezia, Dec 31 2021

Keywords

Comments

The integers are displayed as in A010371, where a 7 is depicted by 4 segments. The negative integers are depicted by using 1 segment more for the minus sign.
Since the integer 0 is depicted by 6 segments, in order to avoid considering -0 in the case n = 7, a(7) is obtained by decreasing of a unit the result of the sum A331530(7) + A331530(6) = 7 + 8 = 15, i.e., a(7) = 15 - 1 = 14.

Examples

			a(7) = 14 since -111, -71, -41, -17, -14, -9, -6, 8, 12, 13, 15, 21, 31 and 51 are displayed by 7 segments.
                      __                              __
  __   |  |  |    __ |  |  |    __ |__|  |    __   | |  |    __   | |__|
       |  |  |          |  |          |  |         |    |         |    |
       (-111)        (-71)         (-41)          (-17)          (-14)
      __         __      __        __        __        __     __
  __ |__|    __ |__     |__|    |  __|    |  __|    | |__     __|  |
      __|       |__|    |__|    | |__     |  __|    |  __|   |__   |
    (-9)       (-6)     (8)      (12)      (13)      (15)      (21)
  __         __
  __|  |    |__   |
  __|  |     __|  |
   (31)       (51)
		

Crossrefs

Programs

  • Mathematica
    P[x_]:=x^2+2x^4+3x^5+3x^6+x^7; c[n_]:=Coefficient[Sum[P[x]^k, {k, Max[1, Ceiling[n/7]], Floor[n/2]}], x, n]; b[n_]:=c[n]-c[n-6]; (* A331530 *)
    a[n_]:=If[n!=7,b[n]+b[n-1],14]; Array[a, 41, 0]

Formula

a(7) = 14, otherwise a(n) = A331530(n) + A331530(n-1).
G.f.: x^2*(1 + x + 2*x^2 + 5*x^3 + 6*x^4 + 3*x^5 -2x^8- 3*x^9 - 3*x^10 - x^11)/(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.