2

I invented a recursive sequence below nearly 10 years ago, which assigns unity to every non-prime number and also gives all prime numbers. Do you think it is useful?!

Starting with $a_0=2$, we have:

$$a_{m+1}=2\prod_{i=0}^m(3+i)a_{m-i}^{-\sum_{k=1}^{3+m}\left\lfloor(3+m)a_{m-i}^{-k}\right\rfloor}$$

As pointed out by @MattiP., We indeed get:

$$2, 3, 1, 5, 1, 7, 1, 1, 1, 11, 1, 13, 1, 1, 1, 17,…$$

NOTE: There is a virtue about this recursive formula because, using a proper computer program, we can simplify the numerator and denominator of the produced fractions (for great values of $m$) before dividing/multiplying them by each other.

UPDATE: I also found the following recursive sequence in my old article. However, can anybody please verify its correctness using a computer program?!

$$a_{m+1}=\frac{m^2}{2}+\frac{7m}{2}+6-\sum_{i_m=0}^{(m+3)\operatorname{sgn}(a_m)}\space ... \space \sum_{i_1=0}^{(m+3)\operatorname{sgn}(a_1)}\space\sum_{i_0=0}^{(m+3)\operatorname{sgn}(a_0)}\left ( f(a_k,i_k,m)\operatorname{sgn}\left (\left\lfloor{\frac{m+3}{f(a_k,i_k,m)}}\right\rfloor\right )\right )$$

where

$$f(a_k,i_k,m)=\prod_{k=0}^{m}\left ( a_k+1-\operatorname{sgn}(a_k)\right )^{i_k}$$ The number of "sums" depends on $m$. Starting with $a_0=2$, it turns out that the sequence yields:

$$2, 3, 0, 5, 0, 7, 0, 0, 0, 11, 0, 13, 0, 0, 0, 17,…$$

  • 6
    Do you have a proof? What inspired you to find this? Thanks. – Benjamin Wang Oct 10 '22 at 08:32
  • @BenjaminWang The proof is not very similar to what we see in, say, ordinary mathematics articles. It is an "invitation" rather than a "discovery"! – Mohammad Javanshiry Oct 10 '22 at 08:36
  • @MohammadJavanshiry You mean "invention" not "invitation" in the above comment? – Dávid Laczkó Oct 10 '22 at 08:39
  • @DávidLaczkó Oh, yes, sorry. It was a typo. – Mohammad Javanshiry Oct 10 '22 at 08:42
  • Out of interest, I started to calculate the next number. For $m=-1$ (a bit odd but okay), we have $a_0 = 2$. Then for $m=0$, we have the expression for $a_1$ involving the following expression in the exponent: $$ \sum_{k=1}^3 \lfloor 3 \cdot a_0^k \rfloor = \lfloor \frac{3}{2} \rfloor + \lfloor \frac{3}{2^2} \rfloor + \lfloor \frac{3}{2^3} \rfloor = 1 + 0 + 0 = 1 $$ so the required exponent is $-1$. Is this what you mean by the equation? If we insert this to the expression, we get $$ a_1 = 2 (3+0) a_0 ^{-1} = \frac{2 \cdot 3}{2} = 3 $$ – Matti P. Oct 10 '22 at 09:21
  • I guess you have to change some indices in the equation then. Perhaps you mean $a_m$ instead of $a_{m+1}$ on the LHS? – Matti P. Oct 10 '22 at 09:27
  • @MattiP. Seems your calculations are correct, though I do not understand why I have to amend the LHS. – Mohammad Javanshiry Oct 10 '22 at 09:29
  • After the initial term $a_0 = 2$, we want to calculate $a_1$, right? So if you have a formula to calculate $a_{m+1}$ then that means that, in order to calculate $a_1$, we have to have $m=0$. – Matti P. Oct 10 '22 at 09:30
  • I calculated a few terms and I get the sequence $$ 2,~3,~1,~5,~1,~7,~1,~1,~1,~11,~1,~13,~1,~1,~1,~17, \ldots $$ Does it seem like correct? – Matti P. Oct 10 '22 at 09:34
  • 2
    It seems like, if you ignore all the 1's, it indeed lists all prime numbers. But then again, when the numbers gets larger, it becomes increasingly more expensive to calculate the next number. – Matti P. Oct 10 '22 at 09:37
  • @MattiP. Yes, that's correct. – Mohammad Javanshiry Oct 10 '22 at 09:37
  • 3
    Note: https://oeis.org/A089026 – Matti P. Oct 10 '22 at 09:38
  • @MattiP. Does this link use the same formula as mine? – Mohammad Javanshiry Oct 10 '22 at 09:44
  • As you see, there are several formulas listed for the sequence. But I don't know what else to comment about your specific approach. Just that, computationally, it can be a bit tricky due to rounding errors. It's easy to bump into situations involving $0^0 $ ... – Matti P. Oct 10 '22 at 09:48
  • 6
    To have at least a bit evidence that this formula is actually correct , it should be calculated far further , say , the first $10^7$ terms. Next, we should determine the effort needed to find , say , a $20$-digit prime. If this takes almost an eternity , the sequence is of little practical use , theoretically, it can still have some merit. – Peter Oct 10 '22 at 10:31
  • 4
    You should still prove / justify / explain this formula more! – FShrike Oct 12 '22 at 09:21
  • It takes value of prime number if input is a prime else it takes $1$ for composite numbers right @Mohammad Javanshiry? – RAHUL Oct 12 '22 at 10:07
  • @Rahul It takes the value of a prime number if the input of $m+2$ is a prime, otherwise it takes 1. – Mohammad Javanshiry Oct 17 '22 at 21:09
  • 3
    What is the question though? If whether we think it is useful, that is matter of opinion ... – Sil Oct 17 '22 at 22:08

0 Answers0