%I #19 Dec 07 2019 12:18:28
%S 9551,23071,107647,115259,160681,229499,259379,270701,279919,301649,
%T 321221,352543,375341,402049,411683,422621,526963,654413,667559,
%U 692647,745981,755143,761731,805523,816691,875107,968819,1069561,1117603,1143091,1182487,1199683
%N Primes p such that p and prime(p) end with the same four digits.
%C Subsequence of A232189.
%H Colin Barker, <a href="/A271046/b271046.txt">Table of n, a(n) for n = 1..50</a>
%e 23071 is in the sequence because 23071 % 10000 = 3071, prime(23071) = 263071 and 263071 % 10000 = 3071.
%t Select[Prime@ Range[10^5], Mod[#, 10000] == Mod[Prime@ #, 10000] &] (* _Michael De Vlieger_, Mar 29 2016 *)
%o (PARI) L=List(); forprime(p=2, 1000000, if(p%10000==prime(p)%10000, listput(L, p))); Vec(L)
%o (Python)
%o from sympy import isprime,prime
%o for p in range(2,10**6):
%o if(prime(p)%10000==p%10000 and isprime(p)):print(p)
%o # _Soumil Mandal_, Apr 04 2016
%Y Cf. A232189, A271043, A271044, A271045.
%K nonn,easy,base
%O 1,1
%A _Colin Barker_, Mar 29 2016
|