# [seqfan] Re: Differences Between Some Primes (Stupid Question?)

Maximilian Hasler maximilian.hasler at gmail.com
Sun Nov 23 19:59:50 CET 2008

```On Sun, Nov 23, 2008 at 2:43 PM, Leroy Quet <q1qq2qqq3qqqq at yahoo.com> wrote:
> I just posted these sequences.
>
> %I A152073
> %S A152073 2,3,5,7,11,13,17,19,13,29,29,37,41
> %N A152073 a(n) = the largest prime < p(n) such that p(n) - a(n) is a power of 2, where p(n) is the nth prime.
> %C A152073 Does every odd prime differ from at least one lower prime by a power of 2? Or is this sequence not defined for some terms?
> %e A152073 Checking over the primes less than the 10th prime = 29: 29 - 23 = 6, not a power of 2. 29-19 = 10, not a power of 2. 29-17 = 12, not a power of 2. But 29-13 = 16, a power of 2. Since p = 13 is the largest prime p such that 29 - p = a power of 2, then a(10) = 13.
> %Y A152073 A139758
> %K A152073 more,nonn
> %O A152073 2,1

For p<1000 I get (where 0 means that the prime q<n does not exist):

forprime(p=1,10^3, q=p; while( q=precprime(q-1),
p-q==1<<valuation(p-q,2) & break); print1(q","))

0,2,3,5,7,11,13,17,19,13,29,29,37,41,43,37,43,59,59,67,71,71,79,73,89,97,101,103,107,109,0,127,73,137,0,149,149,131,163,157,163,179,
127,191,193,197,179,191,223,227,229,223,239,0,241,199,13,269,269,277,281,277,179,307,311,313,0,0,331,347,349,103,359,0,347,379,
373,389,397,401,163,419,367,431,431,439,433,449,457,461,463,463,479,487,491,499,0,457,521,509,419,541,547,313,569,569,571,577,
0,599,599,101,613,617,599,577,641,643,397,643,659,641,673,619,683,0,701,463,719,701,227,739,743,0,757,761,769,659,733,0,809,757,
821,823,827,823,821,853,857,859,0,877,881,883,0,907,911,673,929,937,883,937,839,967,0,967,983,0

The zeros occur for the following primes:

forprime(p=1,10^3, q=p; while( q=precprime(q-1),
p-q==1<<valuation(p-q,2) & break); q||print1(p","))

2,127,149,251,331,337,373,509,599,701,757,809,877,907,977,997,

Maximilian

```