Let: $$x=2$$ $$(x=2 \text{ gives greater of twin primes})$$ $$(x=4 \text{ gives greater of cousin primes and so on})$$ $$\text{ If }n=k \text{ then } t(n,k)= 1$$ $$\text{ else if } k=1 \text{ then } t(n,k)= 1-\frac{1}{2} \prod _{i=1}^{n-1} t(n,i+k)-\frac{1}{2} \prod _{i=1}^{n-1-x} t(n-x,i+k)$$ $$\text{ else if } n \bmod k=0 \text{ then } t(n,k) = t\left(\frac{n}{k},1\right) \text{ else } 1 \text{ else } 1$$
This is a table starting:
As a Mathematica program this is:
(*start*)
Clear[t, n, k, i, nn, a];
nn = 1000;
x = 2;
t[n_, k_] :=
t[n, k] =
If[n == k, 1,
If[k == 1, (1 - Product[t[n, k + i], {i, 1, n - 1}]/2 -
Product[t[n - x, k + i], {i, 1, n - 1 - x}]/2),
If[Mod[n, k] == 0, t[n/k, 1], 1], 1]];
Monitor[a = Table[t[n, 1], {n, 1, nn}];, n]
Flatten[Position[a, 0]]
(*end*)
which gives the first column from the table in the picture above:
$$a=1,0,0,\frac{1}{2},0,1,0,1,\frac{1}{2},1,\frac{1}{2},1,0,1,\frac{1}{2},1,\frac{1}{2},1,0,1,...$$
The positions of zeros in that sequence a is:
2, 3, 5, 7, 13, 19, 31, 43, 61, 73, 103, 109, 139, 151, 181, 193, 199, 229, 241, 271, 283, 313, 349, 421, 433, 463, 523, 571, 601, 619, 643, 661, 811, 823, 829, 859, 883
which matches sequence https://oeis.org/A006512 in the oeis starting:
5, 7, 13, 19, 31, 43, 61, 73, 103, 109, 139, 151, 181, 193, 199, 229, 241, 271, 283, 313, 349, 421, 433, 463, 523, 571, 601, 619, 643, 661, 811, 823, 829, 859, 883
and known as the greater of twin primes.
Looking up the positions that are fractions (not necessarily 1/2, that breaks down later) I get a match with the sequence https://oeis.org/A093514 starting:
4, 9, 11, 15, 17, 21, 23, 25, 29, 33, 37, 39, 41, 45,...
The title says it has something to do with the Sierpinski gasket given by the Rule 90 cellular automaton. Unfortunately I don't understand the Pari GP program given by the author.
Question:
Is it so that sequence $a$ (the first column in the table from the program) is always $0$ for $n>3$ if and only if the position is the greater of the twin primes?
An example of a prime triplet:
$$\text{ If }n=k \text{ then } t(n,k)= 1$$ $$\text{ else if } k=1 \text{ then } t(n,k)= 1-\frac{1}{3} \prod _{i=1}^{n-1} t(n,i+k)-\frac{1}{3} \prod _{i=1}^{n-1-2} t(n-2,i+k)-\frac{1}{3} \prod _{i=1}^{n-1-6} t(n-6,i+k)$$ $$\text{ else if } n \bmod k=0 \text{ then } t(n,k) = t\left(\frac{n}{k},1\right) \text{ else } 1 \text{ else } 1$$
https://oeis.org/A098413
Greatest members p of prime triples (p-6,p-2,p).
{2, 3, 5, 7, 13, 19, 43, 73, 103, 109, 199, 229, 283, 313, 463, 619, \
829, 859, 883}
Compared with:
{13, 19, 43, 73, 103, 109, 199, 229, 283, 313, 463, 619, 829, 859, 883,...}
(*start*)Clear[t, n, k, i, nn, a];
nn = 1000;
t[n_, k_] :=
t[n, k] =
If[n == k, 1,
If[k == 1, (1 - Product[t[n, k + i], {i, 1, n - 1}]/3 -
Product[t[n - 2, k + i], {i, 1, n - 1 - 2}]/3 -
Product[t[n - 6, k + i], {i, 1, n - 1 - 6}]/3),
If[Mod[n, k] == 0, t[n/k, 1], 1], 1]];
Monitor[a = Table[t[n, 1], {n, 1, nn}];, n]
Flatten[Position[a, 0]]
(*end*)
