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.

A334170 Emirps containing only the digits 1 and 2.

Original entry on oeis.org

111211, 112111, 12122221, 12222121, 1111122121, 1212211111, 11121211121, 11212221121, 12111212111, 12112221211, 111122221121, 111122222111, 111122222221, 111211221221, 111212212211, 111212222111, 111222212111, 111222221111, 112111211221, 112122112211, 112122211121
Offset: 1

Views

Author

Daniel Starodubtsev, Apr 17 2020

Keywords

Crossrefs

Intersection of A007931 and A006567.
Subsequence of A020450.

Programs

  • Mathematica
    Union @ Flatten @ Table[FromDigits /@ Select[Tuples[{1, 2}, n] ,PrimeQ @ (m = FromDigits[#]) && # != (r = Reverse[#]) && PrimeQ @ FromDigits[r] &], {n, 12}] (* Amiram Eldar, Apr 18 2020 *)
    Table[Select[FromDigits/@Tuples[{1,2},n],!PalindromeQ[#]&&AllTrue[ {#,IntegerReverse[ #]},PrimeQ]&],{n,12}]//Flatten (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 08 2020 *)
  • PARI
    isok(p) = if (isprime(p), my(d=digits(p), rd=Vecrev(d)); (vecsort(d,,8) == [1,2]) && isprime(fromdigits(rd)) && (rd != d));
    lista(nn) = {for (n=1, nn, my(vf = vector(n, k, 1)); for (i=1, 2^n-1, my(vpos = select(x->(x==1), Vecrev(binary(i)), 1), nvf = vf); for (i=1, #vpos, nvf[vpos[i]] = 2;); my(x = eval(Str(1, fromdigits(Vecrev(nvf)), 1))); if (isok(x), print1(x, ", "));););} \\ Michel Marcus, Apr 18 2020