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.

A293661 Base-8 circular primes that are not base-8 repunits.

This page as a plain text file.
%I A293661 #10 Jan 06 2018 22:06:38
%S A293661 13,29,31,41,43,47,59,61,607,719,751,761,971,1021,1657,1759,1787,1913,
%T A293661 1993,2011,2687,3019,3659,3673,3677,3803,3919,4073,49103,56299,62207,
%U A293661 105341,130681,177007,188249,195277,235513,237151,251501,259019,4127707,6807419
%N A293661 Base-8 circular primes that are not base-8 repunits.
%C A293661 Conjecture: The sequence is finite.
%C A293661 From _Michael De Vlieger_, Dec 30 2017: (Start)
%C A293661 Primes in this sequence must only have odd digits.
%C A293661 There are 8 terms with 2 octal digits, 20 terms with 4 octal digits, 12 terms with 6 octal digits, and 8 terms with 8 octal digits.
%C A293661 a(49), if it exists, must be larger than 8^12 = 68719476736. (End)
%e A293661 607 written in base 8 is 1137. The base-8 numbers 1137, 1371, 3711, 7113 written in base 10 are 607, 761, 1993, 3659, respectively, and all those numbers are prime, so 607, 761, 1993 and 3659 are terms of the sequence.
%t A293661 With[{b = 8}, Select[Prime@ Range[PrimePi@ b + 1, 10^6], Function[w, And[AllTrue[Array[FromDigits[RotateRight[w, #], b] &, Length@ w - 1], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* or *)
%t A293661 With[{b = 8}, Select[Flatten@ Array[FromDigits[#, b] & /@ Most@ Rest@ Tuples[Range[1, 7, 2], #] &, 6, 2], Function[w, And[ AllTrue[ Array[ FromDigits[ RotateRight[w, #], b] &, Length@ w], PrimeQ], Union@ w != {1} ]]@ IntegerDigits[#, b] &]] (* _Michael De Vlieger_, Dec 30 2017 *)
%o A293661 (PARI) 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 A293661 decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])
%o A293661 is_circularprime(p, base) = my(db=digits(p, base), r=rot(db), i=0); if(vecmin(db)==0, return(0), while(1, dec=decimal(r, base); if(!ispseudoprime(dec), return(0)); r=rot(r); if(r==db, return(1))))
%o A293661 forprime(p=1, , if(vecmin(digits(p, 8))!=vecmax(digits(p, 8)), if(is_circularprime(p, 8), print1(p, ", "))))
%Y A293661 Cf. A007094, A293142.
%Y A293661 Cf. base-b nonrepunit circular primes: A293657 (b=4), A293658 (b=5), A293659 (b=6), A293660 (b=7), A293662 (b=9), A293663 (b=10).
%K A293661 nonn,base
%O A293661 1,1
%A A293661 _Felix Fröhlich_, Dec 30 2017