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.

Showing 1-10 of 21 results. Next

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

Original entry on oeis.org

0, 0, 1, 1, 2, 7, 5, 16, 19, 39, 77, 103, 226, 334, 636, 1106, 1827, 3386, 5568, 10059, 17281, 29890, 52771, 90283, 159191, 274976, 479035, 835476, 1447278, 2528496, 4386143, 7640592, 13293308, 23106132, 40245277, 69946521, 121762316, 211791205, 368418674, 641125867
Offset: 0

Views

Author

Stefano Spezia, Apr 11 2021

Keywords

Comments

The nonnegative integers are displayed as in A063720.
Given the set S = {2, 3, 4, 5, 6, 7}, the function f defined in S as f(5) = 5 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).

Examples

			a(6) = 5 since 0, 14, 41, 77 and 111 are displayed by 6 segments.
    __                                   __   __
   |  |      | |__|      |__|    |         |    |      |    |    |
   |__|      |    |         |    |         |    |      |    |    |
    (0)       (14)          (41)            (77)          (111)
		

Crossrefs

Programs

  • Mathematica
    P[x_]:=x^2+x^3+x^4+5x^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, 40, 0]

Formula

G.f.: x^2*(1 - x)*(1 + x)*(1 - x + x^2)*(1 + x + x^2)*(1 + x + x^2 + 5*x^3 + x^4 + x^5)/(1 - x^2 - x^3 - x^4 - 5*x^5 - x^6 - x^7).
a(n) = a(n-2) + a(n-3) + a(n-4) + 5*a(n-5) + 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 + 5*x^5 + x^6 + x^7.

A357998 a(n) is the number of times in the format hh:mm that can be represented in a 7-segment display by using only n segments (version A063720).

Original entry on oeis.org

1, 2, 4, 18, 25, 41, 96, 103, 133, 189, 188, 154, 158, 155, 95, 53, 19, 5, 1
Offset: 8

Views

Author

Stefano Spezia, Oct 23 2022

Keywords

Comments

Since 8 <= A357972(n) <= 26 the sequence is finite and begins with offset 8.

Crossrefs

Histogram of A357972.

