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.

Previous Showing 11-13 of 13 results.

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.

Original entry on oeis.org

19, 23, 29, 41, 43, 47, 53, 59, 61, 67, 83, 89, 101, 103, 107, 127, 149, 157, 163, 181, 191, 307, 317, 331, 359, 367, 701, 709, 727, 739, 757, 761, 787, 797, 907, 937, 941, 947, 983, 1103, 1109, 1123, 1181, 1301, 1319, 1327, 1949, 1951, 1979, 1987, 1993, 3121, 3187, 3361, 3373, 3701
Offset: 1

Views

Author

Mikk Heidemaa, May 07 2017

Keywords

Comments

a(144) = 733793111393, a(145) is larger than 10^16 (if it exists).
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

Examples

			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.
		

Crossrefs

Cf. A270083 (subsequence of), A286415.

Programs

  • Mathematica
    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]]];
    lftSftNearCircPrmsInBtw[19, 10^7]
  • Python
    from itertools import product
    from sympy import isprime
    A286333_list = []
    for l in range(14):
        for w in product('1379',repeat=l):
            for d in '0123456789':
                for t in '1379':
                    s = ''.join(w)+d+t
                    n = int(s)
                    for i in range(l+1):
                        if not isprime(int(s)):
                            break
                        s = s[1:]+s[0]
                    else:
                        if n > 10 and not isprime(int(s)):
                            A286333_list.append(n) # Chai Wah Wu, May 21 2017

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

Original entry on oeis.org

14, 16, 32, 34, 35, 38, 74, 76, 91, 92, 95, 98, 118, 119, 133, 176, 194, 316, 398, 712, 715, 731, 736, 772, 775, 778, 779, 793, 794, 914, 935, 973, 1118, 1195, 1312, 1336, 1774, 1937, 3112, 3199, 3337, 3379, 3394, 3772, 3992, 7132, 7198, 7318, 7376, 7771, 7912
Offset: 1

Views

Author

Philip Mizzi, Jun 13 2018

Keywords

Comments

Numbers with a zero digit have been excluded as cycling through these numbers would generate leading zeros, which become problematic throughout the cycle.
3999131, 7919777, 37177739 and 391331191 are in this sequence, see the link. - Eric Chen, Jun 14 2018
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

Examples

			N_0 = 1118 (composite);
N_1 = 1181 (prime);
N_2 = 1811 (prime);
N_3 = 8111 (prime);
N_4 = N_0 = 1118 (composite).
		

Crossrefs

Programs

  • Maple
    Q[1]:= [seq([i],i=1..9)]:
    for d from 2 to 7 do Q[d]:= map(t -> seq([i,op(t)],i=1..9),Q[d-1]) od:
    Res:= NULL: count:= 0:
    for d from 2 to 7 do
      for q in Q[d] do P[q]:= isprime(add(q[i]*10^(i-1),i=1..d)) od;
      for q in Q[d] do
         if (not P[q]) and andmap(t -> P[ListTools:-Rotate(q,t)],[$1..d-1]) then
           count:= count+1;
           Res:= Res, add(q[i]*10^(i-1),i=1..d);
         fi
      od
    od:
    Res; # Robert Israel, Jul 10 2018
  • Mathematica
    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 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    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
    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))))
    forcomposite(c=1, 8000, if(is(c), print1(c, ", "))) \\ Felix Fröhlich, Jul 10 2018

Formula

{ A052382 } intersection { A068653 }.
{ A068653 } minus { A011540 }.

A327822 Numbers k such that when cyclically permuting the digits of k any number of times, any prime obtained is followed by a composite number and vice-versa.

Original entry on oeis.org

14, 16, 19, 20, 23, 29, 30, 32, 34, 35, 38, 41, 43, 47, 50, 53, 59, 61, 67, 70, 74, 76, 83, 89, 91, 92, 95, 98, 1015, 1018, 1070, 1075, 1099, 1132, 1136, 1163, 1216, 1238, 1274, 1303, 1321, 1339, 1361, 1475, 1510, 1517, 1535, 1570, 1574, 1612, 1630, 1631, 1636
Offset: 1

Views

Author

Felix Fröhlich, Sep 26 2019

Keywords

Examples

			When cyclically permuting the digits of 961990 one gets the numbers 961990, 619909, 199096, 990961, 909619, 96199 and these numbers are composite, prime, composite, prime, composite, prime, respectively, so 961990 (and each of these cyclic permutations except 96199) is a term of the sequence.
A more graphical representation:
       961990              C
      /      \           /   \
  096199   619909       P     P
     |        |         |     |
  909619   199096       C     C
      \      /           \   /
       990961              P
		

Crossrefs

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    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
    is(n) = my(nn=#Str(n), u=[], v=vector(nn, x, x%2==0), w=vector(nn, x, x%2==1), d=digits(n), r=rot(d)); if(nn%2==1, return(0)); u=concat(u, [ispseudoprime(eva(d))]); u=concat(u, ispseudoprime(eva(r))); while(1, r=rot(r); if(r==d, if(u==v || u==w, return(1)); return(0)); u=concat(u, ispseudoprime(eva(r))))
Previous Showing 11-13 of 13 results.