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.

A063720 Number of segments lit in a 7-segment display (as on a calculator) to represent the number n, variant 0: '6', '7' and '9' use 5, 3 and 5 segments, respectively.

Original entry on oeis.org

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

Views

Author

Deepan Majmudar (deepan.majmudar(AT)compaq.com), Aug 23 2001

Keywords

Comments

If we mark with * resp. ' the glyph variants (graphical representations) which use more resp. less segments, we have the following variants:
A063720 (this: 6', 7', 9'), A277116 (6*, 7', 9'), A074458 (6*, 7*, 9'), _________________________ 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

			The number 8 on a digital readout (e.g., on a calculator display) can be represented as
   -
  | |
   -
  | |
   -
which uses all 7 segments. Therefore a(8) = 7.
From _M. F. Hasler_, Jun 17 2020: (Start)
This sequence uses the following representations:
       _       _   _       _       _   _   _
      | |   |  _|  _| |_| |_  |_    | |_| |_|
      |_|   | |_   _|   |  _| |_|   | |_|   |
.
See crossrefs for other variants. (End)
		

Crossrefs

For variants see A006942, A010371, A074458, A277116 (cf. comments).
Other related sequences: A018846, A018847, A018849, A038136, A053701.

Programs

  • Haskell
    a063720 n = a063720_list !! n
    a063720_list = [6,2,5,5,4,5,5,3,7,5] ++ f 10 where
       f x = (a063720 x' + a063720 d) : f (x + 1)
             where (x',d) = divMod x 10
    -- Reinhard Zumkeller, Mar 15 2013
    
  • Mathematica
    a[n_ /; n <= 9] := a[n] = {6, 2, 5, 5, 4, 5, 5, 3, 7, 5}[[n+1]]; a[n_] := a[n] = a[Quotient[n, 10]] + a[Mod[n, 10]]; Table[a[n], {n, 0, 85}] (* Jean-François Alcover, Aug 12 2013, after Reinhard Zumkeller *)
    Table[Total[IntegerDigits[n]/.{0->6,1->2,2->5,3->5,6->5,7->3,8->7,9->5}],{n,0,90}] (* Harvey P. Dale, Mar 27 2021 *)
  • PARI
    apply( {A063720(n)=digits(6255455375)[n%10+1]+if(n>9, self()(n\10))}, [0..99]) \\ M. F. Hasler, Jun 17 2020

Formula

a(n) = a(floor(n/10)) + a(n mod 10) for n > 9. - Reinhard Zumkeller, Mar 15 2013
a(n) <= A277116(n) <= min{A006942(n), A074458(n)} <= A010371(n); differences between these are given, e.g., by A102677(n) - A102679(n) (= number of digits 7 in n). - M. F. Hasler, Jun 17 2020

Extensions

More terms from Matthew Conroy, Sep 13 2001
Definition clarified by M. F. Hasler, Jun 17 2020