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

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

A069707 Squares with property that swapping first and last digits also gives a square.

Original entry on oeis.org

1, 4, 9, 100, 121, 144, 169, 400, 441, 484, 676, 900, 961, 1521, 1681, 1764, 4624, 4761, 5625, 9409, 10000, 10201, 10404, 10609, 11881, 12321, 14161, 14641, 16641, 17161, 19321, 19881, 40000, 40401, 40804, 41209, 43264, 44944, 47524, 49284
Offset: 1

Views

Author

Amarnath Murthy, Apr 08 2002

Keywords

Examples

			1764 and 4761 both are squares hence both are members.
		

Crossrefs

Programs

  • Mathematica
    Do[t = IntegerDigits[n^2]; u = t; u[[1]] = t[[ -1]]; u[[ -1]] = t[[1]]; t = FromDigits[u]; If[ IntegerQ[ Sqrt[t]], Print[n^2]], {n, 1, 300}]
    sfldQ[n_]:=Module[{idn=IntegerDigits[n]},IntegerQ[Sqrt[FromDigits[Join[ {idn[[-1]]},Most[ Rest[idn]],{idn[[1]]}]]]]]; Join[{1,4,9},Select[ Range[10,250]^2,sfldQ]] (* Harvey P. Dale, Oct 13 2020 *)

Extensions

Edited and extended by Robert G. Wilson v
Edited by N. J. A. Sloane, Jan 20 2009

A069708 Triangular numbers with property that swapping first and last digits also gives a triangular number.

Original entry on oeis.org

1, 3, 6, 10, 55, 66, 120, 153, 171, 190, 300, 351, 595, 630, 666, 820, 1081, 1431, 1711, 1891, 3003, 3403, 5050, 5460, 5565, 5995, 6216, 6786, 8128, 8778, 10011, 10731, 11781, 12561, 13041, 13861, 15051, 15931, 16471, 17020, 17391, 17578, 18721
Offset: 1

Views

Author

Amarnath Murthy, Apr 08 2002

Keywords

Comments

934 of the first 1000 terms begin and end with the same digit. 40 of the first 1000 terms end in zero. Thus, only 26 of the first 1000 terms begin and end with different nonzero digits, with 153 being the smallest and 8026021 being the largest of those terms. - Harvey P. Dale, Jan 09 2021

Examples

			820 and 028 = 28 both are triangular numbers hence both are members.
		

Crossrefs

Programs

  • Mathematica
    Do[t = IntegerDigits[n(n + 1)/2]; u = t; u[[1]] = t[[ -1]]; u[[ -1]] = t[[1]]; t = FromDigits[u]; u = Floor[ Sqrt[2t]]; If[ u(u + 1)/2 == t, Print[n(n + 1)/2]], {n, 1, 300}]
    sfl[n_]:=Module[{idn=IntegerDigits[n]},FromDigits[Flatten[Join[{Last[ idn],Rest[ Most[ idn]],First[ idn]}]]]]; Join[ {1,3,6},Select[ Accumulate[ Range[200]],OddQ[Sqrt[8 sfl[#]+1]]&]//Quiet] (* Harvey P. Dale, Jan 09 2021 *)

Extensions

Edited, corrected and extended by Robert G. Wilson v
Edited by N. J. A. Sloane, Jan 20 2009

A180022 Primes that can be obtained from other primes by interchanging the first and last digits. The source prime and the resulting prime are written consecutively.

Original entry on oeis.org

11, 11, 13, 31, 17, 71, 31, 13, 37, 73, 71, 17, 73, 37, 79, 97, 97, 79, 101, 101, 107, 701, 113, 311, 131, 131, 149, 941, 151, 151, 157, 751, 167, 761, 179, 971, 181, 181, 191, 191, 199, 991, 311, 113, 313, 313, 337, 733, 347, 743, 353, 353, 359, 953, 373, 373
Offset: 1

Views

Author

Parthasarathy Nambi, Aug 06 2010

Keywords

Comments

This sequence is different from A007500 and A069706. [From Parthasarathy Nambi, Aug 07 2010]

Examples

			389 is a prime and the prime 983 is obtained by interchanging the first and last digits.
		

Crossrefs

Cf. A007500,A069706. [From Parthasarathy Nambi, Aug 07 2010]

A185104 Primes with property that each swapping any pair of digits also gives a prime.

Original entry on oeis.org

11, 13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 179, 199, 311, 337, 373, 733, 919, 991, 3911
Offset: 1

Views

Author

Jaroslav Krizek, Dec 26 2012

Keywords

Comments

Conjecture: next terms are 1111111111111111111 and 11111111111111111111111.

Examples

			Prime 179 is a term because 197 and 719 are also prime.
Prime 1913 is not a term because 9113 is not prime (even though 1193, 1319, 1931 and 3911 are primes).
		

Crossrefs

Cf. A003459 (absolute primes).
Subsequence of A069706 (primes with property that swapping first and last digits also gives a prime).
Showing 1-5 of 5 results.