login
Zeroless composite numbers which become and remain prime under a complete cyclic shift of digits.
1

%I #30 Jul 10 2018 21:16:27

%S 14,16,32,34,35,38,74,76,91,92,95,98,118,119,133,176,194,316,398,712,

%T 715,731,736,772,775,778,779,793,794,914,935,973,1118,1195,1312,1336,

%U 1774,1937,3112,3199,3337,3379,3394,3772,3992,7132,7198,7318,7376,7771,7912

%N Zeroless composite numbers which become and remain prime under a complete cyclic shift of digits.

%C Numbers with a zero digit have been excluded as cycling through these numbers would generate leading zeros, which become problematic throughout the cycle.

%C 3999131, 7919777, 37177739 and 391331191 are in this sequence, see the link. - _Eric Chen_, Jun 14 2018

%C The sequence contains all composites without the digit zero that can be obtained by cyclically permuting the digits of the terms of A270083. - _Felix Fröhlich_, Jul 10 2018

%H Robert Israel, <a href="/A305885/b305885.txt">Table of n, a(n) for n = 1..121</a> (first 56 terms from Philip Mizzi)

%H World of numbers, <a href="http://www.worldofnumbers.com/circular.htm">Circular prime</a>

%F { A052382 } intersection { A068653 }.

%F { A068653 } minus { A011540 }.

%e N_0 = 1118 (composite);

%e N_1 = 1181 (prime);

%e N_2 = 1811 (prime);

%e N_3 = 8111 (prime);

%e N_4 = N_0 = 1118 (composite).

%p Q[1]:= [seq([i],i=1..9)]:

%p for d from 2 to 7 do Q[d]:= map(t -> seq([i,op(t)],i=1..9),Q[d-1]) od:

%p Res:= NULL: count:= 0:

%p for d from 2 to 7 do

%p for q in Q[d] do P[q]:= isprime(add(q[i]*10^(i-1),i=1..d)) od;

%p for q in Q[d] do

%p if (not P[q]) and andmap(t -> P[ListTools:-Rotate(q,t)],[$1..d-1]) then

%p count:= count+1;

%p Res:= Res, add(q[i]*10^(i-1),i=1..d);

%p fi

%p od

%p od:

%p Res; # _Robert Israel_, Jul 10 2018

%t Select[Range[11, 8000], Function[{k, d}, And[CompositeQ@ k, FreeQ[d, 0], AllTrue[Array[FromDigits@ RotateLeft[d, #] &, IntegerLength@ k - 1], PrimeQ]]] @@ {#, IntegerDigits@ #} &] (* _Michael De Vlieger_, Jun 14 2018 *)

%o (PARI) eva(n) = subst(Pol(n), x, 10)

%o rot(n) = if(#Str(n)==1, v=vector(1), v=vector(#n-1)); for(i=2, #n, v[i-1]=n[i]); u=vector(#n); for(i=1, #n, u[i]=n[i]); v=concat(v, u[1]); v

%o is(n) = my(d=digits(n), r=rot(d)); if(vecmin(d)==0, return(0), while(1, if(!ispseudoprime(eva(r)), return(0)); r=rot(r); if(r==d, return(1))))

%o forcomposite(c=1, 8000, if(is(c), print1(c, ", "))) \\ _Felix Fröhlich_, Jul 10 2018

%Y Cf. A011540, A052382, A068653, A270083.

%K nonn,base

%O 1,1

%A _Philip Mizzi_, Jun 13 2018