New answers tagged

0

Got it myself: list[x_, b_, c_] := Module[{list2}, list2 = Table[{a, b, c}, {a, 0, c - 1}]; list2] list3[a_, b_, c_] := Union[ Range[a, b, Prime[c]], Range[a + 2, b, Prime[c]]] list4 = Union @@@ Apply[list3, Tuples[Table[list[3, Prime[8], c], {c, 3 + 1, 5}]], {2}]


1

Defining Clear@list list[a_, b_, c_] := Union[Range[a, Prime[b], Prime[c]], Range[a + 2, Prime[b], Prime[c]]] we can get your list of Unions using the function Clear@list2 list2[n_, range_List] := Union @@ MapThread[list[#1, n, #2] &, {#, range}] & /@ Tuples[Range[0, # - 1] & /@ range]; where n is the 8 and range is the possible values for ...


1

Ok, I got one now. Took some of the ideas of other posts, but then calculated not based on the number between the twins of the twin prime pair, but based on the number $2$ less than the first. I first create a set $\equiv 3 \pmod 6$ as only these work, and I no longer need to check $2$ or $3$. Then I create a massive set of numbers 2 or 4 mod the set of ...


1

I was able to speed up @Hubble07's code by defining RelativePrimes[n_Integer, p_List] := Complement[Range[1, n - 1, 2], Apply[Sequence, Map[Range[#, n - 1, #] &, p]]] to find the values in set. The new function becomes twinPrime3[n_, m_] := Module[{set}, set = RelativePrimes[n, Prime[Range[2, m]]]; Max[Differences[Pick[Rest[set], ...


5

This function calculates the maximum fails for the given list upto n. It also shows the numbers which give these gaps. twinPrime[n_] := Module[{list = {2, 3, 5, 7, 11}, set, twinSet, max, res}, set = DeleteCases[Table[If[Count[Divisible[i, list], False] == Length[list], Sow[i]], {i, 1, n}], Null]; twinSet = Mean /@ Select[Partition[set, 2, 1], ...



Top 50 recent answers are included