login
Primes p such that p and the p-th prime have the same number of prime digits.
3

%I #12 Jan 20 2019 04:14:30

%S 2,3,7,17,37,47,73,83,89,97,113,163,179,193,197,251,347,359,383,397,

%T 421,431,443,487,541,547,571,593,607,617,631,653,673,677,719,727,743,

%U 751,761,787,821,829,857,877,881,883,947,971,1009,1013,1019,1021,1051,1087

%N Primes p such that p and the p-th prime have the same number of prime digits.

%C Prime digit = 2, 3, 5 or 7.

%e 2 is a term because 2 is prime, prime(2)=3, and 2 and 3 each have 1 prime digit.

%e 3 is a term because 3 is prime, prime(3)=5, and 3 and 5 each have 1 prime digit.

%e 4 is not a term because 4 is not prime.

%e 5 is prime, but prime(5)=11, and 5 has 1 prime digit while 11 has 0 prime digits, so 5 is not a term.

%p mm := proc (m) options operator, arrow: convert(m, base, 10) end proc: a := proc (n) local t, s, j: t := 0: s := 0: for j to nops(mm(n)) do if isprime(mm(n)[j]) = true then t := t+1 else end if end do: for j to nops(mm(ithprime(n))) do if isprime(mm(ithprime(n))[j]) = true then s := s+1 else end if end do: if isprime(n) = true and t = s then n else end if end proc: seq(a(n), n = 1 .. 1300); # _Emeric Deutsch_, Jan 28 2009

%Y Cf. A000040, A109066.

%K nonn,base

%O 1,1

%A _Juri-Stepan Gerasimov_, Jan 24 2009

%E Corrected (added 761, 857; deleted 977) and extended by _Emeric Deutsch_, Jan 28 2009

%E Edited by _Jon E. Schoenfield_, Jan 20 2019