login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A253252 Twin primes with equal number of odd and even digits. 1

%I #27 Jun 08 2015 13:52:23

%S 29,41,43,61,1021,1049,1061,1063,1229,1289,1427,1429,1481,1483,1487,

%T 1489,1607,1609,1621,1667,1669,2129,2141,2143,2237,2239,2309,2341,

%U 2381,2383,2549,2657

%N Twin primes with equal number of odd and even digits.

%C Note that there are the lesser of twin primes (A001359) such as 29, 1049, 1229, 1289, 2129, 2309, 2549, 2729, 2789, 2969, 4019, 4259, 5009,...; the greater of twin primes (A006512) such as 61, 1021, 1621, 2341, 3001, 4051, 4231, 4651, 5281,....; and both terms of twin prime pairs (A001097) such as {41,43}, {1061,1063}, {1427,1429}, {1481,1483}, {1487,1489}, {1607,1609}, {1667,1669}, {2141,2143}, {2237,2239}, {2381,2383}, {2657,2659}, {3461,3463}, {3467,3469}, {3821,3823}, {4091,4093}, {4127,4129}, {4217,4219}, {4271,4273}, {4547,4549}, {4637,4639}, {4721,4723}, {4787,4789}, {4967,4969}, {5021,5023}, ....

%H Charles R Greathouse IV, <a href="/A253252/b253252.txt">Table of n, a(n) for n = 1..10000</a>

%p Primes:= select(isprime,{seq(2*i+1,i=1..5000)}):

%p Twins:= map(t -> (t,t+2), Primes intersect map(`-`,Primes,2)):

%p filter:= proc(n) local L,Lo,Le;

%p if ilog10(n)::even then return false fi;

%p L:= convert(n,base,10);

%p Lo,Le:= selectremove(type,L,odd);

%p nops(Lo)=nops(Le)

%p end proc:

%p sort(convert(select(filter,Twins),list)); # _Robert Israel_, Jun 08 2015

%t Select[Prime@ Range@ 500, Plus @@ BitAnd[ IntegerDigits@#, 1] == IntegerLength[#]/2 && Or @@ PrimeQ[# + {2, -2}] &] (* _Giovanni Resta_, Jun 08 2015 *)

%o (PARI) is(n)=my(d=digits(n)); #d%2==0 && sum(i=1,#d,d[i]%2)==#d/2 && isprime(n) && (isprime(n+2)||isprime(n-2)) \\ _Charles R Greathouse IV_, Jun 08 2015

%Y Subsequence of A144226.

%Y Cf. A001097, A001359, A006512.

%K base,nonn

%O 1,1

%A _Zak Seidov_, Jun 07 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 22:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)