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!)
A296806 Take a prime, convert it to base 2, remove its most significant digit and its least significant digit and convert it back to base 10. Sequence lists primes that generate another prime by this process. 3

%I #43 May 16 2022 08:53:02

%S 13,23,31,37,43,47,59,71,79,103,127,139,151,163,167,191,211,223,251,

%T 263,271,283,331,379,463,523,547,571,587,599,607,619,631,647,659,691,

%U 719,727,739,787,811,827,839,859,907,911,967,971,991,1031,1039,1051,1063,1087

%N Take a prime, convert it to base 2, remove its most significant digit and its least significant digit and convert it back to base 10. Sequence lists primes that generate another prime by this process.

%C From an idea of Ken Abbott (see link).

%C From _Paolo Iachia_, Dec 21 2017: (Start)

%C Let us call these numbers "core of a prime".

%C Let C(q) be the core of a prime q.

%C Then C(q) = (q - 2^floor(log_2(q)) - 1)/2.

%C Examples: C(59) = (59 - 2^5 - 1)/2 = 13; C(71) = (71 - 2^6 - 1)/2 = 3; C(73) = (73 - 2^6 - 1)/2 = 4; C(251) = (251 - 2^7 - 1)/2 = 61.

%C 0 <= C(q) <= 2^(floor(log_2(q)) - 1) - 1. The minimum (0) occurs when q = 2^n+1, with n > 2. Example: 17 = 2^4+1, C(17) = (17 - 2^4 - 1)/2 = 0. The maximum is reached when q = 2^n-1 is a Mersenne prime. Example: 127 = 2^7 - 1, C(127) = (127 - 2^6 - 1)/2 = 31 = 2^5 - 1.

%C The last example is particularly interesting, as both the prime q and its core are Mersenne primes. The same holds for C(31) = 7 and for C(524247) = 131071, with 524247 = 2^19-1 and 131071 = 2^17-1, both Mersenne primes. Are there more such cases?

%C Note that the core of Mersenne number (prime or not) is a Mersenne number by definition. Counterexamples include C(8191) = 2047, with 8191 = 2^13 - 1, a Mersenne prime, but 2047 = 2^11 - 1 = 23*89, a Mersenne number not prime, and C(131071) = 32767 = 2^15 - 1 = 7*31*151, with 2 of its factors being Mersenne primes.

%C Primes whose binary expansion is of the form q = 1 0 ... 0 c_1 c_2 ... c_k 1 - with none or any number of consecutive 0's and with binary core c_1 c_2 ... c_k, k >= 0 - share the same core value. Let p = C(q), then we can write, in decimal form, q = (2p+1) + 2^n, for an appropriate n. While the property is true for p prime, it can be generalized to any positive integer.

%C Conjecture: for any positive integer p, there are infinitely many primes q for which there exists an integer n such that q-(2p+1) = 2^n. (End)

%H Iain Fox, <a href="/A296806/b296806.txt">Table of n, a(n) for n = 1..10000</a>

%H Ken Abbott, <a href="https://www.linkedin.com/groups/4510047/4510047-6347101799618531332">Prime Cores</a>, Number Theory group on LinkedIn.

%F Primes q such that C(q) = (q - 2^floor(log_2(q)) - 1)/2 is prime too.

%e 13 in base 2 is 1101 and 10 is 2;

%e 23 in base 2 is 10111 and 011 is 3;

%e 31 in base 2 is 11111 and 111 is 7.

%p with(numtheory): P:=proc(q) local a,b,c,j,n,ok,x; x:=5; for n from x to q do ok:=1; a:=convert(ithprime(n),base,2); b:=nops(a)-1; while a[b]=0 do b:=b-1; od; c:=0;

%p for j from b by -1 to 2 do c:=2*c+a[j]; od;if isprime(c) then x:=n; print(ithprime(n)); fi; od; end: P(10^6);

%p # simpler alternative:

%p select(t -> isprime(t) and isprime((t - 2^ilog2(t) - 1)/2), [seq(i,i=3..10^4,2)]); # _Robert Israel_, Dec 28 2017

%t Select[Prime[Range[200]],PrimeQ[FromDigits[Most[Rest[IntegerDigits[ #,2]]],2]]&] (* _Harvey P. Dale_, Jul 19 2020 *)

%o (PARI) lista(nn) = forprime(p=13, nn, if(isprime((p - 2^logint(p, 2) - 1)/2), print1(p, ", "))) \\ _Iain Fox_, Dec 28 2017

%o (Python)

%o from itertools import islice

%o from sympy import isprime, nextprime

%o def agen(): # generator of terms

%o p = 7

%o while True:

%o if isprime(int(bin(p)[3:-1], 2)):

%o yield p

%o p = nextprime(p)

%o print(list(islice(agen(), 54))) # _Michael S. Branicky_, May 16 2022

%Y Cf. A000030, A000225, A001348, A004676, A010879, A057195, A057196, A059242, A123250, A296807.

%K nonn,base,easy

%O 1,1

%A _Paolo P. Lava_, _Paolo Iachia_, Dec 21 2017

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 April 23 14:32 EDT 2024. Contains 371914 sequences. (Running on oeis4.)