The Dirty Dozen

60 views
Skip to first unread message

Tomasz Ordowski

unread,
Sep 1, 2025, 8:15:33 AM (6 days ago) Sep 1
to seq...@googlegroups.com
Hello! 

Numbers k > 2 such that (k - 2^m)*2^m + 1 is prime for every m > 0 with 2^m < k. 
I found twelve such numbers: 3, 4, 5, 7, 8, 13, 17, 22, 32, 38, 43, 52.  
Are there more than this dozen? Search further and further! 
For those interested, a similar formula: (k - 2^m)*2^m - 1. 
Cf. https://oeis.org/A039669 - The Magnificent Seven. 

Best, 

Tom Ordo 
_____________
The curious reader will notice a loose connection with the post.

Amiram Eldar

unread,
Sep 1, 2025, 8:58:59 AM (6 days ago) Sep 1
to SeqFan
I find that the next term is 223.

Tomasz Ordowski

unread,
Sep 1, 2025, 12:10:36 PM (6 days ago) Sep 1
to seq...@googlegroups.com
Ami, 
thanks to you, 
instead of the dirty dozen, 
we have the unlucky thirteen 
of these numbers, bravo! 
Can anyone find more?
Good luck,
Tom 

--
You received this message because you are subscribed to the Google Groups "SeqFan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seqfan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/seqfan/241d27af-e3ae-43e8-b0de-b07a51cddf68n%40googlegroups.com.

Tomasz Ordowski

unread,
Sep 2, 2025, 3:01:41 AM (6 days ago) Sep 2
to seq...@googlegroups.com
PS. Note that odd numbers k > 1 such that 
(k - 2^m)2^m + 1 is prime for 1 < 2^m < k 
are seven primes: 3, 5, 7, 13, 17, 43, 223.    
   Let a(n) be the number of primes 
(k - 2^m)2^m + 1 with 1 < 2^m < k, 
where k = 2n+1 for n > 0.
a(n) : 1, 2, 2, 0, 2, 3, 0, 4, 2, 0, 2, 2, ...  
Of course, this sequence is infinite. 
Records a(n) are 1, 2, 3, 4, 5, 7, ... 
where 2n+1 = 3, 5, 13, 17, 43, 223, ...
This can also be continued ad infinitum. 
   Conjecture: if a(n) is a record,
then k = 2n+1 is a prime.  
   Does this work? 
Message has been deleted
Message has been deleted
Message has been deleted

Tomasz Ordowski

unread,
Sep 2, 2025, 7:19:34 AM (5 days ago) Sep 2
to seq...@googlegroups.com, Ami Eldar
Hi Ami ! 

Yes, I see that the counterexamples are semiprimes.
Many thanks! 

Tom 

PS. Perhaps now our posts will appear in the SeqFan group.

wt., 2 wrz 2025 o 12:36 Amiram Eldar <amiram...@gmail.com> napisał(a):
Hi Tom,

I sent an answer to SeqFans but I got an "Message has been deleted" error message. I don't know what is wrong.

Here is my answer:

The following list is of n, 2*n+1, and the record value:

1, 3, 1
2, 5, 2
6, 13, 3
8, 17, 4
21, 43, 5
111, 223, 7
281, 563, 8
1638, 3277, 9
4563, 9127, 11
55991, 111983, 12
83153, 166307, 13
439236, 878473, 14
519063, 1038127, 15
1253421, 2506843, 16

3277, 111983, 166307, and 878473 are not primes.

Best,
Ami


You received this message because you are subscribed to a topic in the Google Groups "SeqFan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/seqfan/HXbjgqOQCUw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to seqfan+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/seqfan/CAF0qcNPNGaeE%2BTnqyVMsuYH3royrf2bfG8ULgHrx6j_c_pRBbg%40mail.gmail.com.

Amiram Eldar

unread,
Sep 2, 2025, 9:20:06 AM (5 days ago) Sep 2
to SeqFan

The following list is of n, 2n+1, and the record values:

