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

A238852 Right-truncatable, reversible primes in base 100.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 311, 313, 347, 349, 353, 359, 367, 701, 709, 719, 727, 733, 739, 751, 769, 773, 787, 1103, 1109, 1123, 1163, 1181, 1193, 1301, 1303, 1319, 1321, 1327, 1361, 1777
Offset: 1

Views

Author

Stanislav Sykora, Mar 06 2014

Keywords

Comments

See A238850 for definitions, and A238854 for comments on general context.
In base 100, chosen as one of four examples, there are 1552 such numbers.

Examples

			The largest number of this type (using hyphens to separate the base 100 digits) is 19-07-93-27-17-37-99-47-19-11.Truncate any even number of decimal digits on its right, and the remaining prefix is still a base-100 reversible prime (e.g., 19079327 and 27930719 are both primes).
		

Crossrefs

Cf. All in base 10: A238850, 16: A238851, 256: A238853.
Cf. In base n: A238854 (largest), A238855 (totals), A238856 (maximum digits), A238857 (m-digit counts).

Programs

  • PARI
    See the link.

A238854 Largest right-truncatable, reversible prime in base n.

Original entry on oeis.org

23, 53, 449, 191, 1171, 30671, 5827, 3733, 901687, 10357, 834469, 3043427, 5430889, 4060019, 498061, 34763, 118248433, 62344463, 218555173, 4463351, 114607657, 7903613, 14523874693, 211675817, 32814697, 93375223, 162466979, 8052409793, 12006877873
Offset: 3

Views

Author

Stanislav Sykora, Mar 07 2014

Keywords

Comments

See A238850, A238851, A238852, A238853 for the finite lists of such numbers in four bases selected as examples. A sequence conceptually similar to this one, but for right-truncatable (not reversible!) primes is A023107. The present, more restrictive, condition leads to smaller numbers which can be evaluated in reasonable time for much higher n values.

Examples

			a(4) = 53 because it is a prime which in base 4 reads 311_b4, its reverse 113_b4 (decimal 23) is also a prime, the same holds for all its base-4 prefixes (31_b4 and 3_b4), and it is the largest natural having these properties.
		

Crossrefs

Cf. Full in base 10: A238850, 16: A238851, 100: A238852, 256: A238853.
Cf. In base n: A238855 (totals), A238856 (maximum digits), A238857 (m-digits counts).

Programs

  • PARI
    See the link.

A238855 Number of all right-truncatable reversible primes in base n.

Original entry on oeis.org

0, 3, 4, 12, 5, 12, 24, 17, 16, 33, 22, 29, 50, 39, 40, 39, 24, 65, 80, 100, 58, 58, 69, 122, 101, 90, 83, 125, 114, 133, 114, 122, 255, 203, 252, 123, 152, 221, 202, 308, 131, 250, 299, 397, 303, 143, 201, 484, 497, 423, 269, 253, 442, 944, 845, 378, 231, 460, 420, 455, 538, 438
Offset: 2

Views

Author

Stanislav Sykora, Mar 07 2014

Keywords

Comments

For definitions and more comments, see A238854 and A238850.
Conjecture: in any base n, the number of right-truncatable reversible primes is finite.

Examples

			In bases 10, 16, 100, and 256 (used as examples in the crossrefs) there are, respectively, 16, 40, 1552, and 35127 such numbers.
		

Crossrefs

Cf. Full in base 10: A238850, 16: A238851, 100: A238852, 256: A238853.
Cf. In base n: A238854 (largest), A238856 (maximum digits), A238857 (m-digit counts).

Programs

  • PARI
    See the link.

A238856 Number of digits of the largest right-truncatable reversible prime in base n.

Original entry on oeis.org

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

Views

Author

Stanislav Sykora, Mar 13 2014

Keywords

Comments

For definitions and more comments, see A238854 and A238850. A weak conjecture: this sequence might be bounded.

Examples

			a(16) = 6 because the largest truncatable reversible prime in base 16 has 6 hexadecimal digits (see A238851).
		

Crossrefs

Cf. Full in base 10: A238850, 16: A238851, 100: A238852, 256: A238853.
Cf. In base n: A238854 (largest), A238855 (totals), A238857 (m-digit counts).

Programs

  • PARI
    See the link.

