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.

A286333 Primes p where all the cyclic shifts of their digits to the left also produce primes except the last one before reaching p again.

This page as a plain text file.
%I A286333 #46 May 24 2017 11:35:37
%S A286333 19,23,29,41,43,47,53,59,61,67,83,89,101,103,107,127,149,157,163,181,
%T A286333 191,307,317,331,359,367,701,709,727,739,757,761,787,797,907,937,941,
%U A286333 947,983,1103,1109,1123,1181,1301,1319,1327,1949,1951,1979,1987,1993,3121,3187,3361,3373,3701
%N A286333 Primes p where all the cyclic shifts of their digits to the left also produce primes except the last one before reaching p again.
%C A286333 a(144) = 733793111393, a(145) is larger than 10^16 (if it exists).
%C A286333 Can be considered as primitive terms of A270083, i.e. terms in A270083 can be obtained by cyclic shifts of the digits of terms in this sequence (and leading zeros are not allowed). - _Chai Wah Wu_, May 21 2017
%H A286333 Chai Wah Wu, <a href="/A286333/b286333.txt">Table of n, a(n) for n = 1..144</a>
%e A286333 1123 is a member as all the cyclic shifts of its digits to the left result are primes (1231, 2311) except the last one (3112) before reaching the original prime.
%t A286333 cyclDigs[k_]:= FromDigits/@ NestList[RotateLeft, IntegerDigits[k], IntegerLength[k]-1]; lftSftNearCircPrmsInBtw[m_, n_]:= ParallelMap[If[ AllTrue[Most[cyclDigs[#]], PrimeQ] && Not@ PrimeQ[Last[cyclDigs[#]]], #, Nothing] &, Prime @ Range[PrimePi[m], PrimePi[n]]];
%t A286333 lftSftNearCircPrmsInBtw[19, 10^7]
%o A286333 (Python)
%o A286333 from itertools import product
%o A286333 from sympy import isprime
%o A286333 A286333_list = []
%o A286333 for l in range(14):
%o A286333     for w in product('1379',repeat=l):
%o A286333         for d in '0123456789':
%o A286333             for t in '1379':
%o A286333                 s = ''.join(w)+d+t
%o A286333                 n = int(s)
%o A286333                 for i in range(l+1):
%o A286333                     if not isprime(int(s)):
%o A286333                         break
%o A286333                     s = s[1:]+s[0]
%o A286333                 else:
%o A286333                     if n > 10 and not isprime(int(s)):
%o A286333                         A286333_list.append(n) # _Chai Wah Wu_, May 21 2017
%Y A286333 Cf. A270083 (subsequence of), A286415.
%K A286333 nonn,base
%O A286333 1,1
%A A286333 _Mikk Heidemaa_, May 07 2017