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!)
A214754 Primes that can be written in binary representation as a concatenation of odd primes. 1

%I #11 Aug 03 2012 10:28:35

%S 23,29,31,47,59,61,71,79,109,113,127,151,157,167,179,191,223,229,233,

%T 239,241,251,271,283,317,349,359,367,373,379,383,431,433,439,457,463,

%U 467,479,487,491,499,503,509,541,563,599,607,631,701,719,727,733,743,751,757

%N Primes that can be written in binary representation as a concatenation of odd primes.

%C Subsequence of A090423.

%e 31 is 11111 in binary, 11 is 3 in decimal, 111 is 7, partition exists: 11_111, so 31 is in the sequence.

%o (Python)

%o # oddPrimes = [3, ... , 757]

%o def tryPartioning(binString): # First digit is not 0

%o if binString=='10':

%o return 0

%o l = len(binString)

%o for t in range(2, l-1):

%o substr1 = binString[:t]

%o if (int('0b'+substr1,2) in oddPrimes) or (t>=4 and tryPartioning(substr1)):

%o substr2 = binString[t:]

%o if substr2[0]!='0':

%o if (int('0b'+substr2,2) in oddPrimes) or (l-t>=4 and tryPartioning(substr2)):

%o return 1

%o return 0

%o for p in oddPrimes:

%o if tryPartioning(bin(p)[2:]):

%o print p,

%Y Cf. A090423.

%K nonn,base

%O 1,1

%A _Alex Ratushnyak_, Aug 03 2012

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 29 08:59 EDT 2024. Contains 371268 sequences. (Running on oeis4.)