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.

A328330 Let f(n) be the number of segments shown on a digital calculator to display n. Then a(n) is the number of terms in the sequence formed by iteration n -> f(n) until n = f(n).

Original entry on oeis.org

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

Views

Author

Karl Aughton, Oct 12 2019

Keywords

Comments

Type n on a calculator and count the segments on a calculator display that forms the number. Iterate until you reach a fixed point: 4, 5 or 6. a(n) is the length of the chain.

Examples

			The 12th term is 4 as 12 -> 7 -> 3 -> 5 is a chain of 4.
a(8) = 4 because 8 -> 7 -> 3 -> 5 is a chain of length 4.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(res = 0, on = n, nn = n, cn); while(nn != cn, nn = f(on); cn = on; on = nn; res++); res}
    f(n) = {my(d = digits(n), x = [6, 2, 5, 5, 4, 5, 6, 3, 7, 6]); sum(i = 1, #d, x[d[i]+1])} \\ David A. Corneth, Oct 12 2019
    
  • Python
    def f(n):
        return sum((6, 2, 5, 5, 4, 5, 6, 3, 7, 6)[int(d)] for d in str(n))
    def A328330(n):
        c, m = 1, f(n)
        while m != n:
            c += 1
            n, m = m, f(m)
        return c # Chai Wah Wu, Oct 27 2020

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

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

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

Showing 1-4 of 4 results.