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.

Previous Showing 11-20 of 21 results. Next

A216261 Smallest positive number using exactly n segments on a calculator display (when '6' and '7' are represented using 6 resp. 3 segments).

Original entry on oeis.org

1, 7, 4, 2, 0, 8, 10, 18, 22, 20, 28, 68, 88, 108, 188, 200, 208, 288, 688, 888, 1088, 1888, 2008, 2088, 2888, 6888, 8888, 10888, 18888, 20088, 20888, 28888, 68888, 88888, 108888, 188888, 200888, 208888, 288888, 688888, 888888, 1088888, 1888888, 2008888, 2088888, 2888888
Offset: 2

Views

Author

Reinhard Zumkeller, Mar 15 2013

Keywords

Comments

Essentially the same as A038619 and A143617. One could argue that a(3) should rather be -1 (prior to adding "positive" in the definition), which does use 3 segments on typical 7-segment displays, and is smaller than 7. Also, most pocket calculators and the Unicode standard (cf. links) use 4 rather than 3 segments to represent a '7' (as in A074458 and A010371, rather than A063720, A277116 or A006942), in which case a(3) is undefined if negative numbers are not allowed. No digit '9' will ever occur here, whether it would be represented with 6 or only 5 segments. However, digit '6' does occur, as the second smallest digit using 6 segments as does '0', which cannot occur as leading digit. If '6' is represented with 5 segments, any prefix 68 would be replaced with 80. - M. F. Hasler and Kevin Ryde, Jun 17 2020

Crossrefs

Cf. A038619 and A143617 (identical up to initial terms).

Programs

  • Haskell
    import Data.Maybe (fromJust)
    import Data.List (elemIndex)
    a216261 = fromJust . (`elemIndex` a006942_list)
    -- Reinhard Zumkeller, Mar 15 2013
    
  • Mathematica
    Drop[#, 2] &@ CoefficientList[Series[(x^2 + 6 x^3 - 3 x^4 - 2 x^5 - 2 x^6 + 8 x^7 + 2 x^8 - 2 x^9 - 56 x^10 + 28 x^11 + 28 x^12 + 60 x^13 - 60 x^14 - 28 x^17 + 28 x^18)/((1 - x) (1 - 10 x^7)), {x, 0, 50}], x] (* Michael De Vlieger, Jan 29 2016 *)
  • PARI
    Vec((x^2 +6*x^3 -3*x^4 -2*x^5 -2*x^6 +8*x^7 +2*x^8 -2*x^9 -56*x^10 +28*x^11 +28*x^12 +60*x^13 -60*x^14 -28*x^17 +28*x^18)/((1-x)*(1-10*x^7)) + O(x^50)) \\ Michel Marcus, Jan 29 2016

Formula

A006942(a(n)) = n and A006942(m) <> n for m < a(n).
a(n+7) = 10*a(n) + 8 for n > 10. This can be deduced from a(n) = min{10*a(n-A006942(r))+r, r=0..9} via strong induction. - David Radcliffe, Jan 29 2016
G.f.: (x^2 +6*x^3 -3*x^4 -2*x^5 -2*x^6 +8*x^7 +2*x^8 -2*x^9 -56*x^10 +28*x^11 +28*x^12 +60*x^13 -60*x^14 -28*x^17 +28*x^18)/((1-x)*(1-10*x^7)). - David Radcliffe, Jan 29 2016

Extensions

Name and cross-references edited by M. F. Hasler, Jun 17 2020

A357972 a(n) is the number of segments used to represent the time of n minutes past midnight in the format hh:mm on a 7-segment calculator display; version where the digits '6', '7' and '9' use 5, 3 and 5 segments, respectively.

Original entry on oeis.org

24, 20, 23, 23, 22, 23, 23, 21, 25, 23, 20, 16, 19, 19, 18, 19, 19, 17, 21, 19, 23, 19, 22, 22, 21, 22, 22, 20, 24, 22, 23, 19, 22, 22, 21, 22, 22, 20, 24, 22, 22, 18, 21, 21, 20, 21, 21, 19, 23, 21, 23, 19, 22, 22, 21, 22, 22, 20, 24, 22, 20, 16, 19, 19, 18, 19, 19
Offset: 0

Views

Author

Stefano Spezia, Oct 22 2022

Keywords

Comments

The sequence is periodic of period 1440 since the term a(1440) = a(0) = 24 corresponds to the time 00:00.

Crossrefs

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]]); Join[{24},Array[a,66]]

Formula

a(n) = A063720(A055643(n)) + 6*(4 - ceiling(log10(A055643(n) + 1))) for n > 0.
a(n) <= 26.

