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.

A177850 Smallest n-digit emirp with only nonprime digits.

Original entry on oeis.org

149, 1009, 10009, 100049, 1000849, 10000169, 100000891, 1000000009, 10000001041, 100000000669, 1000000000091, 10000000001011, 100000000000469, 1000000000004449, 10000000000001101, 100000000000000049
Offset: 3

Views

Author

Jonathan Vos Post, May 14 2010

Keywords

Comments

Least value of emirps with only nonprime digits (i.e., 0,1,4,6,8,9) A128390, with n digits. This is to primes with nonprime digits (A034844) as smallest n-digit emirp with only prime digits (A177513) is to primes with only prime digits.

Examples

			a(6) = 100049 because all digits {0,1,4,9} are nonprime, and 100049 is prime, and R(100049) = A004086(100049) = 940001 is prime, and there is no smaller 6-digit number meeting these criteria.
		

Crossrefs

Programs

  • Maple
    isA084984 := proc(n) convert(convert(n,base,10),set) ; if % intersect {2,3,5,7} = {} then true; else false; end if; end proc:
    A177850 := proc(n) local a; a := 10^(n-1) ; while not (isA006567(a) and isA084984(a)) do a := nextprime(a) ; end do; if a < 10^n then return a ; else return -1 ; end if; end proc:
    seq(A177850(n),n=3..40) ; # R. J. Mathar, May 24 2010

Extensions

More terms from R. J. Mathar, May 24 2010

A375171 Square array T(n,k), n>0 and k>0, read by antidiagonals in ascending order, giving the smallest n*k-digit number that, if arranged in an n X k matrix, form k-digit reversible prime in each row and n-digit reversible prime in each column, or -1 if no such number exists.

Original entry on oeis.org

2, 37, 37, 337, 1111, 337, 3257, 111331, 113131, 3257, 32233, 13139731, 113101311, 11933371, 32233, 322573, 1111179779, 113101929311, 119310213191, 1119711779, 322573, 3222223, 111111131397, 113101167919739, 1193100990013911, 111971042937997, 111119111337, 3222223
Offset: 1

Views

Author

Jean-Marc Rebert, Aug 06 2024

Keywords

Examples

			T(3,2) = 111331 is the smallest 3*2-digit number that if arranged in a 3 X 2 matrix yields in each row and column an reversible prime, i.e.,
  11
  13
  31
-> 11 (1 time), 13 (1 time), 31 (1 time), 113 (1 time), 131 (1 time) are all reversible primes.
Table begins (upper left corner = T(1,1)):
     2       37          337             3257 ...
    37     1111       113131         11933371 ...
   337   111331    113101311     119310213191 ...
  3257 13139731 113101929311 1193100990013911 ...
   ...      ...          ...              ... ...
		

Crossrefs

Programs

  • PARI
    isp(x) = ispseudoprime(x) && ispseudoprime(fromdigits(Vecrev(digits((x)))));
    ispd(x) = ispseudoprime(fromdigits(x)) && ispseudoprime(fromdigits(Vecrev(x)));
    vp(n) = select(isp, [10^(n-1)..10^n-1]);
    isok(val, n, k) = my(d=digits(val), v=vector(k, i, []), j=1); for (i=1, #d, v[j] = concat(v[j], d[i]); j++; if (j>k, j=1);); for (i=1, k, if (!ispd(v[i]), return(0));); return(1);
    T(n,k) = my(v = vp(k), nbp = #v, nb = nbp^n); for (i=0, nb-1, my(d=digits(i, nbp)); if (d==[], d=vector(n)); while(#d x+1, d); my(s=""); for (i=1, #d, s = concat(s, Str(v[d[i]]))); my(val = eval(s)); if (isok(val, n, k), return(val));); \\ Michel Marcus, Aug 08 2024

Formula

T(1,n) = T(n,1) <= A177513(n) for n >1.
T(1,n) = T(n,1) = A177513(n) for n = 2..6.

A375261 Smallest n-digit reversible prime with only prime digits.

Original entry on oeis.org

2, 37, 337, 3257, 32233, 322573, 3222223, 32235223, 322222223, 3222222257, 32222232577, 322222232537, 3222222223333, 32222222332733, 322222222237537, 3222222222223373, 32222222222223353, 322222222222225333, 3222222222222222577, 32222222222222225573, 322222222222222233253
Offset: 1

Views

Author

Jean-Marc Rebert, Aug 08 2024

Keywords

Comments

Differs from A177513(n) for n in A082705. - Robert Israel, May 11 2025

Crossrefs

Programs

  • Maple
    PD:= [2,3,5,7]:
    g:= proc(n) local L,d,i,x,y;
      L:= convert(n,base,4); d:= nops(L);
      x:= add(PD[L[i]+1]*10^(i-1),i=1..d);
      y:= add(PD[L[-i]+1]*10^(i-1),i=1..d);
      if isprime(x) and isprime(y) then return x fi;
    end proc:
    f:= proc(d) local k,v;
      for k from 4^(d-1) do v:= g(k); if v <> NULL then return v fi od
    end proc;
    f(1):= 2:
    map(f, [$1..30]); # Robert Israel, May 11 2025
  • Python
    from sympy import isprime
    from itertools import product
    def a(n):
        if n == 1: return 2
        for first in "37":
            for rest in product("2357", repeat=n-1):
                s = first + "".join(rest)
                if isprime(t:=int(s)) and isprime(int(s[::-1])):
                    return t
    print([a(n) for n in range(1, 22)]) # Michael S. Branicky, Aug 08 2024

Formula

a(n) <= A177513(n) for n > 1.
If a(n) is not a palindrome, a(n) = A177513(n) for n > 1.
Showing 1-3 of 3 results.