Programs

  • Mathematica
    a055643[n_]:=FromDigits@ Apply[Join, PadLeft[#, 2] & /@ IntegerDigits@ IntegerDigits[n, 60]]; a063720[n_] := Plus @@ (IntegerDigits@ n /. {0 -> 6, 1 -> 2, 2 -> 5, 3 -> 5, 6 -> 5, 7 -> 3, 8 -> 7, 9 -> 5}); a[n_]:=a063720[a055643[n]]+6(4-Ceiling[Log10[a055643[n]+1]]);Table[Count[Join[{24},Array[a,1439]],n],{n,8,26}]

A386910 Number of iterations of seven segments count x -> A063720(x) to go from n to a fixed point.

Original entry on oeis.org

2, 2, 1, 1, 0, 0, 1, 2, 3, 1, 4, 1, 3, 3, 2, 3, 3, 1, 2, 3, 2, 3, 5, 5, 2, 5, 5, 4, 4, 5, 2, 3, 5, 5, 2, 5, 5, 4, 4, 5, 5, 2, 2, 2, 4, 2, 2, 3, 2, 2, 2, 3, 5, 5, 2, 5, 5, 4, 4, 5, 2, 3, 5, 5, 2, 5, 5, 4, 4, 5, 2, 1, 4, 4, 3, 4, 4, 2, 5, 4, 4, 2, 4, 4, 2, 4, 4
Offset: 0

Views

Author

Marco Ripà, Aug 07 2025

Keywords

Comments

A063720 is a strictly decreasing function A063720(x) < x whenever x >= 10 and all single digit x reach a fixed point A063720(x) = x with x in {4, 5}.
This sequence is unbounded and the first occurrence of a(n) = k is at n = A338255(k + 1) for any k >= 3.

Examples

			For n = 12, the a(12) = 3 steps are 12 -> 7 -> 3 -> 5 segments, and 5 is a fixed point A063720(5) = 5.
		

Crossrefs

Cf. A006942, A010371, A074458, A277116 (segments variation).

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

Original entry on oeis.org

0, 0, 1, 2, 3, 9, 12, 20, 35, 58, 116, 180, 329, 560, 970, 1742, 2933, 5213, 8954, 15627, 27340, 47171, 82661, 143054, 249474, 434167, 754011, 1314511, 2282754, 3975774, 6914639, 12026735, 20933900, 36399440, 63351409, 110191798, 191708837, 333553521, 580209879
Offset: 0

Views

Author

Stefano Spezia, Dec 31 2021

Keywords

Comments

The integers are displayed as in A063720, where 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 A343314(7) + A343314(6) = 16 + 5 = 21, i.e., a(7) = 21 - 1 = 20.

Examples

			a(7) = 20 since -111, -77, -41, -14, 8, 12, 13, 15, 16, 19, 21, 31, 47, 51, 61, 74, 91, 117, 171 and 711 are displayed by 7 segments.
                      __  __                                    __
  __   |  |  |    __    |   |    __  |__|  |    __   | |__|    |__|
       |  |  |          |   |           |  |         |    |    |__|
      (-111)          (-77)          (-41)          (-14)       (8)
      __        __         __                    __      __
  |   __|    |  __|    |  |__     |  |__     |  |__|     __|  |
  |  |__     |  __|    |   __|    |  |__|    |     |    |__   |
   (12)       (13)      (15)       (16)       (19)        (21)
  __               __      __                      __
  __|   |    |__|    |    |__    |    |__    |       |  |__|
  __|   |       |    |     __|   |    |__|   |       |     |
   (31)         (47)        (51)        (61)          (74)
   __                 __         __          __
  |__|   |      |   |   |      |   |   |       |   |   |
     |   |      |   |   |      |   |   |       |   |   |
    (91)          (117)          (171)           (711)
		

Crossrefs

Programs

  • Mathematica
    P[x_]:=x^2+x^3+x^4+5x^5+x^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]; (* A343314 *)
    a[n_]:=If[n!=7,b[n]+b[n-1],20];Array[a, 39, 0]

Formula

a(7) = 20, otherwise a(n) = A343314(n) + A343314(n-1).
G.f.: x^2*(1 + 2*x + 2*x^2 + 6*x^3 + 6*x^4 + x^5 - x^7 - x^8 - 5*x^9 - x^10 - x^11)/(1 - x^2 - x^3 - x^4 - 5*x^5 - x^6 - x^7).
a(n) = a(n-2) + a(n-3) + a(n-4) + 5*a(n-5) + a(n-6) + a(n-7) for n > 13.

A006942 Number of segments used to represent n on calculator display, variant 5: digits '6', '7' and '9' use 6, 3 and 6 segments, respectively.

Original entry on oeis.org

6, 2, 5, 5, 4, 5, 6, 3, 7, 6, 8, 4, 7, 7, 6, 7, 8, 5, 9, 8, 11, 7, 10, 10, 9, 10, 11, 8, 12, 11, 11, 7, 10, 10, 9, 10, 11, 8, 12, 11, 10, 6, 9, 9, 8, 9, 10, 7, 11, 10, 11, 7, 10, 10, 9, 10, 11, 8, 12, 11, 12, 8, 11, 11, 10, 11, 12, 9, 13, 12, 9, 5, 8, 8, 7, 8, 9
Offset: 0

Views

Author

Keywords

Comments

a(A216261(n)) = n and a(m) <> n for m < A216261(n). - Reinhard Zumkeller, Mar 15 2013
If we mark with * resp. ' the graphical representations which use more resp. less segments, we have the following variants:
A063720 (6', 7', 9'), A277116 (6*, 7', 9'), A074458 (6*, 7*, 9'),
_____________ this: A006942 (6*, 7', 9*), A010371 (6*, 7*, 9*).
Sequences A234691, A234692 and variants make precise which segments are lit in each digit. These are related through the Hamming weight function A000120, e.g., A010371(n) = A000120(A234691(n)) = A000120(A234692(n)). - M. F. Hasler, Jun 17 2020

Examples

			As depicted below, zero uses 6 segments, so a(0)=6.
   _     _  _       _   _   _   _   _
  | | |  _| _| |_| |_  |_    | |_| |_|
  |_| | |_  _|   |  _| |_|   | |_|  _|
.
[Edited by _Jon E. Schoenfield_, Jul 30 2017]
		

References

  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 65.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A216261 (least inverse), A165244 (sorted digits), A302552 (primes), A328330 (iterations), A331529 (histogram).
Variants are A010371, A063720, A074458, A277116, see comments.
See also A234691, A234692, A000120.

Programs

  • Haskell
    a006942 n = a006942_list !! n
    a006942_list = [6,2,5,5,4,5,6,3,7,6] ++ f 10 where
       f x = (a006942 x' + a006942 d) : f (x + 1)
             where (x',d) = divMod x 10
    -- Reinhard Zumkeller, Mar 15 2013
    
  • Maple
    A006942 := proc(n) local d,dig,j,s: if(n=0)then return 6:fi: dig:=[6,2,5,5,4,5,6,3,7,6]: d:=convert(n,base,10): s:=0: for j from 1 to nops(d) do s:=s+dig[d[j]+1]: od: return s: end: seq(A006942(n),n=0..100); # Nathaniel Johnston, May 08 2011
  • Mathematica
    MapIndexed[ (f[First[#2] - 1] = #1)& , {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}]; a[n_] := Plus @@ f /@ IntegerDigits[n]; Table[a[n], {n, 0, 76}] (* Jean-François Alcover, Sep 25 2012 *)
    a[n_] := Plus @@ (IntegerDigits@ n /. {0 -> 6, 1 -> 2, 2 -> 5, 3 -> 5, 7 -> 3, 8 -> 7, 9 -> 6}); Array[a, 77, 0] (* Robert G. Wilson v, Jun 20 2018 *)
  • PARI
    a(n)=if(n==0, return(6)); my(d=digits(n),v=vector(10)); for(i=1,#d, v[d[i]+1]++); v*[6, 2, 5, 5, 4, 5, 6, 3, 7, 6]~ \\ Charles R Greathouse IV, Feb 05 2018
    
  • Python
    def a(n): return sum([6, 2, 5, 5, 4, 5, 6, 3, 7, 6][int(d)] for d in str(n))
    print([a(n) for n in range(77)]) # Michael S. Branicky, Jun 02 2021

Formula

a(n) = a(floor(n/10)) + a(n mod 10) for n > 9. - Reinhard Zumkeller, Mar 15 2013
a(n) = A010371(n) - A102679(n) + A102681(n) (subtract the number of digits 7 in n) = A277116(n) + A102683(n) (add number of digits 9 in n); and in particular, A063720(n) <= A277116(n) <= a(n) = A010371(n). - M. F. Hasler, Jun 17 2020

Extensions

More terms from Matthew Conroy, Sep 13 2001

A010371 Number of segments used to represent n on a 7-segment calculator display; version where '6', '7' and '9' use 6, 4 and 6 segments, respectively.

Original entry on oeis.org

6, 2, 5, 5, 4, 5, 6, 4, 7, 6, 8, 4, 7, 7, 6, 7, 8, 6, 9, 8, 11, 7, 10, 10, 9, 10, 11, 9, 12, 11, 11, 7, 10, 10, 9, 10, 11, 9, 12, 11, 10, 6, 9, 9, 8, 9, 10, 8, 11, 10, 11, 7, 10, 10, 9, 10, 11, 9, 12, 11, 12, 8, 11, 11, 10, 11, 12, 10, 13, 12, 10, 6, 9, 9, 8, 9, 10, 8, 11, 10, 13, 9, 12, 12
Offset: 0

Views

Author

Olivier.Gagneux(AT)roche.com

Keywords

Comments

Except for 1 and 3 every positive integer occurs; A143616 and A143617 give record values and where they occur. - Reinhard Zumkeller, Aug 27 2008
The difference between this sequence and A006942 lies in the representation chosen for the digit 7,
| | |
| (here), vs. | in A006942.
If we mark with ' the "sans serif" graphical representation which uses one segment less and with * the "heavier" version, we have the following variants:
A063720 (6', 7', 9'), A277116 (6*, 7', 9'), A074458 (6*, 7*, 9'),
___________________ A006942 (6*, 7', 9*), A010371 (6*, 7*, 9*) = this.
Sequences A234691, A234692 and variants make precise which segments are lit in each digit. They are related through the Hamming weight A000120, see formula. The sequence could be extended to negative arguments with a(-n) = a(n)+1. - M. F. Hasler, Jun 17 2020

Examples

			LCD Display (cf. Casio scientific calculator fx-3600P):
   _     _  _       _   _   _   _   _
  | | |  _| _| |_| |_  |_  | | |_| |_|
  |_| | |_  _|   |  _| |_|   | |_|  _|
		

Crossrefs

Segment variations: A006942, A063720, A074458, A277116.

Programs

  • Haskell
    a010371 n = a010371_list !! n
    a010371_list = [6,2,5,5,4,5,6,4,7,6] ++ f 10 where
       f x = (a010371 x' + a010371 d) : f (x + 1)
             where (x',d) = divMod x 10
    -- Reinhard Zumkeller, Mar 15 2013
    
  • Mathematica
    MapIndexed[(f[#2[[1]]-1] = #1)&, {6, 2, 5, 5, 4, 5, 6, 4, 7, 6}]; a[n_] := Total[f /@ IntegerDigits[n]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Mar 08 2017 *)
  • PARI
    apply( {A010371(n)=digits(6255456476)[n%10+1]+if(n>9, self()(n\10))}, [0..99]) \\ M. F. Hasler, Jun 17 2020

Formula

For n > 9, a(n) = a(floor(n/10)) + a(n mod 10). - Reinhard Zumkeller, Aug 27 2008
a(n) = A000120(A234691(n)) = A000120(A234692(n))
= A006942(n) + A102679(n) - A102681(n) (add number of digits 7)
= A074458(n) + A102683(n) (add number of digits 9). - M. F. Hasler, Jun 17 2020

Extensions

Corrected and extended by Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Dec 27 1999
Edited name, comments, cross-references. - M. F. Hasler, Jun 17 2020

A074458 Number of segments lit to display the number n on a 7-segment display (as in pocket calculators): variant where '6', '7' and '9' use 6, 4 resp. 5 segments.

Original entry on oeis.org

6, 2, 5, 5, 4, 5, 6, 4, 7, 5, 8, 4, 7, 7, 6, 7, 8, 6, 9, 7, 11, 7, 10, 10, 9, 10, 11, 9, 12, 10, 11, 7, 10, 10, 9, 10, 11, 9, 12, 10, 10, 6, 9, 9, 8, 9, 10, 8, 11, 9, 11, 7, 10, 10, 9, 10, 11, 9, 12, 10, 12, 8, 11, 11, 10, 11, 12, 10, 13, 11, 10, 6, 9, 9, 8, 9, 10, 8, 11
Offset: 0

Views

Author

Y. Kelly Itakura (yitkr(AT)mta.ca), Aug 22 2002

Keywords

Comments

Sequences A234691 and A234692 use one bit for each lit segment. See crossrefs for other variants. - M. F. Hasler, Jun 17 2020

Examples

			LED display:
   _       _   _       _   _   _   _   _
  | |   |  _|  _| |_| |_  |_  | | |_| |_|
  |_|   | |_   _|   |  _| |_|   | |_|   |
.
so we have a(0) = 6, a(1) = 2, a(2) = 5 ...
		

Crossrefs

Cf. A074459.
For other versions of this sequence, see A006942 (7 with one segment less), A063720 (6 and 7 with one segment less), A010371 (9 with one segment more), A277116 (7 with one segment less, 9 with one segment more).

Programs

  • PARI
    apply( {A074458(n)=digits(6255456475)[n%10+1]+if(n>9,self()(n\10))}, [0..99]) \\ M. F. Hasler, Jun 17 2020

Formula

From M. F. Hasler, Jun 17 2020: (Start)
a(n) = a(n mod 10) + a(floor(n/10)) for n > 9.
a(n) = A006942(n) - A102679(n) + A102681(n). (End)

Extensions

Example edited by Jon E. Schoenfield, Jul 30 2017
Edited and extended to n > 9 by M. F. Hasler, Jun 17 2020

A277116 Number of segments used to represent the number n on a 7-segment display: variant where digits 6, 7 and 9 use 6, 3 and 5 segments, respectively.

Original entry on oeis.org

6, 2, 5, 5, 4, 5, 6, 3, 7, 5, 8, 4, 7, 7, 6, 7, 8, 5, 9, 7, 11, 7, 10, 10, 9, 10, 11, 8, 12, 10, 11, 7, 10, 10, 9, 10, 11, 8, 12, 10, 10, 6, 9, 9, 8, 9, 10, 7, 11, 9, 11, 7, 10, 10, 9, 10, 11, 8, 12, 10, 12, 8, 11, 11, 10, 11, 12, 9, 13, 11, 9, 5, 8, 8, 7, 8, 9
Offset: 0

Views

Author

Eric Ginsburg, Sep 30 2016

Keywords

Comments

Another version of A006942. Here the digit "6" is represented with six segments (the same as in A006942) but the digit "9" is represented with five segments instead of six segments. - Omar E. Pol, Sep 30 2016
If we mark with * resp. ' the graphical representations which use one more resp. one less segment, we have the following variants:
A063720 (6', 7', 9'), A277116 (6*, 7', 9'), A074458 (6*, 7*, 9'),
___________________ A006942 (6*, 7', 9*), A010371 (6*, 7*, 9*).
Sequences A234691 and A234692 make precise which segments are lit in each digit. They are related through the Hamming weight function A000120, e.g., A010371(n) = A000120(A234691(n)) = A000120(A234692(n)). - M. F. Hasler, Jun 17 2020

Examples

			For n = 29, digit '2' uses 5 segments and digit '9' uses 5 segments. So, a(29) = 10. - _Indranil Ghosh_, Feb 02 2017
The digits are represented as follows:
   _     _  _       _   _   _   _   _
  | | |  _| _| |_| |_  |_    | |_| |_|
  |_| | |_  _|   |  _| |_|   | |_|   | . - _M. F. Hasler_, Jun 17 2020
		

Crossrefs

Segment variations: A006942, A010371, A063720, A074458.

Programs

  • Mathematica
    Table[Total[IntegerDigits[n] /. {0 -> 6, 1 -> 2, 2 -> 5, 3 -> 5, 6 -> 6, 7 -> 3, 8 -> 7, 9 -> 5}], {n, 0, 120}] (* Michael De Vlieger, Sep 30 2016 *)
  • PARI
    a(n) = my(segm=[6, 2, 5, 5, 4, 5, 6, 3, 7, 5], d=digits(n), s=0); if(n==0, s=6, for(k=1, #d, s=s+segm[d[k]+1])); s \\ Felix Fröhlich, Oct 05 2016
    
  • Python
    def A277116(n):
        s=0
        for i in str(n):
            s+=[6,2,5,5,4,5,6,3,7,5][int(i)]
        return s # Indranil Ghosh, Feb 02 2017

Formula

a(n) = A006942(n) - A102683(n). - Omar E. Pol, Sep 30 2016
a(n) = A063720(n) + A102677(n) - A102679(n) (add number of digits 6)
= A074458(n) - A102679(n) + A102681(n) (subtract number of digits 7)
and thus A063720(n) <= a(n) <= min(A074458(n), A006942(n)) <= A010371(n). - M. F. Hasler, Jun 17 2020

Extensions

Better definition and more terms from Omar E. Pol, Sep 30 2016
Edited by M. F. Hasler, Jun 17 2020

A234691 Decimal value of the bitmap of active segments in 7-segment display of the number n, variant 1: bits 0-6 refer to segments from top to bottom, left to right.

Original entry on oeis.org

119, 36, 93, 109, 46, 107, 123, 39, 127, 111, 4727, 4644, 4701, 4717, 4654, 4715, 4731, 4647, 4735, 4719, 12023, 11940, 11997, 12013, 11950, 12011, 12027, 11943, 12031, 12015, 14071, 13988, 14045, 14061, 13998, 14059, 14075, 13991, 14079, 14063, 6007, 5924, 5981, 5997
Offset: 0

Views

Author

M. F. Hasler, Dec 29 2013

Keywords

Comments

The bits 0-6 are assigned to the segments as follows: top (bit 0), upper left, upper right, middle, lower left, lower right, bottom (bit 6). Other conventions are common in engineering (as well for the segment-to-bit correspondence as for the glyphs), see sequence A234692 (the so-called ABCDEF coding), Wikipedia and the Example for a(7).
For n > 9, the decimal representation of n is encoded using a group of 7 bits for each digit, e.g., a(10) = a(1)*2^7 + a(0).
The sequence could have been extended differently to indices > 9, for example, by coding 7-segment representations of upper- and/or lowercase letters, as used for hexadecimal and base-64 representation.
The Hamming weight A000120 of the terms of this sequence yields the count of lit segments, A010371(n) = A000120(A234691(n)) = A000120(A234692(n)). For that sequence, 4 other variants are in the OEIS, depending on the number of segments used to represent digits 6, 7 and 9: A063720 (6', 7', 9'), A277116 (7', 9'), A074458 (9') and A006942 (7'), where x' means that the "sans serif" variant (one segment less than here) is used for digit x. - M. F. Hasler, Jun 17 2020

Examples

			The digits are assumed to be rendered as follows:
   _     _  _       _   _   _   _   _
  | | |  _| _| |_| |_  |_  | | |_| |_|
  |_| | |_  _|   |  _| |_|   | |_|  _|
For example, a(7) = 39 = 2^0 + 2^1 + 2^2 + 2^5, because the nonzero bits are
   _  : bit 0,
  | | : bits 1+2,
    | : bit 5,
while bits 3 (central '-'), 4 (lower left '|') and 6 (bottom '_') remain 0.
For the digit '7', the "sans serif" representation (without the upper left '|') is also very common; it would correspond to a(7) = 37. Similarly, digits 6 and 9 are sometimes represented without the top resp. bottom bar, see comments.
		

Crossrefs

Cf. A234692 for the "abcdefg" coding variant (clockwise from top and ending with bit 6 for the central "-").
Cf. A010371 (number of segments lit), and variants A063720, A277116, A074458: see comments.
Cf. A000120 (Hamming weight).

Programs

  • PARI
    /* Bitmaps computed from 7-character strings. Extended beyond 9 with characters most frequently used to code hexadecimal digits A-F, chessboard coordinates a-h, and other letters. Alternate glyphs used more or less frequently: sans serif " 6 6666", "7 7  7 ", "9999 9 "; "a aaaaa", B same as 8, "eeeee e", g same as 9, H same as X, "i   i i" or "     i ", "J J JJJ" or "J J  JJ", S same as 5, "TT  T  ", " YYY Y ". Note: Z below is the same as 2! */
    bitmaps = { apply( s2b = s->sum(i=1,#s=Vec(s), if(s[i]>" ",2^(i-1))), ["000 000", "  1  1 ", "2 222 2", "3 33 33", " 444 4 ", "55 5 55", "66 6666", "777  7 ", "8888888", "9999 99", "AAAAAA ", " b bbbb", "CC   CC", "  ddddd",
      "EE EEEE", "FF FF  ", "GG  GGG", " h hhh ", " I  I  ", "  J  JJ", "KK KKK ",
      " L  L L", "MMM MM ", "   nnn ", "   oooo", "PPPPP  ", "qqqq q ", "   rr  ", "   s ss", " t tt t", "    uuu", " VV VVV", " XXXXX ", " YYY YY", "Z ZZZ Z"])} \\ Extended to letters by M. F. Hasler, Jun 16 2020
    apply( {A234691(n)=bitmaps[n%10+1]+if(n>9,self()(n\10)<<7)}, [0..99]) \\ Extended to n > 9 by M. F. Hasler, Jun 17 2020

Formula

a(n) = a(n mod 10) + a(floor(n/10))*2^7 for n > 9. - M. F. Hasler, Jun 17 2020

Extensions

a(6) corrected thanks to Kevin Ryde, M. F. Hasler, Jun 16 2020
Edited and extended to n > 9 by M. F. Hasler, Jun 17 2020

A234692 Decimal value of the bitmap of active segments in 7-segment display of the number n, variant 2 ("abcdefg" scheme: bits represent segments in clockwise order).

Original entry on oeis.org

63, 6, 91, 79, 102, 109, 125, 39, 127, 111, 831, 774, 859, 847, 870, 877, 893, 807, 895, 879, 11711, 11654, 11739, 11727, 11750, 11757, 11773, 11687, 11775, 11759, 10175, 10118, 10203, 10191, 10214, 10221, 10237, 10151, 10239, 10223, 13119, 13062, 13147, 13135, 13158
Offset: 0

Views

Author

M. F. Hasler, Dec 29 2013

Keywords

Comments

The bits 0-6 are assigned to the segments according to the "abcdefg" scheme (top, upper right, lower right, bottom, lower left, upper left, center), cf. section "Displaying letters" of the Wikipedia page (3rd column of the table). Other conventions are common in engineering (as well for the segment-to-bit correspondence as for the glyphs), see sequence A234691, the Wikipedia page and the comment after the Example for a(7).
For n > 9, each of the digits of the base-10 representation is coded in a separate group of 7 bits, for example, a(10) = a(1)*2^7 + a(0) = 831.
Alternatively, for n >= 10 one could define a(n) to represent a 7-segment variant of the characters A-Z and/or a-z, as in hexadecimal or base-64 encoding. In that case, one could also use a few more bits for additional segments, e.g., four half-diagonals to represent K, M, N, R, V, X, Z correctly and S distinctly from 5. But as mentioned on the Wikipedia page, a possible ambiguity of representations of alphabetic characters is not always an obstacle to common use, since whole words are usually readable nonetheless.
The Hamming weight A000120 of the terms of this sequence yields the count of lit segments, A010371(n) = A000120(a(n)) = A000120(A234691(n)). For that sequence, 5 other variants are in the OEIS, depending on the number of segments used to represent digits 6, 7 and 9: A063720 (6', 7', 9'), A277116 (7', 9'), A074458 (9') and A006942 (7'), where x' means that the "sans serif" variant (one segment less than here) is used for digit x. - M. F. Hasler, Jun 17 2020

Examples

			a(7) = 39 = 2^0 + 2^1 + 2^2 + 2^5, because the digit 7 is represented as
" _ " : bit 0,
"| |" : bits 5+1,
"  |" : bit 2,
and no bit 3 (bottom "_") nor 4 (lower left "|") nor 6 (central "-").
Although other glyphs do exist as well for 6, 9, 0 and maybe other digits, "7" is probably the digit where an alternate representation (without the upper left "|") is as common as the one we chose here.
		

Crossrefs

Cf. A234691 for a variant where bits 0-6 represent, in this order, the segments: top, upper left, upper right, center, lower left, lower right, bottom.
Cf. A000120 (Hamming weight), A010371 and variants A063720, A277116, A074458 and A006942: see comments.

Programs

  • PARI
    bitmap=apply(s->sum(i=1,#s=Vec(s),if(s[i]>" ",2^(i-1))), ["000000"," 11", "22 22 2", "3333  3", " 44  44", "5 55 55", "6 66666", "777  7", "8888888", "9999 99", "AAA AAA", "  bbbbb", "C  CCC "," dddd d", "E  EEEE", "F   FFF"]) \\ Could be extended to more alphabetical glyphs, see A234691.
    apply( {A234692(n)=bitmap[n%10+1]+if(n>9,self()(n\10)<<7)}, [0..99]) \\ M. F. Hasler, Jun 17 2020

Formula

a(n) = a(n mod 10) + a(floor(n/10))*2^7. - M. F. Hasler, Jun 17 2020

Extensions

Extended with hex digits (AbCdEF) to n=15 by M. F. Hasler, Dec 30 2013
a(10) and a(11) corrected thanks to Kevin Ryde, M. F. Hasler, Jun 16 2020
Definition changed for consistency with A010371, etc. by M. F. Hasler, Jun 17 2020
Showing 1-10 of 21 results. Next