Problems & Puzzles: Puzzles

Puzzle 1209  F(n)=1.5*(n^2)+16.1


Davide Rotondo sent the following nice puzzle:

The function 1.5*(n)^2+16.1 produces 61 consecutive unlucky primes taking into account that for n = 0 or even you must use the ceil function i.e. rounding up while for n = odd you must use the floor function i.e. rounding down.

The function is specular so the negative values are equal to the positive.

Also you must notice that F(0)=F(1).

See definitionof lucky numbers  are here.
The sequence of Lucky primes is on A031157;  and the Unlucky primes are in A166744.
n 1.5*n^2+16.1 Type
-30 1367 Unlucky Prime
-29 1277 Unlucky Prime
-28 1193 Unlucky Prime
-27 1109 Unlucky Prime
-26 1031 Unlucky Prime
-25 953 Unlucky Prime
-24 881 Unlucky Prime
-23 809 Unlucky Prime
-22 743 Unlucky Prime
-21 677 Unlucky Prime
-20 617 Unlucky Prime
-19 557 Unlucky Prime
-18 503 Unlucky Prime
-17 449 Unlucky Prime
-16 401 Unlucky Prime
-15 353 Unlucky Prime
-14 311 Unlucky Prime
-13 269 Unlucky Prime
-12 233 Unlucky Prime
-11 197 Unlucky Prime
-10 167 Unlucky Prime
-9 137 Unlucky Prime
-8 113 Unlucky Prime
-7 89 Unlucky Prime
-6 71 Unlucky Prime
-5 53 Unlucky Prime
-4 41 Unlucky Prime
-3 29 Unlucky Prime
-2 23 Unlucky Prime
-1 17 Unlucky Prime
0 17 Unlucky Prime
1 17 Unlucky Prime
2 23 Unlucky Prime
3 29 Unlucky Prime
4 41 Unlucky Prime
5 53 Unlucky Prime
6 71 Unlucky Prime
7 89 Unlucky Prime
8 113 Unlucky Prime
9 137 Unlucky Prime
10 167 Unlucky Prime
11 197 Unlucky Prime
12 233 Unlucky Prime
13 269 Unlucky Prime
14 311 Unlucky Prime
15 353 Unlucky Prime
16 401 Unlucky Prime
17 449 Unlucky Prime
18 503 Unlucky Prime
19 557 Unlucky Prime
20 617 Unlucky Prime
21 677 Unlucky Prime
22 743 Unlucky Prime
23 809 Unlucky Prime
24 881 Unlucky Prime
25 953 Unlucky Prime
26 1031 Unlucky Prime
27 1109 Unlucky Prime
28 1193 Unlucky Prime
29 1277 Unlucky Prime
30 1367 Unlucky Prime
31 1457 Composite

Rotondo claims that this function, F(n), when it happens to produce primes these are unlucky primes (no one single lucky prime).

Q1. Can you prove or refute the above Rotondo's claim

Q2. Can you find a better polynomial producing more consecutive primes only lucky or only unlucky?


From Feb.22 to 28, 2025, contributions came from Giorgos Kalogeropoulos, Emmanuel Vantieghem

***

Giorgos wrote:

Q1. First we prove that Rotondo's function gives values that are always congruent to 5 mod 6 :
a) If n is even then n=2k and the expression becomes
    1.5(2k)^2 + 16.1 = 6k^2 + 16.1 and if we take the ceiling 6k^2+17.
    Now, 6k^2 = 0 mod 6 and 17 = 5 mod 6
    So, for n even 6k^2+17 = 5 mod 6 
b) If n is odd then n=2k+1 and the expression becomes
    1,5(2k+1)^2+16.1 = 6k^2 + 6k + 17.6 and if we take the floor 6k^2 + 6k + 17.
    Now 6k^2 + 6k = 0 mod 6 and 17 = 5 mod 6.
    So, again the expression is congruent to 5 mod 6.
Thus, for any n this function is congruent to 5 mod 6
Now, if we take a look at the construction of lucky numbers, we will see that in the first step
we exclude all even numbers and in the second step we exclude 5,11,17,23... which are 
the numbers congruent to 5 mod 6. So, there doesn't exist any lucky number congruent to 5 mod 6.
But Rotondo's function outputs only numbers congruent to 5 mod 6, so if they are primes, they are 
primes of the form 5 mod 6 which mean they are unlucky primes.
In conclusion the function doesn't trace unlucky primes, it just outputs numbers 5 mod 6 and these 
numbers cannot be lucky.
Also, I would say that in reality we get 31 consecutive primes because n^2 is the same if n is 
positive or negative so we get the same 30 primes doubled.
Q2. Lucky numbers behave like prime numbers. So, it is easy to make a polynomial that produces only Unlucky numbers like P(n)=2Qn or P(n)=6Q(n)+5 (where Q(n) is any polynomial).  However, creating a polynomial that produces only lucky numbers is significantly harder, if not impossible. Moreover, lucky primes are rarer than unlucky primes, with their ratio approaching zero.
Here is my take:
A polynomial that produces 11 Lucky Primes for n=0 to 10.
Of course for bigger values of n we get all kinds of numbers (unlucky/lucky).
P(n) = 0.025 n^6 - 0.675 n^5 + 6.875 n^4 - 34.625 n^3  + 101.1 n^2 - 48.7 n + 43
For n = 0 to 10 we get the following  11 lucky primes:
43, 67, 163, 283, 421, 577, 739, 883, 991, 1087, 1291

...

Here is a polynomial that produces only unlucky numbers and we get 45 distinct unlucky primes for n=0 to 44
P(n) = Abs(36*n^2 - 810*n + 2753)
Abs means that we take the absolute value in each step.
Here are the 45 distinct unlucky primes for n=0 to 44:
2753, 1979, 1277, 647, 89, 397, 811, 1153, 1423, 1621, 1747, 1801, 1783, 1693, 1531, 1297, 991, 613, 163, 359, 953, 1619, 2357, 3167, 4049, 5003, 6029, 7127, 8297, 9539, 10853, 12239, 13697, 15227, 16829, 18503, 20249, 22067, 23957, 25919, 27953, 30059, 32237, 34487, 36809

***

Emmanuel wrote:

Q1. Davide's claim is right.

Indeed, let  F(n) = 1.5*n^2+16.1 =(15*n^2 + 161) / 10.

When  n = 2k+1  we have : Floor[n] = (15*(2k+1)^2 + 155) / 10 = 6*k^2 + 6*k + 17
When  n = 2k  we have  Ceiling[n] = (15*4*k^2 + 170) / 10 = 6*k^2 + 17.
Thus, Davide's numbers (prime or not) are always  6m + 5.
In Ulams' sieve, all the numbers of the form  6m + 5  are removed at the second step.

Thus, all numbers obtained by Davide are unlucky numbers.

Q2. I could not find a better formula.

***

 

Records   |  Conjectures  |  Problems  |  Puzzles