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 30 results. Next

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

Original entry on oeis.org

0, 0, 1, 1, 2, 5, 7, 12, 19, 33, 59, 99, 170, 290, 496, 854, 1463, 2506, 4292, 7351, 12601, 21596, 37005, 63405, 108637, 186154, 318989, 546600, 936606, 1604874, 2749973, 4712146, 8074374, 13835600, 23707533, 40623267, 69608738, 119275933, 204381606, 350211711, 600094277
Offset: 0

Views

Author

Stefano Spezia, Jan 19 2020

Keywords

Comments

The nonnegative integers are displayed as in A006942, where a 7 is depicted by 3 segments.
Given the set S = {2, 3, 4, 5, 6, 7}, the function f defined in S as f(5) = f(6) = 3 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 first formula).
The same sequence is obtained when 7 and 9 are depicted respectively by 4 and 5 segments (A074458). - Stefano Spezia, Apr 11 2021

Examples

			a(5) = 5 since 2, 3, 5, 17 and 71 are displayed by 5 segments.
   __      __       __         __      __
   __|     __|     |__       |   |       |  |
  |__      __|      __|      |   |       |  |
   (2)     (3)      (5)       (17)       (71)
		

Crossrefs

Programs

  • Mathematica
    P[x_]:=x^2+x^3+x^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)^2*(1 - x + x^2)*(1 + x + x^2)*(1 + x^2 + 2*x^3 + x^4) / (1 - x^2 - x^3 - 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 + x^3 + 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)^2*(1 - x + x^2)*(1 + x + x^2)*(1 + x^2 + 2*x^3 + x^4) / (1 - x^2 - x^3 - x^4 - 3*x^5 - 3*x^6 - x^7).
a(n) = a(n-2) + a(n-3) + a(n-4) + 3*a(n-5) + 3*a(n-6) + a(n-7) for n>13.
(End)

A357996 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 A006942).

Original entry on oeis.org

1, 2, 4, 14, 25, 37, 70, 105, 123, 153, 186, 182, 156, 139, 119, 79, 35, 9, 1
Offset: 8

Views

Author

Stefano Spezia, Oct 23 2022

Keywords

Comments

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

Crossrefs

Histogram of A357970.

Programs

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

A172439 Fibonacci sequence rewritten using A006942.

Original entry on oeis.org

6, 2, 2, 5, 5, 5, 7, 25, 52, 54, 55, 76, 244, 555, 533, 626, 673, 2563, 5574, 4272, 6365, 26646, 23322, 57653, 46567, 35655, 252565, 266427, 523722, 524556, 755646, 2546566, 5237566, 5554537, 5365773, 6553465, 24656555, 54253723, 56677266
Offset: 0

Views

Author

Parthasarathy Nambi, Feb 02 2010

Keywords

Comments

For Fibonacci numbers containing two or more digits, just concatenate the digits.
Digit 0 ==> 6;1 ==> 2;2 ==> 5;3 ==> 5;4 ==> 4;5 ==> 5;6 ==> 6;7 ==> 3;8 ==> 7;9 ==> 6.

Examples

			4181 is a Fibonacci number and using A006942 this is 4272.
		

Crossrefs

Cf. A000045.

