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.

A178033 Lesser of a twin prime pair (p,p+2) such that permuting the digits of p and those of p+2 gives a different twin prime pair (q, q+2).

Original entry on oeis.org

281, 461, 641, 821, 1031, 1091, 1229, 1277, 1301, 1319, 1427, 1697, 1721, 1787, 1877, 2081, 2129, 2381, 2687, 2711, 2801, 3119, 3251, 3257, 3371, 3467, 3527, 3581, 3821, 3851, 4091, 4127, 4157, 4217, 4241, 4271, 4421, 4517, 4637, 4649, 4721, 4787, 4931, 4967, 5231, 5417, 5477, 5651
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), May 17 2010

Keywords

Comments

Permutations with initial zeros are disallowed, so that 101 is not a member (101,103 and 11,13); equivalently, we require that p is a permutation of the digits of q as well.

Examples

			281 is a term as 281 is the lesser of the twin prime pair 281,283, and after permuting 821, 823 is also a twin prime pair.
1229 is a term as (1229,1231) is a twin prime pair and after permuting (2129, 2131) is also a twin prime pair.
		

Crossrefs

Programs

  • Mathematica
    perm@n_ :=
     Select[FromDigits@# & /@
       DeleteCases[Rest@Permutations@IntegerDigits@n, _?(First@# == 0 &)],
       PrimeQ];
    Cases[{#, perm@# & /@ #} & /@
      Cases[6*# + {-1, 1} & /@
        Range@2000, {?PrimeQ ..}], {{x, }, {{__, a_, _}, {_, b_, _}} /; b - a == 2} :> x] (* Hans Rudolf Widmer, Oct 04 2024 *)

Extensions

Corrected and edited by D. S. McNeil, Nov 23 2010
More terms from Hans Rudolf Widmer, Oct 04 2024