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-30 of 89 results. Next

A114018 Least n-digit prime whose digit reversal is also prime.

Original entry on oeis.org

2, 11, 101, 1009, 10007, 100049, 1000033, 10000169, 100000007, 1000000007, 10000000207, 100000000237, 1000000000091, 10000000000313, 100000000000261, 1000000000000273, 10000000000000079, 100000000000000049, 1000000000000002901, 10000000000000000051
Offset: 1

Views

Author

Amarnath Murthy, Nov 12 2005

Keywords

Comments

The more compact version A168159 gives many more terms, cf. formula. [M. F. Hasler, Nov 21 2009]

Crossrefs

Cf. A168159, A007500, A006567, A122490. [M. F. Hasler, Nov 21 2009]

Programs

  • Mathematica
    f[n_] := Block[{k = 10^(n - 1)}, While[ !PrimeQ[k] || !PrimeQ[FromDigits@Reverse@IntegerDigits@k], k++ ]; k]; Array[f, 19] (* Robert G. Wilson v, Nov 19 2005 *)
    lndp[n_]:=Module[{p=NextPrime[10^n]},While[CompositeQ[IntegerReverse[ p]],p = NextPrime[ p]];p]; Array[lndp,20,0] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 05 2019 *)
  • PARI
    for(x=1,1e99, until( isprime(x=nextprime(x+1)) & isprime(eval(concat(vecextract(Vec(Str(x)),"-1..1")))),); print1(x", "); x=10^#Str(x)-1) \\ M. F. Hasler, Nov 21 2009
    
  • Python
    from sympy import isprime
    def c(n): return isprime(n) and isprime(int(str(n)[::-1]))
    def a(n): return next(p for p in range(10**(n-1), 10**n) if c(p))
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Jun 27 2022

Formula

a(n) = 10^(n-1) + A168159(n). [M. F. Hasler, Nov 21 2009]

Extensions

More terms from Robert G. Wilson v, Nov 19 2005

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.

A359136 Primes such that there is a nontrivial permutation which when applied to the digits produces a prime (Version 1).

Original entry on oeis.org

11, 13, 17, 31, 37, 71, 73, 79, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 419, 421
Offset: 1

Views

Author

Keywords

Comments

A prime p with decimal expansion p = d_1 d_2 ... d_m is in this sequence iff there is a non-identity permutation pi in S_m such that q = d_pi(1) d_pi(2) ... d_pi(m) is also a prime. The prime q may or may not be equal to p. Leading zeros are permitted in q.
One must be careful when using the phrase "nontrivial permutation of the digits". When the first and third digits of 101 are exchanged, this is applying the nontrivial permutation (1,3) in S_3 to the digits, leaving the number itself unchanged. One should specify whether it is the permutation that is nontrivial, or its action on what is being permuted. In this sequence and A359137, we mean that the permutation itself is nontrivial.
There are only 34 primes not in this sequence, the greatest of which is 5849. - Andrew Howroyd, Jan 22 2023

Crossrefs

Many OEIS entries are subsequences (possibly after omitting 2, 3, 5, and 7): A007500, A055387, A061461, A069706, A090933, A225035.

Programs

  • PARI
    isok(n)={my(v=vecsort(digits(n))); if(#Set(v)<#v, 1, forperm(v, u, my(t=fromdigits(Vec(u))); if(isprime(t) && t<>n, return(1))); 0)} \\ Andrew Howroyd, Jan 22 2023
    
  • Python
    from sympy import isprime
    from itertools import permutations as P
    def ok(n):
        if not isprime(n): return False
        if len(s:=str(n)) > len(set(s)): return True
        return any(isprime(t) for t in (int("".join(p)) for p in P(s)) if t!=n)
    print([k for k in range(422) if ok(k)]) # Michael S. Branicky, Jan 23 2023

Extensions

More than the usual number of terms are shown in order to distinguish this from neighboring sequences.
Incorrect terms removed by Andrew Howroyd, Jan 22 2023

A033294 Squares which when written backwards remain square (final 0's excluded).

Original entry on oeis.org

1, 4, 9, 121, 144, 169, 441, 484, 676, 961, 1089, 9801, 10201, 10404, 10609, 12321, 12544, 12769, 14641, 14884, 40401, 40804, 44521, 44944, 48841, 69696, 90601, 94249, 96721, 698896, 1002001, 1004004, 1006009, 1022121, 1024144, 1026169
Offset: 1

Views

Author

Keywords

Comments

Of this sequence's first 10000 terms, only nine have an even number of digits; see A354256.

Examples

			144 = 12 * 12 is a term because 441 = 21 * 21.
		

Crossrefs

Subsequence of A115690.

Programs

  • Haskell
    a033294 n = a033294_list !! (n-1)
    a033294_list = filter chi a000290_list where
      chi m = m `mod` 10 > 0 && head ds `elem` [1,4,5,6,9] &&
              a010052 (foldl (\v d -> 10 * v + d) 0 ds) == 1 where
        ds = unfoldr
             (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 10) m
    -- Reinhard Zumkeller, Jan 19 2012
    
  • Mathematica
    Select[Range[1100]^2,Mod[#,10]!=0&&IntegerQ[Sqrt[FromDigits[Reverse[ IntegerDigits[ #]]]]]&] (* Harvey P. Dale, Oct 28 2013 *)
  • Python
    from math import isqrt
    from itertools import count, islice
    def sqr(n): return isqrt(n)**2 == n
    def agen():
        yield from (k*k for k in count(1) if k%10 and sqr(int(str(k*k)[::-1])))
    print(list(islice(agen(), 36))) # Michael S. Branicky, May 21 2022

Extensions

More terms from Erich Friedman
Initial 0 removed and offset changed by Reinhard Zumkeller, Jan 19 2012

A074833 Primes whose ternary reversal is also prime.

Original entry on oeis.org

2, 5, 7, 11, 13, 19, 23, 31, 37, 41, 47, 53, 61, 67, 79, 83, 101, 103, 113, 127, 131, 151, 163, 167, 173, 179, 181, 191, 193, 211, 227, 233, 263, 281, 293, 311, 331, 349, 353, 359, 401, 409, 419, 421, 431, 439, 449, 463, 467, 491, 499, 503, 521, 523, 541, 563
Offset: 1

Views

Author

Robert G. Wilson v, Sep 09 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Prime[ Select[ Range[110], PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ Prime[ # ], 3]], 3]] &]]

A074834 Primes whose base 4 reversal is also prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 23, 29, 31, 53, 59, 61, 67, 73, 79, 83, 89, 97, 101, 107, 193, 197, 199, 211, 233, 239, 241, 251, 257, 269, 277, 281, 293, 311, 313, 337, 353, 367, 373, 383, 397, 401, 409, 419, 433, 443, 449, 457, 461, 467, 487, 491, 499, 509, 787, 797, 809
Offset: 1

Views

Author

Robert G. Wilson v, Sep 09 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Prime[ Select[ Range[140], PrimeQ[ FromDigits[ Reverse[ IntegerDigits[ Prime[ # ], 4]], 4]] &]]
Previous Showing 21-30 of 89 results. Next