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 20 results.

A357973 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 6, 4 and 5 segments, respectively.

Original entry on oeis.org

24, 20, 23, 23, 22, 23, 24, 22, 25, 23, 20, 16, 19, 19, 18, 19, 20, 18, 21, 19, 23, 19, 22, 22, 21, 22, 23, 21, 24, 22, 23, 19, 22, 22, 21, 22, 23, 21, 24, 22, 22, 18, 21, 21, 20, 21, 22, 20, 23, 21, 23, 19, 22, 22, 21, 22, 23, 21, 24, 22, 20, 16, 19, 19, 18, 19, 20
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]]; a074458[n_] := Plus @@ (IntegerDigits@ n /. {0 -> 6, 1 -> 2, 2 -> 5, 3 -> 5, 7 -> 4, 8 -> 7, 9 -> 5}); a[n_]:=a074458[a055643[n]]+6(4-Ceiling[Log10[a055643[n]+1]]); Join[{24},Array[a,66]]

Formula

a(n) = A074458(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

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

A165244 The numbers commonly displayed with 7 segments in electric clocks, in ascending order of number of segments lit.

Original entry on oeis.org

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

Views

Author

Kurt Eisemann (keiseman(AT)mail.sdsu.edu), Sep 09 2009

Keywords

Crossrefs

A249919 Number of LCD (liquid-crystal display) segments needed to display n in binary.

Original entry on oeis.org

6, 2, 8, 4, 14, 10, 10, 6, 20, 16, 16, 12, 16, 12, 12, 8, 26, 22, 22, 18, 22, 18, 18, 14, 22, 18, 18, 14, 18, 14, 14, 10, 32, 28, 28, 24, 28, 24, 24, 20, 28, 24, 24, 20, 24, 20, 20, 16, 28, 24, 24, 20, 24, 20, 20, 16, 24, 20, 20, 16, 20, 16, 16, 12, 38, 34, 34, 30, 34, 30, 30, 26, 34, 30, 30, 26, 30, 26, 26
Offset: 0

Views

Author

Keywords

Comments

The "LCD" refers to how 0 and 1 are displayed, such that zero is represented with 6 lines, and one is represented with 2 lines:
_
| | |
|_| and |

Examples

			For n = 4, 4 = 100_2. So, a(4) = 2 + 6 + 6 = 14. - _Indranil Ghosh_, Feb 02 2017
		

Crossrefs

Programs

  • C
    // Input: n (no negative offset/term number), Output: a(n)
    int A249919 (int n) {
       int m=0, r=0;
       if (n) {
          while (n!=1) {
             m=n&1; //equivalent to m=n%2;
             n=n>>1; //equivalent to n/=2;
             if (m) {
                r+=2;
             } else {
                r+=6;
             }
          }
          r+=2;
       } else {
          r+=6;
       }
       return r;
    }
    // Arlu Genesis A. Padilla, Jun 18 2015
    
  • Mathematica
    f[n_] := Total[{2, 6}*(Count[ IntegerDigits[n, 2], #] & /@ {1, 0})]; Array[f, 79, 0] (* Robert G. Wilson v, Jul 26 2015 *)
  • PARI
    a(n)=if(n==0, 6, 6*#binary(n) - 4*hammingweight(n)); \\ Charles R Greathouse IV, Feb 28 2015
    
  • Python
    def A249919(n):
        x=bin(n)[2:]
        s=0
        for i in x:
            s+=[6,2][int(i)]
        return s # Indranil Ghosh, Feb 02 2017

Formula

The formulas below do not include a(0)=6:
a(2^(n-1)) = 2 + 6(n-1).
a((2^n)-1) = 2n.
a(x) = a(2^(n+1) + (2^n)-1) = a(2^(n+2)-1) + 4.
a(y) = a(2^(n+1) + (2^n)) = a(2^(n+1)) - 4.
a(x - u) + 6 = a(x - u + 2^(n+1)).
a(y + u) + 6 = a(y + u + 2^(n+1)).
a(2^(n+1)) + a(2^(n+2)-1) = a(x - u) + a(y + u).
where n=1, 2, ...
and u=0, ..., (2^n)-2.
a(n) = A010371(A007088(n)). - Michel Marcus, Aug 01 2015

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]]

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.

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

Original entry on oeis.org

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

Views

Author

Marco Ripà, Aug 21 2025

Keywords

Comments

A277116 a strictly decreasing function A277116(x) < x whenever x >= 10 and all single digit x reach a fixed point A277116(x) = x with x in {4, 5, 6}.
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 = 10, the a(10) = 3 steps are 10 -> 8 -> 7 -> 3 -> 5 segments, and 5 is a fixed point A074458(5) = 5.
		

Crossrefs

Previous Showing 11-20 of 20 results.