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.

A293663 Circular primes that are not repunits.

This page as a plain text file.
%I A293663 #36 Aug 11 2024 14:41:34
%S A293663 2,3,5,7,13,17,31,37,71,73,79,97,113,131,197,199,311,337,373,719,733,
%T A293663 919,971,991,1193,1931,3119,3779,7793,7937,9311,9377,11939,19391,
%U A293663 19937,37199,39119,71993,91193,93719,93911,99371,193939,199933,319993,331999,391939
%N A293663 Circular primes that are not repunits.
%C A293663 Relative complement of A004022 in A068652.
%C A293663 Conjecture: The sequence is finite.
%C A293663 From _Michael De Vlieger_, Dec 30 2017: (Start)
%C A293663 Primes > 5 in this sequence must only have digits that are in the reduced residue system modulo 10, i.e., {1, 3, 7, 9}.
%C A293663 There are 54 terms that have 6 or fewer decimal digits, the largest of which is 999331.
%C A293663 a(55) must be larger than 10^11. (End) [Corrected by _Felix Fröhlich_, Mar 15 + 24 2019]
%C A293663 From _Felix Fröhlich_, Mar 16 2019: (Start)
%C A293663 a(55) > 10^23 if it exists (cf. De Geest link).
%C A293663 Numbers k such that A262988(k) = A055642(k). (End)
%H A293663 Felix Fröhlich, <a href="/A293663/b293663.txt">Table of n, a(n) for n = 1..54</a>
%H A293663 P. De Geest, <a href="https://www.worldofnumbers.com/circular.htm">Circular Primes</a>
%e A293663 The numbers resulting from cyclic permutations of the digits of 1193 are 1931, 9311 and 3119, respectively and all those numbers are prime, so 1193, 1931, 3119 and 9311 are terms of the sequence.
%t A293663 Select[Prime@ Range[10^5], Function[w, And[AllTrue[Array[FromDigits@ RotateRight[w, #] &, Length@ w - 1], PrimeQ], Union@ w != {1} ]]@ IntegerDigits@ # &] (* or *)
%t A293663 Select[Flatten@ Array[FromDigits /@ Most@ Rest@ Tuples[{1, 3, 7, 9}, #] &, 9, 2], Function[w, And[AllTrue[Array[FromDigits@ RotateRight[w, #] &, Length@ w], PrimeQ], Union@ w != {1} ]]@ IntegerDigits@ # &] (* _Michael De Vlieger_, Dec 30 2017 *)
%o A293663 (PARI) eva(n) = subst(Pol(n), x, 10)
%o A293663 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 A293663 is_circularprime(p) = my(d=digits(p), 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 A293663 forprime(p=1, , if(vecmax(digits(p)) > 1, if(is_circularprime(p), print1(p, ", "))))
%o A293663 (PARI) /* The following is a much faster program that only tests numbers whose decimal expansion consists of digits from the set {1, 3, 7, 9}. */
%o A293663 eva(n) = subst(Pol(n), x, 10)
%o A293663 next_v(vec) = my(k=#vec); if(vecmin(vec)==9, vec=concat(vector(#vec, t, 1), [3]); return(vec)); while(k > 0, if(vec[k]==9, vec[k]=1, if(vec[k]==3, vec[k]=7; return(vec), vec[k]=vec[k]+2, return(vec))); k--)
%o A293663 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 A293663 search(n) = my(d=digits(n), e=[], ed=0); while(1, e=rot(d); while(1, if(!ispseudoprime(eva(e)), break, e=rot(e); if(e==d && ispseudoprime(eva(e)), print1(eva(d), ", "); break))); d=next_v(d))
%o A293663 searchfrom(n) = if(n < 12, forprime(p=n, 10, print1(p, ", ")); search(13), my(d=digits(n)); for(k=1, #d, if(d[k]%2==0, d[k]++, if(d[k]==5, d[k]=7))); search(eva(d)))
%o A293663 /* Start a search from 1 upwards as follows: */
%o A293663 searchfrom(1) \\ _Felix Fröhlich_, Mar 23 2019
%Y A293663 Cf. A004022, A055642, A068652, A262988, A293142.
%Y A293663 Cf. base-b nonrepunit circular primes: A293657 (b=4), A293658 (b=5), A293659 (b=6), A293660 (b=7), A293661 (b=8), A293662 (b=9).
%K A293663 nonn,base
%O A293663 1,1
%A A293663 _Felix Fröhlich_, Dec 30 2017