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.

A068653 Composite numbers such that every cyclic shift (other than the number itself) gives a prime.

This page as a plain text file.
%I A068653 #24 Dec 07 2018 17:29:56
%S A068653 14,16,20,30,32,34,35,38,50,70,74,76,91,92,95,98,110,118,119,133,170,
%T A068653 176,194,310,316,398,710,712,715,730,731,736,772,775,778,779,790,793,
%U A068653 794,914,935,970,973,1118,1130,1195,1312,1336,1370,1774,1937,3110,3112
%N A068653 Composite numbers such that every cyclic shift (other than the number itself) gives a prime.
%C A068653 Single-digit numbers are excluded. There are only 144 terms up through 10 million. - _Harvey P. Dale_, Sep 12 2014
%H A068653 Chai Wah Wu, <a href="/A068653/b068653.txt">Table of n, a(n) for n = 1..148</a> a(n) for n = 1..144 from Harvey P. Dale.
%e A068653 176 is a term as the two cyclic shifts other than the number itself, 761 and 617, are primes.
%t A068653 LiQ[n_] := Module[{s=0}, li1=IntegerDigits[n]; k=Length[li1]; t={li1}; Do[li1=RotateLeft[li1]; AppendTo[t,li1], {i,k-1}]; If[Length[Select[Table[FromDigits[p],{p,t}], PrimeQ]] == k-1, s=1]; s]; t1={}; Do[If[!PrimeQ[i] && LiQ[i]==1, AppendTo[t1,i]], {i,10,3112}]; t1 (* _Jayanta Basu_, May 03 2013 *)
%t A068653 cppQ[n_]:=Module[{c=FromDigits/@NestList[RotateLeft[#]&,IntegerDigits[n], IntegerLength[ n]-1]},CompositeQ[c[[1]]]&&AllTrue[Rest[c],PrimeQ]]; Select[ Range[10,5000],cppQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Sep 12 2014 *)
%o A068653 (Python)
%o A068653 from itertools import product
%o A068653 from sympy import isprime
%o A068653 A068653_list = []
%o A068653 for l in range(1,9):
%o A068653     for m in product(('1379' if l > 1 else '123579'),repeat=l):
%o A068653         for d in '0123456789':
%o A068653             s = ''.join(m)+d
%o A068653             n = int(s)
%o A068653             if not isprime(n):
%o A068653                 for k in range(len(s)-1):
%o A068653                     s = s[1:]+s[0]
%o A068653                     if not isprime(int(s)):
%o A068653                         break
%o A068653                 else:
%o A068653                     A068653_list.append(n) # _Chai Wah Wu_, May 06 2017
%Y A068653 Cf. A003459, A068652.
%K A068653 base,nonn
%O A068653 1,1
%A A068653 _Amarnath Murthy_, Feb 28 2002
%E A068653 Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jun 21 2002