Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

66%
+2 −0
Challenges Determine if a polyomino is "prime"

An $n$-polyomino is a connected subset of the square tiling consisting of $n$ squares. We will not require that polyominos be simply connected, that is they can have holes. We will say a $n$-polyo...

1 answer  ·  posted 11mo ago by WheatWizard‭  ·  edited 11mo ago by WheatWizard‭

#4: Post edited by user avatar WheatWizard‭ · 2023-06-17T23:42:22Z (11 months ago)
More examples.
  • An $n$-polyomino is a connected subset of the square tiling consisting of $n$ squares. We will not require that polyominos be simply connected, that is they can have holes.
  • We will say a $n$-polyomino is *prime* if it cannot be disected into disjoint $k$-polyominos for any 1<$k$<$n$. For example this square 4-polyomino:
  • ```text
  • XX
  • XX
  • ```
  • can be dissected into two 2-polyominos, but this "T"-shaped 4-polyomino cannot:
  • ```text
  • XXX
  • X
  • ```
  • The $k$-polyominos do not need to be equal for example:
  • ```text
  • XXXXX
  • X XX
  • ```
  • This 8-polyomino can be subdivided into the two polyominos shown in the last examples. They are not equal but they are both 4-polyominos so the example is not prime.
  • Naturally if $n$ is a prime number all $n$-polyominos are prime, however as shown above there are prime $n$-polyominos where $n$ is not prime. Here are examples for the next couple composite numbers
  • ### 6
  • ```text
  • X
  • XXXX
  • X
  • ```
  • ### 8
  • ```text
  • X
  • XXXXX
  • X X
  • ```
  • ### 9
  • ```text
  • XXXXXXXX
  • X
  • ```
  • ## Challenge
  • Given a polyomino as input output one consistent value if it is prime and another consistent distinct value if it is not prime.
  • This is code-golf the goal being to minimize the size of your source code as measured in bytes.
  • An $n$-polyomino is a connected subset of the square tiling consisting of $n$ squares. We will not require that polyominos be simply connected, that is they can have holes.
  • We will say a $n$-polyomino is *prime* if it cannot be disected into disjoint $k$-polyominos for any 1<$k$<$n$. For example this square 4-polyomino:
  • ```text
  • XX
  • XX
  • ```
  • can be dissected into two 2-polyominos, but this "T"-shaped 4-polyomino cannot:
  • ```text
  • XXX
  • X
  • ```
  • The $k$-polyominos do not need to be equal for example:
  • ```text
  • XXXXX
  • X XX
  • ```
  • This 8-polyomino can be subdivided into the two polyominos shown in the last examples. They are not equal but they are both 4-polyominos so the example is not prime.
  • Naturally if $n$ is a prime number all $n$-polyominos are prime, however as shown above there are prime $n$-polyominos where $n$ is not prime. Here are examples for the next couple composite numbers
  • ### 6
  • ```text
  • X
  • XXXX
  • X
  • ```
  • ### 8
  • ```text
  • X
  • XXXXX
  • X X
  • ```
  • ### 9
  • ```text
  • XXXXXXXX
  • X
  • ```
  • ### 10
  • ```
  • XXXXXX
  • X
  • XXX
  • ```
  • ### 12
  • ```
  • XXXXXXXXX
  • X X
  • X
  • ```
  • ### 14
  • ```
  • XXXXXXXXXXXX
  • X X
  • ```
  • ### 15
  • ```
  • XXX
  • X X X
  • XXXXXX
  • X X
  • X
  • ```
  • ## Challenge
  • Given a polyomino as input output one consistent value if it is prime and another consistent distinct value if it is not prime.
  • This is code-golf the goal being to minimize the size of your source code as measured in bytes.
