Skip to main content
Commonmark migration
Source Link

Brachylog, 21 bytes

⟨+₁≡-₁⟩{ḋdl}ᵐ⌋>~↰₂?ẉ⊥

Try it online!

Prints infinitely.

###Explanation

Explanation

⟨+₁≡-₁⟩                  Fork: The output of the fork is [Input + 1, Input -1]
       {   }ᵐ            Map:
        ḋdl                (predicate 2) the output is the length of the prime decomposition
                           of the input with no duplicates
             ⌋           Take the minimum result of that map
              >          This minimum is bigger than…
               ~↰₂?      …the output of predicate 2 with Input as input
                  ?ẉ     Write Input followed by a new line if that's the case
                    ⊥    False: backtrack and try another value for Input

Brachylog, 21 bytes

⟨+₁≡-₁⟩{ḋdl}ᵐ⌋>~↰₂?ẉ⊥

Try it online!

Prints infinitely.

###Explanation

⟨+₁≡-₁⟩                  Fork: The output of the fork is [Input + 1, Input -1]
       {   }ᵐ            Map:
        ḋdl                (predicate 2) the output is the length of the prime decomposition
                           of the input with no duplicates
             ⌋           Take the minimum result of that map
              >          This minimum is bigger than…
               ~↰₂?      …the output of predicate 2 with Input as input
                  ?ẉ     Write Input followed by a new line if that's the case
                    ⊥    False: backtrack and try another value for Input

Brachylog, 21 bytes

⟨+₁≡-₁⟩{ḋdl}ᵐ⌋>~↰₂?ẉ⊥

Try it online!

Prints infinitely.

Explanation

⟨+₁≡-₁⟩                  Fork: The output of the fork is [Input + 1, Input -1]
       {   }ᵐ            Map:
        ḋdl                (predicate 2) the output is the length of the prime decomposition
                           of the input with no duplicates
             ⌋           Take the minimum result of that map
              >          This minimum is bigger than…
               ~↰₂?      …the output of predicate 2 with Input as input
                  ?ẉ     Write Input followed by a new line if that's the case
                    ⊥    False: backtrack and try another value for Input
Source Link
Fatalize
  • 39.3k
  • 5
  • 70
  • 162

Brachylog, 21 bytes

⟨+₁≡-₁⟩{ḋdl}ᵐ⌋>~↰₂?ẉ⊥

Try it online!

Prints infinitely.

###Explanation

⟨+₁≡-₁⟩                  Fork: The output of the fork is [Input + 1, Input -1]
       {   }ᵐ            Map:
        ḋdl                (predicate 2) the output is the length of the prime decomposition
                           of the input with no duplicates
             ⌋           Take the minimum result of that map
              >          This minimum is bigger than…
               ~↰₂?      …the output of predicate 2 with Input as input
                  ?ẉ     Write Input followed by a new line if that's the case
                    ⊥    False: backtrack and try another value for Input