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.

A063720 Number of segments lit in a 7-segment display (as on a calculator) to represent the number n, variant 0: '6', '7' and '9' use 5, 3 and 5 segments, respectively.

Original entry on oeis.org

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

Views

Author

Deepan Majmudar (deepan.majmudar(AT)compaq.com), Aug 23 2001

Keywords

Comments

If we mark with * resp. ' the glyph variants (graphical representations) which use more resp. less segments, we have the following variants:
A063720 (this: 6', 7', 9'), A277116 (6*, 7', 9'), A074458 (6*, 7*, 9'), _________________________ 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

			The number 8 on a digital readout (e.g., on a calculator display) can be represented as
   -
  | |
   -
  | |
   -
which uses all 7 segments. Therefore a(8) = 7.
From _M. F. Hasler_, Jun 17 2020: (Start)
This sequence uses the following representations:
       _       _   _       _       _   _   _
      | |   |  _|  _| |_| |_  |_    | |_| |_|
      |_|   | |_   _|   |  _| |_|   | |_|   |
.
See crossrefs for other variants. (End)
		

Crossrefs

For variants see A006942, A010371, A074458, A277116 (cf. comments).
Other related sequences: A018846, A018847, A018849, A038136, A053701.

Programs

  • Haskell
    a063720 n = a063720_list !! n
    a063720_list = [6,2,5,5,4,5,5,3,7,5] ++ f 10 where
       f x = (a063720 x' + a063720 d) : f (x + 1)
             where (x',d) = divMod x 10
    -- Reinhard Zumkeller, Mar 15 2013
    
  • Mathematica
    a[n_ /; n <= 9] := a[n] = {6, 2, 5, 5, 4, 5, 5, 3, 7, 5}[[n+1]]; a[n_] := a[n] = a[Quotient[n, 10]] + a[Mod[n, 10]]; Table[a[n], {n, 0, 85}] (* Jean-François Alcover, Aug 12 2013, after Reinhard Zumkeller *)
    Table[Total[IntegerDigits[n]/.{0->6,1->2,2->5,3->5,6->5,7->3,8->7,9->5}],{n,0,90}] (* Harvey P. Dale, Mar 27 2021 *)
  • PARI
    apply( {A063720(n)=digits(6255455375)[n%10+1]+if(n>9, self()(n\10))}, [0..99]) \\ M. F. Hasler, Jun 17 2020

Formula

a(n) = a(floor(n/10)) + a(n mod 10) for n > 9. - Reinhard Zumkeller, Mar 15 2013
a(n) <= A277116(n) <= min{A006942(n), A074458(n)} <= A010371(n); differences between these are given, e.g., by A102677(n) - A102679(n) (= number of digits 7 in n). - M. F. Hasler, Jun 17 2020

Extensions

More terms from Matthew Conroy, Sep 13 2001
Definition clarified by M. F. Hasler, Jun 17 2020

A045574 Numbers that are still numbers when turned upside down (uses only digits 0, 1, 6, 8, 9 with no final 0's).

Original entry on oeis.org

0, 1, 6, 8, 9, 11, 16, 18, 19, 61, 66, 68, 69, 81, 86, 88, 89, 91, 96, 98, 99, 101, 106, 108, 109, 111, 116, 118, 119, 161, 166, 168, 169, 181, 186, 188, 189, 191, 196, 198, 199, 601, 606, 608, 609, 611, 616, 618, 619, 661, 666, 668, 669, 681, 686, 688, 689, 691, 696, 698, 699
Offset: 1

Views

Author

Keywords

Comments

"No final 0's" means that the rotated number should not have leading zeros; the single digit of the number 0 itself is not considered as such.

Crossrefs

Programs

  • PARI
    is_A045574(n)=n%10 & !setminus(Set(Vec(Str(n))),Vec("01689")) || !n  \\ M. F. Hasler, May 04 2012

Extensions

More terms from Michel Marcus, Dec 27 2020

A018846 Strobogrammatic numbers: numbers that are the same upside down (using calculator-style numerals).

Original entry on oeis.org

0, 1, 2, 5, 8, 11, 22, 55, 69, 88, 96, 101, 111, 121, 151, 181, 202, 212, 222, 252, 282, 505, 515, 525, 555, 585, 609, 619, 629, 659, 689, 808, 818, 828, 858, 888, 906, 916, 926, 956, 986, 1001, 1111, 1221, 1551, 1691, 1881, 1961, 2002, 2112, 2222, 2552, 2692, 2882
Offset: 1

Views

Author

Keywords

Comments

A018847 lists primes in this sequence. - M. F. Hasler, May 05 2012

Crossrefs

Cf. A053701 (vertically symmetric numbers), A048708.

Programs

  • PARI
    is_A018846(n,t=Vec("012..59.86"))={ apply(x->t[eval(x)+1], n=Vec(Str(n)))==vecextract(n, "-1..1") } \\ M. F. Hasler, May 05 2012
    
  • Python
    from itertools import count, islice, product
    def ud(s): return s[::-1].translate({ord('6'):ord('9'), ord('9'):ord('6')})
    def A018846gen(): # generator of terms
        yield from [0, 1, 2, 5, 8]
        for d in count(2):
            for first in "125689":
                for rest in product("0125689", repeat=d//2-1):
                    left = first + "".join(rest)
                    for mid in [[""], ["0", "1", "2", "5", "8"]][d%2]:
                        yield int(left + mid + ud(left))
    print(list(islice(A018846gen(), 54))) # Michael S. Branicky, Jul 09 2022

A178316 Primes whose digital rotation is still prime.

Original entry on oeis.org

2, 5, 11, 19, 61, 101, 109, 151, 181, 199, 601, 619, 659, 661, 1019, 1021, 1061, 1091, 1109, 1129, 1151, 1181, 1201, 1229, 1259, 1291, 1511, 1559, 1601, 1609, 1621, 1669, 1699, 1811, 1901, 1999, 6011, 6091, 6101, 6199, 6211, 6221, 6229, 6521, 6551, 6569
Offset: 1

Views

Author

David Nacin, May 24 2010

Keywords

Comments

This means if written as in a digital clock and rotated 180 degrees around the center the result is also prime (possibly a different prime).

Examples

			For example 1259 becomes 6521 under such a rotation.
		

References

  • Guy, R. K., Unsolved Problems in Number Theory, p 15 This sequence is related to the palindromic primes with symmetries as in Guy's book.

Crossrefs

Programs

  • Mathematica
    Select[Range[6570],PrimeQ[#]&&PrimeQ[FromDigits[Reverse[IntegerDigits[#]/.{6->9,9->6}]]]&&ContainsOnly[IntegerDigits[#],{0,1,2,5,6,8,9}]&] (* James C. McMahon, Apr 09 2024 *)
  • Python
    from itertools import count, islice, product
    from sympy import isprime
    def A178316_gen():
        yield from (2,5)
        r = ''.maketrans('69','96')
        for l in count(1):
            for a in '125689':
                for d in product('0125689',repeat=l):
                    s = a+''.join(d)
                    m = int(s)
                    if isprime(m) and isprime(int(s[::-1].translate(r))):
                        yield m
    A178316_list = list(islice(A178316_gen(),40)) # Chai Wah Wu, Apr 09 2024

A178317 Primes with the property that if the digits are written digital clock style and the number is reflected across a horizontal line through the middle of the number, the result is still prime.

Original entry on oeis.org

2, 3, 5, 11, 13, 23, 31, 53, 83, 101, 103, 113, 131, 181, 251, 311, 313, 331, 383, 521, 811, 823, 853, 881, 883, 1013, 1021, 1031, 1033, 1051, 1103, 1123, 1153, 1181, 1223, 1231, 1283, 1301, 1303, 1381, 1531, 1553, 1583, 1801, 1811, 1831, 2003, 2011, 2053
Offset: 1

Views

Author

David Nacin, May 24 2010

Keywords

Examples

			For example when 251 is reflected it becomes 521 which is also a prime, but a different one.
		

Crossrefs

Cf. A018847.

A105268 Primes which are 1 + strobogrammatic numbers A000787(n): the same upside down.

Original entry on oeis.org

2, 89, 97, 809, 907, 8009, 8699, 9697, 9887, 81119, 98887, 8000009, 9888887, 81111119, 8111111119, 8666699999, 9888888887, 8000000000009, 9888888888887, 98888888888888887, 81111111111111111119, 800000000000000000009
Offset: 1

Views

Author

Jonathan Vos Post, Apr 16 2005

Keywords

Comments

Primes which, upon subtracting one, give numbers which read the same upside-down. Not to be confused with strobogrammatic primes A007597 such as 181 or 619. Also, 263 is the largest known prime whose square is strobogrammatic. Not to be confused with strobogrammatic squares A018848 such as 109181601. After a(7) this sequence is exemplary, not complete (i.e. missing some values).

Examples

			9887 is prime, 9887 = 9886+1 and 9886 turned upside-down is 9886 again.
		

Crossrefs

Formula

{A000787(n)+1} intersect {A000040}.

Extensions

Term a(17) reordered by Georg Fischer, Mar 20 2022
Showing 1-6 of 6 results.