login
Prime numbers which result as a concatenation of a decimal number and its binary representation.
1

%I #38 Apr 10 2024 03:31:43

%S 11,311,5101,131101,2511001,37100101,51110011,59111011,731001001,

%T 931011101,971100001,1191110111,12910000001,13110000011,13710001001,

%U 15310011001,17310101101,19311000001,21311010101,21511010111,24711110111,25511111111,319100111111

%N Prime numbers which result as a concatenation of a decimal number and its binary representation.

%C The decimal number plus its Hamming weight A000120 must not be divisible by 3. - _M. F. Hasler_, Apr 05 2024

%H Michael S. Branicky, <a href="/A317744/b317744.txt">Table of n, a(n) for n = 1..10000</a>

%e 11 is in the sequence because the binary representation of 1 is 1 and the concatenation of 1 and 1 gives 11, which is prime.

%e 931011101 is in the sequence because it is the concatenation of 93 and 1011101 (the binary representation of 93) and is prime.

%t Select[Table[FromDigits[Join[IntegerDigits[n],IntegerDigits[n,2]]],{n,400}],PrimeQ] (* _Harvey P. Dale_, Jul 15 2020 *)

%o (Python)

%o from sympy import isprime

%o def nbinn(n): return int(str(n)+bin(n)[2:])

%o def ok(n): return isprime(nbinn(n))

%o def aprefixupto(p): return [nbinn(k) for k in range(1, p+1, 2) if ok(k)]

%o print(aprefixupto(319)) # _Michael S. Branicky_, Dec 27 2020

%o (PARI) nb(n)=fromdigits(concat(n,binary(n)))

%o A317744_upto(N=666)=[p|n<-[1..N], is/*pseudo*/prime(p=nb(n))] \\ _M. F. Hasler_, Apr 05 2024

%Y Cf. A000040, A030458, A052087, A052088, A052089, A127421, A236551, A287300, A287310.

%K nonn,base,less

%O 1,1

%A _Philip Mizzi_, Aug 05 2018