Programs

  • Maple
    A172439 := proc(n) if n = 0 then 6; else F := convert(combinat[fibonacci](n),base,10) ; dgs := [] ; for i from 1 to nops(F) do dgs := [op(dgs),op(1+op(i,F),[ 6, 2, 5, 5, 4, 5, 6, 3, 7, 6])] ; end do ; add( op(i,dgs)*10^(i-1),i=1..nops(dgs)) ; end if; end proc: seq(A172439(n),n=0..40) ; # R. J. Mathar, Feb 08 2010
  • Mathematica
    FromDigits[IntegerDigits[#]/.{0->6,1->2,2->5,3->5,7->3,8->7,9->6}]&/@ Fibonacci[ Range[0,40]] (* Harvey P. Dale, Aug 31 2020 *)
  • PARI
    my(A006942=[6,2,5,5,4,5,6,3,7,6]); a(n) = if(n==0,6, fromdigits(apply(d->A006942[d+1], digits(fibonacci(n))))); \\ Kevin Ryde, Sep 01 2020

Extensions

More terms from R. J. Mathar, Feb 08 2010

A374908 Each term is the sum of the preceding term and its seven-segment total A006942.

Original entry on oeis.org

0, 6, 12, 19, 27, 35, 45, 54, 63, 74, 81, 90, 102, 115, 124, 135, 147, 156, 169, 183, 197, 208, 226, 242, 256, 272, 285, 302, 318, 332, 347, 359, 375, 388, 407, 420, 435, 449, 463, 478, 492, 507, 521, 533, 548, 564, 579, 593, 609, 627, 641, 653, 669, 687, 703
Offset: 0

Views

Author

David J. Ellis, Jul 23 2024

Keywords

Comments

The number of segments in each digit 0 to 9 is [6,2,5,5,4,5,6,3,7,6].
Conjecture: Taking the least significant digit of each term is not an eventually periodic sequence.

Examples

			For n=1, the preceding a(0) = 0 is 6 segments so that a(1) = 0 + 6 = 6.
		

Crossrefs

Programs

  • Mathematica
    s={0};Do[AppendTo[s,Last[s]+ Plus @@ (IntegerDigits@ Last[s] /. {0 -> 6, 1 -> 2, 2 -> 5, 3 -> 5, 7 -> 3, 8 -> 7, 9 -> 6})],{n,54}];s (* James C. McMahon, Aug 19 2024 *)
  • Python
    from itertools import islice
    def b(n): return sum([6, 2, 5, 5, 4, 5, 6, 3, 7, 6][int(d)] for d in str(n))
    def agen(): # generator of terms
        yield (an:=0)
        while True: yield (an:=an+b(an))
    print(list(islice(agen(), 55))) # Michael S. Branicky, Jul 28 2024

Formula

a(n) = a(n-1) + A006942(a(n-1)).

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

Original entry on oeis.org

0, 0, 1, 2, 3, 7, 12, 18, 31, 52, 92, 158, 269, 460, 786, 1350, 2317, 3969, 6798, 11643, 19952, 34197, 58601, 100410, 172042, 294791, 505143, 865589, 1483206, 2541480, 4354847, 7462119, 12786520, 21909974, 37543133, 64330800, 110232005, 188884671, 323657539, 554593317
Offset: 0

Views

Author

Stefano Spezia, Dec 31 2021

Keywords

Comments

The integers are displayed as in A006942, where a 7 is depicted by 3 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 A331529(7) + A331529(6) = 12 + 7 = 19, i.e., a(7) = 19 - 1 = 18.
The same sequence is obtained when 7 and 9 are depicted respectively by 4 and 5 segments (A074458).

Examples

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

Crossrefs

Programs

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

Formula

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

A383739 Smallest number that, when displayed on a 7-segment display using A006942, leaves exactly n segments unused.

Original entry on oeis.org

8, 0, 2, 4, 7, 1, 10, 12, 14, 17, 11, 101, 112, 114, 117, 111, 1011, 1112, 1114, 1117, 1111, 10111, 11112, 11114, 11117, 11111, 101111, 111112, 111114, 111117, 111111, 1011111, 1111112, 1111114, 1111117, 1111111, 10111111, 11111112, 11111114, 11111117, 11111111, 101111111
Offset: 0

Views

Author

Renaud Gaudron, May 12 2025

Keywords

Comments

6, 7, and 9 each have two possible representations on a 7-segment display. Therefore, a number that contains at least one of each digit can be displayed in 8 different ways. We use 'variant 5' because it was the first one added to the OEIS (A006942).
This sequence is interesting because a(n) is guaranteed to exist for n>=1. For instance, printing a '6' will always result in 1 unused segment. If we want to get a number that returns m unused segments, then we can always return '66...66' with '6' appearing m times. This also provides an upper bound for the value of a(n). Despite this, the value of a(n) for a given n is nontrivial.
This sequence does not increase monotonically.
Certain digits can never appear in the sequence for n>=1:
- 8: This digit contributes 0 unused segments. If a solution contains an 8 and has more than one digit, the 8 can be removed entirely without reducing the number of unused segments, resulting in a smaller number. The only exception is when the number is a single digit, so for a(0).
- 3 and 5: Both use the same number of segments as 2. So, if a solution includes a 3 or 5, we can replace it with a 2 without changing the number of unused segments, but the overall number would be smaller.
- 9: Same as above: any 9 can be replaced by a 6. We can't extend this to 0 (same number of segments as 6 or 9), because we can't always swap a 6 or a 9 for a 0 (e.g. '600').
Among all 10 digits, 1 has the largest number of unused segments (5). As a consequence, when n = 5*p (with p>=1), a(n) = '1..1' with 1 appearing p times because if a(n) contained any other digit, it would be more than p digits long, and would thus not be optimal.
The next term a(5*p+1) necessarily has an additional digit. The smallest digit that adds only 1 unused segment is 0 but it cannot be placed in the leading position. The next best position is the second one, thus a(5*p+1) = '10...1' with p 1s and a single 0.
To construct the next term a(5*p+2), we swap the existing zero for another digit with an additional unused segment (2 being optimal as it is the smallest) and move it to the trailing position (to yield the smallest possible number). Hence a(5*p+2) = '1..12' with p 1s and a single 2. Any other approach, such as adding an extra 0 or swapping a 1 for something else, would result in a solution with more than p+1 digits and would thus not be optimal.
The next two terms can be constructed the same way, yielding a(5*p+3) = '1..14' and a(5*p+4) = '1..17' with again p+1 digits in total. We then loop back to the beginning with a(5*p+5).

Examples

			a(1) is the smallest number with exactly 1 unused segment. The digit 0 uses 6 segments, leaving 1 unused, and since 0 is the smallest valid number, we have a(1) = 0.
For a(6), we seek the smallest number with exactly 6 unused segments. No single-digit number meets this, as each digit leaves at most 5 segments unused. Among two-digit numbers, 10 is the smallest: '1' contributes 5 unused segments and '0' contributes 1, totaling 6. Therefore, a(6) = 10.
		

Crossrefs

Programs

  • Python
    def a(n):
        q, r = divmod(n, 5)
        if q == 0:
            return [8, 0, 2, 4, 7][r]
        if r == 0:
            return 10**q//9
        if r == 1:
            return 91*10**(q-1)//9
        return 10**(q+1)//9 + [1, 3, 6][r - 2]

Formula

For p>=1:
a(5*p) = (10^p-1)/9
a(5*p+1) = (91*10^(p-1)-1)/9
a(5*p+2) = (10^(p+1)-1)/9 + 1
a(5*p+3) = (10^(p+1)-1)/9 + 3
a(5*p+4) = (10^(p+1)-1)/9 + 6

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

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

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
Showing 1-10 of 30 results. Next