#3: Post edited by user avatar WheatWizard‭ · 2023-06-17T18:29:40Z (11 months ago)
Holes.
  • An $n$-polyomino is a connected subset of the square tiling consisting of $n$ squares.
  • We will say a $n$-polyomino is *prime* if it cannot be disected into disjoint $k$-polyominos for any 1<$k$<$n$. For example this square 4-polyomino:
  • ```text
  • XX
  • XX
  • ```
  • can be dissected into two 2-polyominos, but this "T"-shaped 4-polyomino cannot:
  • ```text
  • XXX
  • X
  • ```
  • The $k$-polyominos do not need to be equal for example:
  • ```text
  • XXXXX
  • X XX
  • ```
  • This 8-polyomino can be subdivided into the two polyominos shown in the last examples. They are not equal but they are both 4-polyominos so the example is not prime.
  • Naturally if $n$ is a prime number all $n$-polyominos are prime, however as shown above there are prime $n$-polyominos where $n$ is not prime. Here are examples for the next couple composite numbers
  • ### 6
  • ```text
  • X
  • XXXX
  • X
  • ```
  • ### 8
  • ```text
  • X
  • XXXXX
  • X X
  • ```
  • ### 9
  • ```text
  • XXXXXXXX
  • X
  • ```
  • ## Challenge
  • Given a polyomino as input output one consistent value if it is prime and another consistent distinct value if it is not prime.
  • This is code-golf the goal being to minimize the size of your source code as measured in bytes.
  • An $n$-polyomino is a connected subset of the square tiling consisting of $n$ squares. We will not require that polyominos be simply connected, that is they can have holes.
  • We will say a $n$-polyomino is *prime* if it cannot be disected into disjoint $k$-polyominos for any 1<$k$<$n$. For example this square 4-polyomino:
  • ```text
  • XX
  • XX
  • ```
  • can be dissected into two 2-polyominos, but this "T"-shaped 4-polyomino cannot:
  • ```text
  • XXX
  • X
  • ```
  • The $k$-polyominos do not need to be equal for example:
  • ```text
  • XXXXX
  • X XX
  • ```
  • This 8-polyomino can be subdivided into the two polyominos shown in the last examples. They are not equal but they are both 4-polyominos so the example is not prime.
  • Naturally if $n$ is a prime number all $n$-polyominos are prime, however as shown above there are prime $n$-polyominos where $n$ is not prime. Here are examples for the next couple composite numbers
  • ### 6
  • ```text
  • X
  • XXXX
  • X
  • ```
  • ### 8
  • ```text
  • X
  • XXXXX
  • X X
  • ```
  • ### 9
  • ```text
  • XXXXXXXX
  • X
  • ```
  • ## Challenge
  • Given a polyomino as input output one consistent value if it is prime and another consistent distinct value if it is not prime.
  • This is code-golf the goal being to minimize the size of your source code as measured in bytes.
#2: Post edited by user avatar WheatWizard‭ · 2023-06-14T12:44:28Z (11 months ago)
  • An $n$-polyomino is a connected subset of the square tiling consisting of $n$ squares.
  • We will say a $n$-polyomino is *prime* if it cannot be disected into disjoint $k$-polyominos for any 1<$k$<$n$. For example this square 4-polyomino:
  • ```text
  • XX
  • XX
  • ```
  • can be dissected into two 2-polyominos, but this "T"-shaped 4-polyomino cannot:
  • ```text
  • XXX
  • X
  • ```
  • Naturally if $n$ is a prime number all $n$-polyominos are prime, however as shown above there are prime $n$-polyominos where $n$ is not prime. Here are examples for the next couple composite numbers
  • ### 6
  • ```text
  • X
  • XXXX
  • X
  • ```
  • ### 8
  • ```text
  • X
  • XXXXX
  • X X
  • ```
  • ### 9
  • ```text
  • XXXXXXXX
  • X
  • ```
  • ## Challenge
  • Given a polyomino as input output one consistent value if it is prime and another consistent distinct value if it is not prime.
  • This is code-golf the goal being to minimize the size of your source code as measured in bytes.
  • An $n$-polyomino is a connected subset of the square tiling consisting of $n$ squares.
  • We will say a $n$-polyomino is *prime* if it cannot be disected into disjoint $k$-polyominos for any 1<$k$<$n$. For example this square 4-polyomino:
  • ```text
  • XX
  • XX
  • ```
  • can be dissected into two 2-polyominos, but this "T"-shaped 4-polyomino cannot:
  • ```text
  • XXX
  • X
  • ```
  • The $k$-polyominos do not need to be equal for example:
  • ```text
  • XXXXX
  • X XX
  • ```
  • This 8-polyomino can be subdivided into the two polyominos shown in the last examples. They are not equal but they are both 4-polyominos so the example is not prime.
  • Naturally if $n$ is a prime number all $n$-polyominos are prime, however as shown above there are prime $n$-polyominos where $n$ is not prime. Here are examples for the next couple composite numbers
  • ### 6
  • ```text
  • X
  • XXXX
  • X
  • ```
  • ### 8
  • ```text
  • X
  • XXXXX
  • X X
  • ```
  • ### 9
  • ```text
  • XXXXXXXX
  • X
  • ```
  • ## Challenge
  • Given a polyomino as input output one consistent value if it is prime and another consistent distinct value if it is not prime.
  • This is code-golf the goal being to minimize the size of your source code as measured in bytes.
#1: Initial revision by user avatar WheatWizard‭ · 2023-06-13T17:03:58Z (11 months ago)
Determine if a polyomino is "prime"
An $n$-polyomino is a connected subset of the square tiling consisting of $n$ squares.

We will say a $n$-polyomino is *prime* if it cannot be disected into disjoint $k$-polyominos for any 1<$k$<$n$.  For example this square 4-polyomino:

```text
XX
XX
```

can be dissected into two 2-polyominos, but this "T"-shaped 4-polyomino cannot:

```text
XXX
 X
```

Naturally if $n$ is a prime number all $n$-polyominos are prime, however as shown above there are prime $n$-polyominos where $n$ is not prime.  Here are examples for the next couple composite numbers

### 6

```text
 X
XXXX
 X
```

### 8

```text
  X
XXXXX
 X X
```

### 9

```text
XXXXXXXX
  X
```

## Challenge

Given a polyomino as input output one consistent value if it is prime and another consistent distinct value if it is not prime.

This is code-golf the goal being to minimize the size of your source code as measured in bytes.