A238857 Array read by rows: row n lists total number of m-digit right-truncatable reversible primes in base n.

Original entry on oeis.org

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

Views

Author

Stanislav Sykora, Mar 13 2014

Keywords

Comments

For definitions and more comments, see A238854 and A238850.
This is an irregular table with one line for every base, starting at 2, while the columns correspond to the number of digits (1,2,3,...). Each row terminates with a zero (in any given base there appears to be a finite number of instances).

Examples

			These are the first rows of the table:
   2: 0,
   3: 1, 1, 1, 0,
   4: 2, 1, 1, 0,
   5: 2, 4, 4, 2, 0,
   6: 3, 1, 1, 0,
   7: 3, 5, 3, 1, 0,
   8: 4, 7, 7, 5, 1, 0,
   9: 4, 5, 5, 3, 0,
  10: 4, 5, 6, 1, 0,
  ...
Hence, there are 6 right truncatable reversible primes with 3 digits in base 10 (see A238850).
		

Crossrefs

Full in base 10: A238850, 16: A238851, 100: A238852, 256: A238853.
In base n: A238854 (largest), A238855 (totals), A238856 (maximum digits).

Programs

  • PARI
    See the link.

A238850 Right-truncatable reversible primes in base 10.

Original entry on oeis.org

2, 3, 5, 7, 31, 37, 71, 73, 79, 311, 313, 373, 733, 739, 797, 3733
Offset: 1

Views

Author

Stanislav Sykora, Mar 06 2014

Keywords

Comments

In a general base b, a number qualifies as a member iff: (i) it is a prime, (ii) when its digits in base b are reversed, it is still a prime, and (iii) when, in base b, it has more than one digit and the least significant one is dropped, the remaining prefix has the same properties. This implies that any base-b prefix of such a number, no matter how many right-side digits are truncated, is still a right-truncatable reversible prime. Sequences of this type appear to be all finite (see A238854, A238855, and A238856, used as examples).
This particular sequence is for base b = 10.
See also A238854 for comments on a more general context.

Examples

			739 is a member because it is a prime and so is 937, as well as the pair (73, 37) and 7.
		

Crossrefs

In base 16: A238851, 100: A238852, 256: A238853.
In base n: A238854 (largest), A238855 (totals), A238856 (maximum digits), A238857 (m-digit counts).

Programs

  • PARI
    See the link.

A238851 Right-truncatable, reversible primes in base 16.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 53, 59, 61, 83, 89, 113, 179, 191, 211, 863, 947, 977, 983, 991, 1429, 1439, 1823, 3061, 3067, 3389, 15161, 15643, 15733, 15737, 15739, 15859, 23029, 48989, 48991, 251737, 251831, 253751, 368471, 4060019
Offset: 1

Views

Author

Stanislav Sykora, Mar 06 2014

Keywords

Comments

See A238850 for definitions, and A238854 for comments on general context.
These numbers are fully right-truncatable and reversible primes in base 16 (but listed in decimal format). They are 40 in all.

Examples

			The largest such number (4060019) is in hex format 0x3DF373. It is a prime, so is 0x373FD3, and 0x3DF37 has again the same properties.
		

Crossrefs

Cf. All in base 10: A238850, 100: A238852, 256: A238853.
Cf. In base n: A238854 (largest), A238855 (totals), A238856 (maximum digits), A238857 (m-digit counts).

Programs

  • PARI
    See the link.

A253147 Palindromes in base 10 >= 256 that remain palindromes when the digits are reversed in base 256.

Original entry on oeis.org

8448, 31613, 32123, 55255, 63736, 92929, 96769, 108801, 450054, 516615, 995599, 1413141, 1432341, 1539351, 1558551, 2019102, 2491942, 2513152, 2712172, 2731372, 2750572, 2807082, 2838382, 2857582, 2876782, 3097903, 3740473, 3866683, 3885883, 4201024, 4220224, 4327234
Offset: 1

Views

Author

Chai Wah Wu, Dec 29 2014

Keywords

Comments

Reversing the digits in base 256 is equivalent to reading a number in big-endian format using little-endian order with 8-bit words. See also A238853.

Examples

			2857582 is in the sequence since 2857582 is 2b 9a 6e in base 16 and 6e 9a 2b = 7248427 is a palindrome.
		

Crossrefs

