login
Primes of the form 299...977...7 with at least one 9 and one 7.
1

%I #14 Mar 06 2017 10:40:07

%S 299777,299977,29999777,299999977,2999999777,299999999777,

%T 2999977777777,299999999999977,2999999999977777777,

%U 2999999999999999977,299999999999977777777,299999999999999999977,2999999999999999777777

%N Primes of the form 299...977...7 with at least one 9 and one 7.

%C If the number of 7's modulo 3 equals 1, the corresponding 29..97..7 term cannot be in sequence because it is divisible by 3.

%C If the number of 9's modulo 6 equals 5, the corresponding 29..97..7 term cannot be in sequence because 299999 and 999999 are divisible by 7.

%C If the number of 7's and the number of 9's are both odd, the corresponding 29..97..7 term cannot be in sequence because it is divisible by 11.

%H Charles R Greathouse IV, <a href="/A283209/b283209.txt">Table of n, a(n) for n = 1..868</a>

%t Sort@ Select[Map[FromDigits@ Join[{2}, ConstantArray[9, #1], ConstantArray[7, #2]] & @@ # &, Select[Tuples[Range@ 20, 2], Times @@ Boole@ Map[OddQ, #] == 0 &]], PrimeQ] (* _Michael De Vlieger_, Mar 06 2017 *)

%o (PARI) do(n)=my(v=List(),p=29,q); for(d=3,n, p=10*p+7; q=p; forstep(i=d-3,1,-1, if(ispseudoprime(q+=2*10^i), listput(v,q)))); Vec(v) \\ _Charles R Greathouse IV_, Mar 06 2017

%K nonn,base

%O 1,1

%A _FUNG Cheok Yin_, Mar 03 2017

%E More terms from _Charles R Greathouse IV_, Mar 06 2017