1, 3, 1
2, 5, 2
6, 13, 3
8, 17, 4
21, 43, 5
111, 223, 7
281, 563, 8
1638, 3277, 9
4563, 9127, 11
55991, 111983, 12
83153, 166307, 13
439236, 878473, 14
519063, 1038127, 15
1253421, 2506843, 16

3277, 111983, 166307, and 878473 are not primes.

Message has been deleted

flying truce

unread,
Sep 2, 2025, 3:31:47 PM (5 days ago) Sep 2
to seq...@googlegroups.com
Sorry I made a mistake in my message, 11 should not be in the list, I am unclear how to fix this bug but I'm fairly sure it doesn't affect the other items in the sequence

On Tue, Sep 2, 2025 at 7:10 PM flying truce <flying...@gmail.com> wrote:
I believe the next term in this sequence is 487, and that there was a missed term 11 at the start.
here is my python code, change the value 600 to adjust the k searched up to, removing the print lines will make it run faster.

here is the sequence up to k = 1200 according to my program
[2, 3, 4, 5, 7, 8, 11, 13, 17, 22, 32, 38, 43, 52, 223, 487, 652]

from math import sqrt, log10, floor
def isPrime(num):
    a=2
    while a<=sqrt(num):
        if num%a<1:
            return False
        a=a+1
    return num>1

sequence = []
for k in range(2, 600):
    limit = log10(k)/log10(2)
    prime = False
    for m in range(1, floor(limit)):
        if isPrime((k - 2**m) * (2**m) + 1):
            prime = True
        else:
            prime = False
            break
    if prime == True:
        sequence.append(k)
        print("yes for", k, "! ! ! ! ! ! !")
    else:
        print("NO for", k)

print(sequence)


On Tue, Sep 2, 2025 at 2:20 PM Amiram Eldar <amiram...@gmail.com> wrote:
The following list is of n, 2*n+1, and the record value:

1, 3, 1
2, 5, 2
6, 13, 3
8, 17, 4
21, 43, 5
111, 223, 7
281, 563, 8
1638, 3277, 9
4563, 9127, 11
55991, 111983, 12
83153, 166307, 13
439236, 878473, 14
519063, 1038127, 15
1253421, 2506843, 16

3277, 111983, 166307, and 878473 are not primes.

On Tuesday, September 2, 2025 at 10:01:41 AM UTC+3 tomaszo...@gmail.com wrote:

flying truce

unread,
Sep 2, 2025, 3:31:58 PM (5 days ago) Sep 2
to seq...@googlegroups.com
Message has been deleted

Robert Price

unread,
Sep 2, 2025, 5:57:57 PM (5 days ago) Sep 2
to SeqFan
487 and 652 are not in the list.
Both result in a composite at m=8 and m=9 respectively.
No other entries <10^7.


 k = 487;
m = 8;
x = (k - 2^m)*2^m + 1
PrimeQ[x]

k = 652;
m = 9;
x = (k - 2^m)*2^m + 1
PrimeQ[x]

Out[116]= 59137

Out[117]= False

Out[120]= 71681

Out[121]= False

flying truce

unread,
Sep 2, 2025, 6:22:50 PM (5 days ago) Sep 2
to seq...@googlegroups.com
Yeah I realised, it appears my program was complete garbage, here is the updated version which hasn't found anything above 223.

from math import sqrt, log10, floor
def isPrime(num):
    a = 2
    while a <= sqrt(num):
        if num%a < 1:
            return False
        a = a + 1
    return num > 1

sequence = []

for k in range(3, 10000):
    limit = log10(k)/log10(2)
    counter = 0
    for m in range(1, floor(limit)+1):

        if isPrime((k - 2**m) * (2**m) + 1):
            counter += 1
        else:
            if k == 2**(floor(limit)) and counter == floor(limit) - 1:
                counter += 1
                break
    if counter == floor(limit):
        sequence.append(k)

print(sequence)

Reply all
Reply to author
Forward
0 new messages