Programs

  • Python
    def palgen(l, b=10): # generator of palindromes in base b of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1, l+1):
                n = b**(x-1)
                n2 = n*b
                for y in range(n, n2):
                    k, m = y//b, 0
                    while k >= b:
                        k, r = divmod(k, b)
                        m = b*m + r
                    yield y*n + b*m + k
                for y in range(n, n2):
                    k, m = y, 0
                    while k >= b:
                        k, r = divmod(k, b)
                        m = b*m + r
                    yield y*n2 + b*m + k
    def reversedigits(n, b=10): # reverse digits of n in base b
        x, y = n, 0
        while x >= b:
            x, r = divmod(x, b)
            y = b*y + r
        return b*y + x
    A253147_list = []
    for n in palgen(4):
        x = reversedigits(n, 256)
        if n > 255 and x == reversedigits(x, 10):
            A253147_list.append(n)

A253148 Nontrivial palindromes in base 10 and base 256.

Original entry on oeis.org

55255, 63736, 92929, 96769, 108801, 450054, 516615, 995599, 1413141, 1432341, 1539351, 1558551, 2019102, 2491942, 2807082, 3097903, 3740473, 3866683, 3885883, 4201024, 4220224, 4327234, 4346434, 4365634, 4384834, 5614165, 5633365, 5759575, 6692966, 7153517, 7172717
Offset: 1

Views

Author

Chai Wah Wu, Dec 30 2014

Keywords

Comments

Palindromes in base 256 are numbers that are the same in big-endian and little-endian order with 8-bit words. See also A238853.
A palindromic number in base 10 which is below 256 is a 1-digit number in base 256. Thus, it is automatically a palindrome in base 256. This sequence excludes 1-digit numbers in base 256. - Tanya Khovanova, Aug 21 2021

Examples

			7172717 in base 16 is 6d 72 6d and the bytes form a palindrome.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[256, 10000000], PalindromeQ[#] && PalindromeQ[IntegerDigits[#, 256]] &] (* Tanya Khovanova, Aug 21 2021 *)
  • Python
    from _future_ import division
    def palgen(l, b=10): # generator of palindromes in base b of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1, l+1):
                n = b**(x-1)
                n2 = n*b
                for y in range(n, n2):
                    k, m = y//b, 0
                    while k >= b:
                        k, r = divmod(k, b)
                        m = b*m + r
                    yield y*n + b*m + k
                for y in range(n, n2):
                    k, m = y, 0
                    while k >= b:
                        k, r = divmod(k, b)
                        m = b*m + r
                    yield y*n2 + b*m + k
    def reversedigits(n, b=10): # reverse digits of n in base b
        x, y = n, 0
        while x >= b:
            x, r = divmod(x, b)
            y = b*y + r
        return b*y + x
    A253148_list = []
    for n in palgen(5):
        if n > 255 and n == reversedigits(n,256):
            A253148_list.append(n)

Extensions

Name clarified by Tanya Khovanova, Aug 21 2021

A253149 Primes >= 256 that remain primes when the digits are reversed in base 256.

Original entry on oeis.org

257, 269, 293, 311, 313, 347, 379, 397, 419, 449, 479, 491, 773, 809, 823, 827, 829, 857, 883, 887, 947, 953, 971, 977, 1013, 1283, 1289, 1297, 1301, 1307, 1321, 1327, 1367, 1373, 1399, 1409, 1429, 1439, 1451, 1453, 1481, 1483, 1511, 1523, 1801, 1811, 1847, 1867
Offset: 1

Views

Author

Chai Wah Wu, Dec 30 2014

Keywords

Comments

Reversing the digits in base 256 is equivalent to reading a number in big-endian format using little-endian order with 8-bit words. See also A238853.

Examples

			1299647 is prime and written in base 16 is 13 d4 bf whereas bf d4 13 = 12571667 is also prime.
		

Crossrefs

Programs

  • Python
    from sympy import prime, isprime
    def reversedigits(n, b=10): # reverse digits of n in base b
        x, y = n, 0
        while x >= b:
            x, r = divmod(x, b)
            y = b*y + r
        return b*y + x
    A253149_list = []
    for n in range(1, 300):
        p = prime(n)
        if p > 255 and isprime(reversedigits(p,256)):
            A253149_list.append(p)
    print(A253149_list)
Showing 1-10 of 10 results.