본문으로 이동
Number Buffet

울람 나선 좌표

가운데 칸에서 정수를 바깥으로 감아 나가며 소수를 표시합니다. 1963년 스타니스와프 울람이 모눈종이에서 알아챈 대각선이 드러납니다.

4분 분량

설정

빠른 설정

Odd sizes put the starting number exactly in the middle; an even size is rounded up by one.

The spiral runs from here to start + size² − 1. Try 41 for Euler’s prime-rich diagonal.

The grids are monospace art; the coordinate lists are data, one cell per row in spiral order.

Only used by the marked grid.

Pads each column with a space so the square grid reads square in a monospace font, where character cells are about twice as tall as they are wide.

모양 미세 조정

먼저 이미지 옆의 설정을 고르세요. 아래 조절기가 그것을 다듬습니다.

Frame

A border drawn inside the edge of the image.

고급

결과

25개 값

█ · · · · · █ · █ · · · · · █ · · · · · █ · · · ·, · · · · · · · █ · · · · · · · · · · · █ · · · █ ·, · · █ · · · █ · · · · · · · █ · · · · · █ · · · ·, · █ · · · · · · · · · █ · · · █ · █ · · · █ · █ ·, · · · · █ · · · · · █ · · · · · · · · · █ · █ · ·, · · · · · █ · · · █ · █ · · · · · · · · · · · · ·, · · · · · · · · · · · · █ · █ · · · · · █ · · · █, · █ · · · █ · █ · · · █ · · · · · · · █ · · · █ ·, · · · · · · · · · · · · █ · █ · · · █ · · · · · ·, · · · █ · · · █ · █ · · · · · █ · █ · █ · · · · ·, █ · █ · █ · █ · █ · █ · · · █ · · · · · · · █ · ·, · · · · · · · · · · · █ · █ · █ · · · · · · · · ·, · · · · · · █ · · · █ · · █ █ · █ · █ · █ · · · █, · · · · · · · █ · █ · █ · · · · · · · · · · · · ·, · · · · · · · · █ · · · █ · · · · · · · · · · · ·, · █ · █ · · · █ · █ · · · █ · · · █ · █ · · · █ ·, █ · · · █ · · · █ · · · · · █ · · · · · █ · █ · ·, · · · · · · · · · █ · · · · · · · · · · · █ · · ·, · · · · █ · █ · · · · · █ · · · █ · · · █ · · · ·, · █ · · · █ · · · · · · · · · · · █ · · · · · · ·, · · █ · · · · · █ · · · █ · █ · · · · · · · · · ·, · · · · · · · █ · █ · · · █ · · · · · █ · · · █ ·, █ · █ · · · · · · · · · █ · █ · · · · · █ · · · ·, · · · █ · · · · · · · · · · · █ · █ · · · · · · ·, █ · · · · · █ · · · · · █ · · · █ · █ · · · · · ·

25×25 = 625 consecutive integers, 1 to 625, of which 114 are prime (18.2%). 1 sits in the middle; the walk goes right, then up, then left, and so on outward. Columns are space-padded to keep the grid square on screen.


이미지 만들기

이 숫자를 꾸며 이미지로 내려받으려면 자바스크립트를 켜세요. 값 자체는 위에 나열되어 있습니다.

Text on the image

Drag a line straight onto the picture to place it — once placed, it stays exactly where you put it. Everything here is drawn into the download.

아래의 배경 설명은 아직 번역되지 않아 영어로 표시됩니다.

울람 나선 좌표 소개

Stanisław Ulam found the pattern in 1963. Martin Gardner's account has him doodling through the presentation of a long and very boring paper at a scientific meeting: he wrote the integers in a square spiral on graph paper and circled the primes, and they did not scatter — they clumped along diagonal lines. Ulam was by then a senior figure at Los Alamos — Manhattan Project, the Teller–Ulam design, the Monte Carlo method — so he had a computer within reach. With Myron Stein and Mark Wells he used the laboratory's MANIAC II to extend the picture to roughly 100,000 points. It reached a general audience in March 1964, when Scientific American ran Gardner's Mathematical Games column on the spiral and put it on the front cover of that issue.

The diagonals are real, and they stop being mysterious once you ask what a line in the spiral is. Walk outward from the centre along any ray — diagonal, horizontal or vertical — and the values have a constant second difference of 8, so each ray is the value set of some quadratic 4x² + bx + c. Some quadratics are much richer in primes than others. Euler published the extreme case in 1772: x² + x + 41 is prime for every x from 0 to 39. Centre a spiral on 41 and that polynomial falls along one diagonal, which duly shows up as an unbroken streak of forty primes.

