4 ms·
Their picture is correct, but only because they are doing something more ridiculous than this. Every one of the squares in their picture represents 75 numbers,
by mathythrowaway 8y ago
Their picture is correct, but only because they are doing something more ridiculous than this. Every one of the squares in their picture represents 75 numbers, not 5 numbers.
- anderskaseorg 8y agoClick on the definition of T, and you see exactly the A054521 formula. T = (n, k) => { return (GCD(n, k) == 1) ? 1 : 0; } The given code doesn’t use primes, primesSet, or isPrime at all.
- mathythrowaway 8y agoBut that does produce a picture identical to theirs. Because they are using 75 numbers per square, they do end up hitting at least one prime in each box with (n,k)=1 for the first 75 rows. This pattern won't continue much longer, which is why they've conveniently stopped the picture at that point.
- _rpd 8y agoThe claim is that using N numbers per square will result in the pattern holding for N rows, for arbitrarily large N.
- anderskaseorg 8y agoEven if I’m misunderstanding how this is supposed to work for odd n, this claim fails for plenty of even n. n = 14: fails on row 13, col 3 n = 20: fails on row 17, col 8 n = 30: fails on row 17, col 7 n = 38: fails on row 37, col 8 n = 44: fails on row 31, col 2 n = 50: fails on row 43, col 13 …
- _rpd 8y agoThose are some pretty basic checks to miss. Perhaps I've misread OP's claim.
- Recursing 8y agoI think OP is a bit confused, the post is very ambiguous and on telegram he added more info but still hasn't fully formalized what he's trying to say
- shaunxcode 8y agoOP here - really it’s just a matter of I found a cool thing and wanted others ideas/input. I never had a pretense of a proof or a formalization just a cool pattern that emerges from folding the Ulam Spiral up a certain way. I think we were over zealous in the gcd triangle being an exact correspondence now as it clearly is not for some cells.
- airesearcher 8y agoThe pattern does not exactly match GCD as it turns out - but that makes it more curious actually. Here is the Mathematica code that does work for other values. Https://GitHub.com/shaunxcode/a-pattern-in-the-primes
- bustadjustme 8y agoFrom OP: > Interestingly, this same pattern holds for more numbers, and for different intervals. He's not claiming it holds for _all_ n, just for _many_ n.
- shaunxcode 8y agoI think you may misunderstand what terms are in a cell. For instance in your first example what numbers live there? In that observable you can run cellToTerms(row,n,binomialCoEfficient2,col) to get the terms. You can then chain .map(isPrime) (for reasonable sizes it is slurping in data to make testing faster). Those fns are there for interactivity I have not gotten around to adding yet.
- anderskaseorg 8y agoI used range(row * (row - 1) // 2 * n + col, row * (row + 1) // 2 * n + col, row) in Python. For n = 14, row = 13, col = 3, this is [1095, 1108, 1121, 1134, 1147, 1160, 1173, 1186, 1199, 1212, 1225, 1238, 1251, 1264] none of which are prime. cellToTerms(13, 14, binomialCoEfficient2, 3) in the observable gives the same list (though no such calls are made when generating the picture).
- shaunxcode 8y agoOk going back to the mathematica version that does it the slower primality testing per terms in cell way I am seeing the deviations meaning the gcd triangle is not an exact match to what we have here.
- airesearcher 8y agoHere is the code on GitHub - it renders it correctly and addresses the issues. Https://GitHub.com/shaunxcode/a-pattern-in-the-primes
- deleted 8y ago[deleted]
- anderskaseorg 8y agoCan you explain how that picture would be produced with 75 numbers per square? The generalization that seems obvious to me already fails in both cells of row 2, because 75 is odd: row 1, col 1: [1, 2, 3, …, 75], has primes row 2, col 1: [76, 78, 80, …, 224], no primes row 2, col 2: [77, 79, 81, …, 225], has primes
- tomsmeding 8y agoYou are completely right; their pattern holds iff (I believe, not proven!) the number they take 75 for is even. If you take any even number of rows (== amount of numbers per cell, in their construction), say 6, or 74, or 76, the pattern works.
- anderskaseorg 8y agoNo, it still fails for even n; see my other comment: https://news.ycombinator.com/item?id=17104624 https://news.ycombinator.com/item?id=17104624
- tomsmeding 8y agoFair point, I missed that. Scratch my claim. Then their claim that this pattern holds isn't even true; as pointed out elsewhere, and is obvious when you write out the sequence items explicitly in terms of their coordinates, any gcd!=1 cell will be red. But a gcd=1 cell need not be black, for many n.
- airesearcher 8y agoFrom what we have seen in our tests, the pattern holds for the number of rows n, where n = the number of integers contained in a cell. After n rows the symmetry breaks. We haven't tested every possible n yet however. It would be great to do more tests and let's see if there are exceptions.
- airesearcher 8y agoActually someone did point out an exception and it generates something very interesting we didn't see before. The pattern is different for odd n. But also has an interesting self-similarity. See the discussion on Telegram about this. https://t.me/joinchat/G8AnchIna2q8yn1lGHirkA https://t.me/joinchat/G8AnchIna2q8yn1lGHirkA
- deleted 8y ago[deleted]
- airesearcher 8y agoUPDATE: Thanks to comments from readers we have found that the pattern does not exactly match the GCD triangle for some values of the number of cells and rows. This possibly makes it a more interesting finding. But it also means we can’t use GCD to render it quickly for all values. In the code on Observable we were using GCD as a shortcut to render it because it saved time compared the earlier approach. However readers correctly pointed out that the rendering was not always correct using GCD. Now that we know GCD doesn’t apply to all values of n, we are reverting to the original code, which generates the correct renderings for all values - but is slower - and there will be an update on Observable soon. Meanwhile - to see the original code at work, and test it out for any value yourself, here is the Mathematica notebook code: Https://GitHub.com/shaunxcode/a-pattern-in-the-primes The Observable JavaScript code is being updated soon to account for this. Join the discussion in the Telegram group as well - details below.