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

A048660 Erroneous version of A134997.

Original entry on oeis.org

1, 1, 2, 2, 1, 14, 40, 52, 228, 482
Offset: 1

Views

Author

Keywords

Crossrefs

A134996 Dihedral calculator primes: p, p upside down, p in a mirror, p upside-down-and-in-a-mirror are all primes.

Original entry on oeis.org

2, 5, 11, 101, 181, 1181, 1811, 18181, 108881, 110881, 118081, 120121, 121021, 121151, 150151, 151051, 151121, 180181, 180811, 181081, 188011, 188801, 1008001, 1022201, 1028011, 1055501, 1058011, 1082801, 1085801, 1088081, 1108201, 1108501, 1110881, 1120121, 1120211
Offset: 1

Views

Author

Keywords

Comments

The digits of a(n) are restricted to 0, 1, 2, 5, 8. - Ivan N. Ianakiev, Oct 08 2015
The first term containing all the possible digits is 108225151. There are 2958 such terms up to 10^12, the last one in this range being 188885250551. - Giovanni Resta, Oct 08 2015

Examples

			120121 is such a number because 120121, 121021 (upside down), 151051 (mirror) and 150151 are all prime. (This is the smallest one in which all four numbers are distinct.)
		

Crossrefs

Programs

  • Mathematica
    lst1={2,5};
    startQ[n_]:=First[IntegerDigits[n]]==1;
    subQ[n_]:=Module[{lst={0,1,2,5,8}},SubsetQ[lst,Union[IntegerDigits[n]]]];
    rev[n_]:=Reverse[IntegerDigits[n]];
    updown[n_]:=FromDigits[rev[n]];
    mirror[n_]:=FromDigits[rev[n]/.{2-> 5,5-> 2}];
    updownmirror[n_]:=FromDigits[rev[mirror[n]]];
    lst2=Select[Range@188801,And[startQ[#],subQ[#],PrimeQ[#],PrimeQ[updown[#]],PrimeQ[mirror[#]],PrimeQ[updownmirror[#]]]&];
    Join[lst1,lst2] (* Ivan N. Ianakiev, Oct 08 2015 *)
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def t(s): return s.translate({ord("2"):ord("5"), ord("5"):ord("2")})
    def ok(s): # s is a string of digits
        return all(isprime(int(w)) for w in [s, s[::-1], t(s), t(s[::-1])])
    def agen(): # generator of terms
        yield from (2, 5)
        for d in count(2):
            for mid in product("01258", repeat=d-2):
                s = "1" + "".join(mid) + "1"
                if ok(s): yield int(s)
    print(list(islice(agen(), 35))) # Michael S. Branicky, Apr 27 2024

Extensions

5 added by Patrick Capelle, Feb 06 2008

A134998 Dihedral palindromic primes.

Original entry on oeis.org

2, 5, 11, 101, 181, 18181, 1008001, 1022201, 1055501, 1082801, 1085801, 1180811, 1208021, 1221221, 1250521, 1280821, 1508051, 1520251, 1551551, 1580851, 1802081, 1805081, 1880881, 1881881, 100111001, 100888001, 108101801
Offset: 1

Views

Author

Keywords

Crossrefs

Extensions

5 added by Patrick Capelle, Feb 06 2008
Showing 1-3 of 3 results.