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 21-24 of 24 results.

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

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

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 21-24 of 24 results.