[seqfan] Re: Producing primes from powers of 2

Jack Brennen jfb at brennen.net
Thu Jan 28 16:32:43 CET 2021


Here's a PARI/GP program which duplicates the series given by Ali:

accum=0;inc=2;forprime(p=2,99,while(accum+inc<p,inc*=2);accum+=inc-p;print(accum));

A better description that makes sense to me...

Sequence A:   2, 3, 5, 7, 11, 13, ...

Sequence B:   2, 4, 4, 8, 16, 16, ...

Sequence C:   0, 1, 0, 1, 6, 9, ...

Sequence A is the primes.  Sequence B is the "smallest" sequence of 
non-decreasing powers of two whose sum over the first N terms is at 
least equal to the sum over the first N terms of Sequence A.  Sequence C 
is the amount by which the sum of the first N terms of Sequence B 
exceeds the sum of the first N terms of Sequence A.



On 1/28/2021 7:32 AM, David Corneth wrote:
> Is this a(0) = 0, a(n) = (Least power greater than or equal to (prime(n) -
> a(n-1))) - prime(n) + a(n-1)?
>
> On Wed, Jan 27, 2021 at 10:20 AM Ali Sada via SeqFan <seqfan at list.seqfan.eu>
> wrote:
>
>> Hi Everyone,
>>
>> We want to produce prime numbers out of “blocks” of powers of 2. Each time
>> we use one block in addition to the remains of the previous block. When we
>> start using a block of size 2^k, we cannot go back later and use smaller
>> blocks.
>>
>> To get 2, we need a block of 2. So, a(1) = 2-2 = 0
>>
>> a(1) = 0
>>
>> To get 3, we need a block of 4. So, a(2) = 4-3 = 1
>>
>> a(2) = 1
>>
>> To get 5, we need a block of 4 in addition to the remains of the previous
>> block. a(3) = 4+1-5 = 0.
>>
>> a(3) = 0
>>
>> We continue:
>>
>> a(4) = 8-7 = 1
>>
>> a(5) = 16+1-11= 6
>>
>> a(6) = 16+6-13 = 9
>>
>> a(7) = 16+9-17= 8
>>
>> a(8) = 16+8-19 = 5
>>
>> a(9) = 32+5-23 = 14
>>
>> and so on.
>>
>> This is the sequence we get:
>>
>> 0, 1, 0, 1, 6, 9, 8, 5, 14, 17, 18, 13, 4, 25, 42, 53, 58, 61, 58, 51, 42,
>> 27, 8, 47, 78, 105, 130, 151, 170, 185, 186, 183, 174, 163, 142, 119, 90,
>> 55, 16, 99, 176, 251, 316, 379, 438, 495, 540, 573, 602, 629, 652, 669,
>> 684, 689, 688, 681, 668, 653, 632, 607, 580, 543, 492, 437, 380, 319, 244,
>> 163, 72
>>
>>
>>
>> I calculated 10,000 terms, and the graph seems like a “smooth”
>> quasiperiodic function.
>>
>>
>> I would really appreciate your help defining this sequence.
>>
>>
>> Best,
>>
>>
>> Ali
>>
>>
>>
>> --
>> Seqfan Mailing list - http://list.seqfan.eu/
>>
> --
> Seqfan Mailing list - http://list.seqfan.eu/
>
>



More information about the SeqFan mailing list