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-6 of 6 results.

A338255 a(n) = smallest m such that A328330(m) = n, or -1 if n never appears in A328330.

Original entry on oeis.org

4, 2, 1, 8, 10, 22, 1088
Offset: 1

Views

Author

Jens Placke, Oct 18 2020

Keywords

Comments

a(8) = 2008...888 (156 digits).

Examples

			4 is represented with 4 segments, so a(1) = 4.
2 is represented by 5 segments, 5 is represented by 5 segments so a(2) = 2.
1 is represented by 2 segments, 2 is by 5, 5 by 5 again, so a(3) = 1.
[...]
1088 is the solution for 7 steps.
2008..888 (156 digits) is the solution for 8 steps.
		

Crossrefs

Cf. A006942.
Location of first occurrence of n in A328330.

A006942 Number of segments used to represent n on calculator display, variant 5: digits '6', '7' and '9' use 6, 3 and 6 segments, respectively.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(A216261(n)) = n and a(m) <> n for m < A216261(n). - Reinhard Zumkeller, Mar 15 2013
If we mark with * resp. ' the graphical representations which use more resp. less segments, we have the following variants:
A063720 (6', 7', 9'), A277116 (6*, 7', 9'), A074458 (6*, 7*, 9'),
_____________ this: 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

			As depicted below, zero uses 6 segments, so a(0)=6.
   _     _  _       _   _   _   _   _
  | | |  _| _| |_| |_  |_    | |_| |_|
  |_| | |_  _|   |  _| |_|   | |_|  _|
.
[Edited by _Jon E. Schoenfield_, Jul 30 2017]
		

References

  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 65.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A216261 (least inverse), A165244 (sorted digits), A302552 (primes), A328330 (iterations), A331529 (histogram).
Variants are A010371, A063720, A074458, A277116, see comments.
See also A234691, A234692, A000120.

Programs

  • Haskell
    a006942 n = a006942_list !! n
    a006942_list = [6,2,5,5,4,5,6,3,7,6] ++ f 10 where
       f x = (a006942 x' + a006942 d) : f (x + 1)
             where (x',d) = divMod x 10
    -- Reinhard Zumkeller, Mar 15 2013
    
  • Maple
    A006942 := proc(n) local d,dig,j,s: if(n=0)then return 6:fi: dig:=[6,2,5,5,4,5,6,3,7,6]: d:=convert(n,base,10): s:=0: for j from 1 to nops(d) do s:=s+dig[d[j]+1]: od: return s: end: seq(A006942(n),n=0..100); # Nathaniel Johnston, May 08 2011
  • Mathematica
    MapIndexed[ (f[First[#2] - 1] = #1)& , {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}]; a[n_] := Plus @@ f /@ IntegerDigits[n]; Table[a[n], {n, 0, 76}] (* Jean-François Alcover, Sep 25 2012 *)
    a[n_] := Plus @@ (IntegerDigits@ n /. {0 -> 6, 1 -> 2, 2 -> 5, 3 -> 5, 7 -> 3, 8 -> 7, 9 -> 6}); Array[a, 77, 0] (* Robert G. Wilson v, Jun 20 2018 *)
  • PARI
    a(n)=if(n==0, return(6)); my(d=digits(n),v=vector(10)); for(i=1,#d, v[d[i]+1]++); v*[6, 2, 5, 5, 4, 5, 6, 3, 7, 6]~ \\ Charles R Greathouse IV, Feb 05 2018
    
  • Python
    def a(n): return sum([6, 2, 5, 5, 4, 5, 6, 3, 7, 6][int(d)] for d in str(n))
    print([a(n) for n in range(77)]) # Michael S. Branicky, Jun 02 2021

Formula

a(n) = a(floor(n/10)) + a(n mod 10) for n > 9. - Reinhard Zumkeller, Mar 15 2013
a(n) = A010371(n) - A102679(n) + A102681(n) (subtract the number of digits 7 in n) = A277116(n) + A102683(n) (add number of digits 9 in n); and in particular, A063720(n) <= A277116(n) <= a(n) = A010371(n). - M. F. Hasler, Jun 17 2020

Extensions

More terms from Matthew Conroy, Sep 13 2001

A385249 Number of iterations of seven segments count x -> A010371(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, 3, 2, 2, 4, 4, 2, 4, 2, 2, 3, 2, 2, 2, 4, 4, 2, 4, 2, 2, 3, 2, 4, 1, 2, 2, 3, 2, 4, 3, 2, 4, 2, 2, 4, 4, 2, 4, 2, 2, 3, 2, 3, 3, 2, 2, 4, 2, 3, 4, 3, 3, 4, 1, 2, 2, 3, 2, 4, 3, 2, 4, 3, 2, 3, 3, 2, 3, 3
Offset: 0

Views

Author

Marco Ripà, Jul 28 2025

Keywords

Comments

A010371 is a strictly decreasing function A010371(x) < x whenever x >= 10 and all single digit x reach a fixed point A010371(x) = x with x in {4, 5, 6}.
This sequence is unbounded and the first occurrence of a(n) = k is at n = A385250(k).

Examples

			For n = 12, the a(12) = 2 steps are 12 -> 7 -> 4 segments, and 4 is a fixed point A010371(4) = 4.
		

Crossrefs

Cf. A328330 (segments variation).

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-6 of 6 results.