A038619 Smallest positive number that needs more lines when shown on a 7-segment display (digital clock) than any previous term.

Original entry on oeis.org

1, 2, 6, 8, 10, 18, 20, 28, 68, 88, 108, 188, 200, 208, 288, 688, 888, 1088, 1888, 2008, 2088, 2888, 6888, 8888, 10888, 18888, 20088, 20888, 28888, 68888, 88888, 108888, 188888, 200888, 208888, 288888, 688888, 888888, 1088888, 1888888, 2008888, 2088888, 2888888, 6888888, 8888888
Offset: 1

Views

Author

Keywords

Comments

For n > 1, a(n) uses n + 3 segments to be displayed, when a digit '6' uses 6 segments (as in A234691, A234692 and A277116, A074458, A006942, A010371, but not in A063720). Sequence A143617 is the same but starts with 0, 8, ... and A216261 has additional terms 7 & 4 before 2 and 22 before 20. - M. F. Hasler, Jun 23 2020

Examples

			Digits 0, 1, 2, ..., 9 use 6, 2, 5, 5, 4, 5, 6, 3, 7, 6 lines / segments.
		

Crossrefs

Programs

  • Mathematica
    Block[{f, s}, MapIndexed[(f[#2[[1]] - 1] = #1) &, {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}]; s = Array[Total[f /@ IntegerDigits[#]] &, 10^7]; Map[FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]]] (* or *)
    Nest[Append[#1, If[#2 > 13, 10 #1[[-7]] + 8, 10 #1[[-6]] + Boole[#2 != 13] 8]] & @@ {#, Length@ # + 1} &, {1, 2, 6, 8, 10, 18, 20}, 36] (* Michael De Vlieger, Jun 23 2020 *)
    LinearRecurrence[{1,0,0,0,0,0,10,-10},{1,2,6,8,10,18,20,28,68,88,108,188,200,208},50] (* Harvey P. Dale, Aug 11 2025 *)
  • PARI
    apply( {A038619(n)=if(n>7, self()(n-6-(n>13))*10+(n!=13)*8, [1,2,6, 8,10,18,20][n])}, [1..33]) \\ M. F. Hasler, Jun 23 2020

Formula

For n >= 3, the terms with n digits are given by: 108*A + B, 188*A + B, 200*A + B, 208*A + B, 288*A + B, 688*A + B, 888*A + B where A = 10^(n-3), B = 8*(A - 1)/9.
From M. F. Hasler, Jun 23 2020: (Start)
a(n) = 10*a(n-7) + 8 for n > 13 (and with a(n-6) for 7 < n < 13).
G.f.: (1 + x + 4*x^2 + 2*x^3 + 2*x^4 + 8*x^5 + 2*x^6 - 2*x^7 + 30*x^8 - 20*x^9 + 60*x^11 - 68*x^12 - 12*x^13)/((1 - x)*(1 - x^10)).
(End)
a(n) = a(n-1) + 10*a(n-7) - 10*a(n-8), for n >= 15. - Wesley Ivan Hurt, Jun 29 2020

Extensions

Edited and offset corrected to 1 by M. F. Hasler, Jun 23 2020
More terms from Michael De Vlieger, Jun 23 2020
More terms from M. F. Hasler, Jun 23 2020

A074459 Number of segments which change from display of a number n to the next number n+1 on a 7-segment display: version where '6', '7', '9' use 6, 4, resp. 5 segments.

Original entry on oeis.org

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

Views

Author

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

Keywords

Comments

The glyph variants used here are the same as in A074458 (other variants are described in A006942, A010371, A063720 and A277116). - M. F. Hasler, Jun 17 2020

Examples

			Consider the representations of digits '0', '1' and '2' given below.
To change from 0 to 1, we need to delete 4 segments, from 1 to 2, we need to delete 1 segment and add 4 segments, so 5 segments in total are needed to be changed.
From _M. F. Hasler_, Jun 23 2020: (Start)
We consider the following 7-segment representations of the digits 0 - 9:
   _       _   _       _   _   _   _   _
  | |   |  _|  _| |_| |_  |_  | | |_| |_|
  |_|   | |_   _|   |  _| |_|   | |_|   | .
To switch from displaying number 9 to displaying number 10, one has to activate 2 segments for the additional digit '1', and change 3 segments from the representation of '9' to get that of '0', whence a(9) = 2 + 3 = 5.
To switch from 19 to 20 one has a(19) = a(1) + 3 = 8. (End)
		

Crossrefs

Cf. A074458.

Programs

  • PARI
    apply( {A074459(n)=if(n%10<9,digits(452331432)[n%10+1],n>9,3+self()(n\10),5)}, [0..99]) \\ M. F. Hasler, Jun 23 2020

Formula

For n % 10 < 9, a(n) = a(n % 9), where % is the modulo (remainder) operator. - M. F. Hasler, Jun 23 2020

Extensions

Edited and terms for n > 8 added by M. F. Hasler, Jun 23 2020

A350131 Number of segments lit to display the number n on a 9-segment display used by the Russian postal service.

Original entry on oeis.org

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

Views

Author

Bartlomiej Malarz, Dec 16 2021

Keywords

Examples

			The Russian postal service uses a special template for entering postal codes, which makes automatic sorting of their parcels faster. It has nine segments, and digits looks like this (please check the first link in the Links section for a more readable, graphical example):
._       _   _         _        _   _    _
| |  /|   |  /_  |_|  |_   /_   /  |_|  |_|
|_|   |  /_   /    |   _|  |_|  |  |_|   /
The template for a single digit contains nine segments: four vertical, three horizontal and two diagonal:
Vertical      Horizontal      Diagonal
                   _
   | |             _              /
   | |             _              /
Using a combination of vertical, horizontal and/or diagonal segments, it is possible to create digits:
.
                  number of segments
         =====================================
  digit  total  vertical  horizontal  diagonal
  -----  -----  --------  ----------  --------
    0      6        4          2          0
    1      3        2          0          1
    2      4        1          2          1
    3      4        0          2          2
    4      4        3          1          0
    5      5        2          3          0
    6      5        2          2          1
    7      3        1          1          1
    8      7        4          3          0
    9      5        2          2          1
		

Crossrefs

Cf. A350177 (histogram).

Programs

  • Mathematica
    Table[Total[IntegerDigits[n]/.{0->6, 1->3, 2->4, 3->4, 6->5, 7->3, 8->7, 9->5}], {n, 0, 79}] (* Stefano Spezia, Dec 17 2021 *)
  • PHP
     $segments[$n], str_split($i)));
        echo $usedSegments . "\n";
    } // Simplified by Bartlomiej Malarz, Oct 30 2024
    
  • Python
    segments = [6, 3, 4, 4, 4, 5, 5, 3, 7, 5]
    def a(n): return sum(segments[int(d)] for d in str(n))
    print([a(n) for n in range(80)]) # Michael S. Branicky, Dec 22 2021

A123587 Number of bars that must change on a standard digital clock when the minutes change from n-1 to n.

Original entry on oeis.org

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

Views

Author

Danny Rorabaugh, Nov 13 2006

Keywords

Comments

Cyclic with period 60.

Examples

			a(20)=7 because when the clock changes from 19 to 20 minutes, 1 bar turns off and 4 bars turn on in the tens digit for the "0" to become a "1" and 1 bar turns off and 1 turns on in the units digit for the "9" to become a "0". 1 + 4 + 1 + 1 = 7.
		

Crossrefs

A337099 Largest positive number using exactly n segments on a calculator display (when '6' and '7' are represented using 6 resp. 3 segments).

Original entry on oeis.org

1, 7, 11, 71, 111, 711, 1111, 7111, 11111, 71111, 111111, 711111, 1111111, 7111111, 11111111, 71111111, 111111111, 711111111, 1111111111, 7111111111, 11111111111, 71111111111, 111111111111, 711111111111, 1111111111111, 7111111111111, 11111111111111, 71111111111111
Offset: 2

Views

Author

Suren Suren, Sep 29 2020

Keywords

Comments

The sequence begins with a(2) = 1 since at least two segments are needed to form any digit. It requires two segments to form the digit 1 and three segments to form the digit 7.
All other digits use more than 3 segments.

Crossrefs

Cf. A063720 (number of segments), A216261 (smallest number), A249572.

Programs

  • Mathematica
    CoefficientList[Series[(1 + 6*x - 6*x^2)/(1 - x - 10*x^2 + 10*x^3), {x, 0, 30}], x] (* Wesley Ivan Hurt, Nov 07 2020 *)

Formula

a(n+2) = 10*a(n) + 1 for n >= 2.
a(2*n) = (10^n - 1)/9 ; a(2*n + 1) = ((10^n - 1)/9) + 6*10^(n - 1).
From Stefano Spezia, Sep 29 2020: (Start)
G.f.: x^2*(1 + 6*x - 6*x^2)/(1 - x - 10*x^2 + 10*x^3).
a(n) = a(n-1) + 10*a(n-2) - 10*a(n-3) for n > 4. (End)

Extensions

More terms from Stefano Spezia, Sep 29 2020

A338111 Times displayed on an hour|minute 12-hour 7-segment digital clock, arranged in order of increasing brightness (see Comments).

Original entry on oeis.org

111, 117, 711, 114, 141, 411, 717, 1111, 112, 113, 115, 121, 131, 147, 151, 211, 311, 417, 511, 714, 741, 1117, 101, 110, 116, 119, 127, 137, 144, 157, 217, 317, 414, 441, 517, 611, 712, 713, 715, 721, 731, 747, 751, 911, 1114, 1141, 107, 118, 124, 134, 142
Offset: 1

Views

Author

Harvey P. Dale, Oct 10 2020

Keywords

Comments

Consider a 12-hour digital clock with 4 digits, each of which comprises 7 facets (or segments or lights). The terms of the sequence list the times of day starting with the dimmest overall display, i.e., when the fewest total facets are lit up, to the brightest overall display, i.e., when the most total facets are lit up.The terms are sorted by dimness/brightness and then by smallest-to-largest number.
If the digits are labeled A, B, C, D from left to right, digit A is completely dark from 1:00 until after 9:59, and then has 2 facets lit up from 10:00 through 12:59. Digits B and D will each display numbers from 0 to 9 and thus will have between 2 and 7 facets lit up. Digit C will display numbers from 0 to 5 and thus will have between 2 and 6 facets lit up.
The sequence displays each time of day without the customary colon separating hours from minutes, so for example 12:36 is displayed as 1236 and 9:14 is displayed as 914.
The dimmest display is for 1:11 (or 111) when 6 facets in total are lit up. The brightest display is for 10:08 (or 1008) when 21 facets are lit up. The sequence has 720 terms altogether.

Examples

			111 is displayed with digit A dark and with 2 facets of each of digits B, C, and D lit up. Thus 111 has a total of 6 facets lit up. 1008 is displayed with 2 facets of digit A lit up, with 6 facets of digits B and C lit up, and with 7 facets of digit D lit up. Thus 1008 has a total of 21 facets lit up.
		

Crossrefs

Programs

  • Mathematica
    SortBy[{#,Total[IntegerDigits[#]/.{0->6,1->2,2->5,3->5,7->3,8->7,9->6}]}&/@ FromDigits/@Flatten[Table[Join[IntegerDigits[ h],PadLeft[ IntegerDigits[ m],2,0]],{h,12},{m,0,59}],1],{Last,First}][[All,1]]

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

Original entry on oeis.org

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

Views

Author

Marco RipĂ , Aug 16 2025

Keywords

Comments

A074458 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 + 2) for any k >= 3.

Examples

			For n = 10, the a(10) = 3 steps are 10 -> 8 -> 7 -> 4 segments, and 4 is a fixed point A074458(4) = 4.
		

Crossrefs

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

A309721 Number of right angles between the segments that are turned "on" when representing n on a 7-segment (calculator) display.

Original entry on oeis.org

4, 0, 4, 4, 3, 4, 6, 1, 8, 6, 4, 0, 4, 4, 3, 4, 6, 1, 8, 6, 8, 4, 8, 8, 7, 8, 10, 5, 12, 10, 8, 4, 8, 8, 7, 8, 10, 5, 12, 10, 7, 3, 7, 7, 6, 7, 9, 4, 11, 9, 8, 4, 8, 8, 7, 8, 10, 5, 12, 10, 10, 6, 10, 10, 9, 10, 12, 7, 14, 12, 5, 1, 5, 5, 4, 5, 7, 2, 9, 7, 12, 8, 12, 12, 11, 12, 14, 9, 16, 14, 10, 6, 10, 10, 9, 10, 12, 7
Offset: 0

Views

Author

Ivan N. Ianakiev, Aug 14 2019

Keywords

Comments

The display is the one described in A006942 (see also the example section below).

Examples

			To illustrate a(0),...,a(9):
   _     _  _       _   _   _   _   _
  | | |  _| _| |_| |_  |_    | |_| |_|
  |_| | |_  _|   |  _| |_|   | |_|  _|
.
		

Crossrefs

Programs

  • Mathematica
    Evaluate[Table[a[n],{n,0,9}]]={4,0,4,4,3,4,6,1,8,6};
    a[n_/;n>9]:=a[Floor[n/10]]+a[Mod[n,10]]; a/@Range[0,100] (* or *)
    Table[Total[IntegerDigits[n]/.{0->4,1->0,2->4,3->4,4-> 3,5->4,7->1,9->6}],{n,0,100}]

Formula

a(n) = a(floor(n/10)) + a(n mod 10), for n > 9 (a formula by Reinhard Zumkeller, same for A006942 and A010371).
Previous Showing 11-20 of 21 results. Next