How much richer a given quadratic is was addressed by G. H. Hardy and J. E. Littlewood in their 1923 Partitio Numerorum paper on the Goldbach conjecture. Its Conjecture F asserts an asymptotic formula for the number of primes of the form ax² + bx + c, with a constant depending on the particular polynomial; the predicted densities differ enough between polynomials to produce exactly the light-and-dark contrast the eye picks out. Conjecture F remains unproven, and the gap is wider still: nobody has shown that any irreducible quadratic represents infinitely many primes. The x² + 1 case is Landau's fourth problem, posed in 1912 and still open.

A note on priority: in 1932, thirty-one years before Ulam's doodle, the herpetologist Laurence Klauber constructed a triangular, non-spiral array of the integers that shows much the same prime-rich lines. Gardner mentioned it only in a later addendum.

주요 성질

  • The walk places the centre number, then the consecutive integers one cell at a time — right, up, left, left, down, down, right, right, right — with run lengths 1, 1, 2, 2, 3, 3, and so on, which fills an odd n×n square in exactly n² cells and ends in a corner.
  • A grid of n cells per side therefore spans exactly n² consecutive integers: 101×101 covers 10,201 of them.
  • Consecutive integers occupy orthogonally adjacent cells, so a number’s parity tracks the grid’s checkerboard colouring: every odd number — hence every prime except 2 — lands on a cell whose coordinates sum to an even number.
  • A diagonal step preserves the parity of x + y, so a diagonal line stays inside one colour class, while a row or column alternates between a class that can hold primes and one that cannot. That is why the diagonals, not the rows, carry the visible structure.
  • Along any ray out from the centre the values have a constant second difference of 8, so every such ray is the value set of a quadratic 4x² + bx + c.
  • With 1 at the centre, the four diagonal rays take the values 4k² + 1, 4k² − 2k + 1, 4k² + 2k + 1 and (2k + 1)². The last of these is the odd squares, so that diagonal is entirely free of primes.
  • With 41 at the centre, the two arms of one diagonal take the values 4k² − 2k + 41 and 4k² + 2k + 41, which are Euler’s x² + x + 41 at odd and even x respectively. Since that polynomial is prime for x = 0 to 39, the diagonal runs 40 cells without a gap and then breaks at 41² = 1681.
  • It is not known whether any irreducible quadratic polynomial represents infinitely many primes, and Hardy and Littlewood’s Conjecture F, which predicts how many each one should produce, is unproven.

등장하는 곳

  • The March 1964 issue of Scientific American carried the spiral on its cover, alongside Martin Gardner’s column on primes — the route by which most people first met it, and the reason it became a fixture of recreational mathematics.
  • Ulam, Myron Stein and Mark Wells extended the picture to about 100,000 points on the MANIAC II at Los Alamos Scientific Laboratory — an early case of computer graphics used to pose a mathematical question rather than settle one.
  • Drawing the spiral is a stock programming exercise: Rosetta Code carries it as the task "Ulam spiral (for primes)", with implementations in dozens of languages, because it exercises nested-loop indexing and a prime sieve at once.
  • Prime-rich quadratics spotted on the spiral are the standard worked examples when polynomials with long initial runs of primes are discussed; Euler’s x² + x + 41 and its relatives are still the ones everyone reaches for.
  • Rearrangements of the same idea recur: Robert Sacks devised a variant in 1994 that winds the integers along an Archimedean spiral instead of a square one, and Klauber’s 1932 triangle is an earlier non-spiral layout with a comparable effect. Which lines look most striking is a property of the layout chosen, not of the primes.

이 생성기 사용법

생성된 값은 위쪽에 표시되고 옆에 복사 단추가 있습니다. 이미지로 만들려면 이미지 만들기의 스타일에서 모양을 고르고, 내보내기 크기를 정한 뒤 PNG·JPEG·WebP로 내려받으세요. 모두 브라우저에서 그려지므로 생성한 내용이 서버로 전송되지 않습니다.

작업하는 동안 주소창이 갱신되므로, 링크는 항상 지금 보이는 상태를 그대로 재현합니다. 특정 수열을 공유하거나 설정을 저장해 두기에 좋습니다. 값을 일반 텍스트로 가져가려면 복사를, CSV·JSON·NDJSON·SQL·XML이 필요하면 데이터 내보내기를 사용하세요.

출처

이 페이지의 역사적 설명은 위에 나열한 공개 라이선스 자료를 바탕으로 합니다. 잘못된 내용을 발견하셨나요? 알려주시면 바로잡겠습니다.