%I #23 Jan 24 2020 03:22:48
%S 7,11,23,29,37,103,107,109,149,239,271,277,293,307,331,367,379,431,
%T 449,499,503,541,557,577,601,701,751,761,787,821,823,839,881,883,907,
%U 953,967,983,991,1031,1033,1097,1163,1171,1213,1223,1249,1289,1321,1433
%N Primes p such that p and prime(p) end with the same digit.
%C Subsequence of A067790.
%C Matches A067790 for the first eight terms. It appears that after that, most terms of that sequence are composite. For example, a(1000) = 37447, which is A067790(3751), meaning that that other sequence has 2751 composite terms less than 37447. - _Alonso del Arte_, Jan 23 2020
%H Colin Barker, <a href="/A271043/b271043.txt">Table of n, a(n) for n = 1..1000</a>
%e 29 is in the sequence because 29 mod 10 = 9, prime(29) = 109 and 109 mod 10 = 9 also.
%e 31 is not in the sequence because 31 mod 10 = 1 but prime(31) = 113 and 113 mod 10 = 3, not 1.
%t Select[Prime@ Range@ 250, Mod[#, 10] == Mod[Prime@ #, 10] &] (* _Michael De Vlieger_, Mar 29 2016 *)
%o (PARI) L=List(); forprime(p=2, 2000, if(p%10==prime(p)%10, listput(L, p))); Vec(L)
%o (Python)
%o from sympy import isprime,prime
%o for p in range(2,10**4):
%o if(prime(p)%10==p%10 and isprime(p)):print(p)
%o # _Soumil Mandal_, Apr 06 2016
%Y Cf. A067790, A271044, A271045, A271046.
%K nonn,easy,base
%O 1,1
%A _Colin Barker_, Mar 29 2016
|