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-4 of 4 results.

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

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

A102678 Number of digits >= 6 in the decimal representations of all integers from 0 to n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 17, 18, 19, 20, 20, 20, 20, 20, 20, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 34, 36, 38, 39, 40, 41, 42, 43, 44, 46, 48
Offset: 0

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

The total number of digits >= 6 occurring in all the numbers 0, 1, 2, ... n (in decimal representation). - Hieronymus Fischer, Jun 10 2012

Crossrefs

Partial sums of A102677.
Cf. A000120, A000788, A023416, A059015 (for base 2).

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=6 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(add(p(i),i=0..n), n=0..86); # Emeric Deutsch, Feb 23 2005

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = (1/2)*Sum_{j=1..m+1} (floor(n/10^j + 2/5)*(2n + 2 - (1/5 + floor(n/10^j + 2/5))*10^j) - floor(n/10^j)*(2n + 2 - (1+floor(n/10^j)) * 10^j)), where m = floor(log_10(n)).
a(n) = (n+1)*A102677(n) + (1/2)*Sum_{j=1..m+1} ((-1/5*floor(n/10^j + 2/5) + floor(n/10^j))*10^j - (floor(n/10^j + 2/5)^2 - floor(n/10^j)^2)*10^j), where m = floor(log_10(n)).
a(10^m-1) = 4*m*10^(m-1).
(this is total number of digits >= 6 occurring in all the numbers with <= m places).
G.f.: g(x) = (1/(1-x)^2)*Sum_{j>=0} (x^(6*10^j) - x^(10*10^j))/(1 - x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005
An incorrect g.f. was deleted by N. J. A. Sloane, Sep 16 2009

A119281 Number of counting rods to represent n in the ancient Chinese rod numeral system.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 3, 4, 5, 6, 2, 3, 4, 5, 6, 7, 4, 5, 6, 7, 3, 4, 5, 6, 7, 8, 5, 6, 7, 8, 4, 5, 6, 7, 8, 9, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 4, 5, 6, 7, 3, 4, 5, 6, 7, 8, 5, 6, 7, 8, 4, 5, 6, 7, 8, 9, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 7, 8, 9, 10, 1, 2, 3
Offset: 0

Views

Author

Rick L. Shepherd, May 12 2006

Keywords

Comments

Contrast with A092196, the number of letters to represent n in ancient Roman numerals. Negative numbers were represented by the same number of rods but usually of a different color (usually black rods with red rods for positive numbers). It's unclear to me whether 0 itself was ever formally considered represented by the absence of all counting rods, but it does seem reasonable that a(0)=0 from the example below.

Examples

			a(105) = 6 because 105 was represented on a counting board by placing one counting rod in the compartment for hundreds, no rods where those representing tens were normally placed and five rods in the units compartment.
		

Crossrefs

Programs

  • PARI
    a(n)= tmp=abs(n); r=0; l=length(Str(tmp)); for(k=1,l, d=tmp-(tmp\10)*10; tmp=tmp\10; if(d<6, r=r+d, r=r+d-4)); r

Formula

a(n) = a(-n) = A007953(n) - 4*A102677(n) = A092196(n) + 4*(number of 5s in n).
Showing 1-4 of 4 results.