Skip to main content
added 1081 characters in body
Source Link
Dennis
  • 211.9k
  • 41
  • 381
  • 833

Jelly, 20 17 bytes

BJŒċṬUḄ^;⁸ÆḍṂỊµÐḟ

Try it online!Try it online!

How it works

BJŒċṬUḄ^;⁸ÆḍṂỊµÐḟ  Main link. Argument: n

              µ    Combine all links to the left into a chain.
               Ðḟ  Filter-false; keep only integers k from [1, ..., n] for which
                   the chain returns 0.
B                    Convert k to binary.
 J                   Get the indices of all digits.
  Œċ                 Take all combination of two indices, with replacement.
    Ṭ                Untruth; map each index pair [i, j] to the Boolean array of
                     length j that has 1's at (and only at) indices i and j.
     U               Upend; reverse each Boolean array.
      Ḅ              Unbinary; convert each array from base 2 to integer.
       ^             XOR the resulting numbers with k.
        ;⁸           Append k to the resulting list.
          Æḍ         Count the number of proper divisors of each result.
            Ṃ        Take the minimum.
             Ị       Insignificant; test if the minimum is 0 or 1.

Jelly, 20 17 bytes

BJŒċṬUḄ^;⁸ÆḍṂỊµÐḟ

Try it online!

Jelly, 20 17 bytes

BJŒċṬUḄ^;⁸ÆḍṂỊµÐḟ

Try it online!

How it works

BJŒċṬUḄ^;⁸ÆḍṂỊµÐḟ  Main link. Argument: n

              µ    Combine all links to the left into a chain.
               Ðḟ  Filter-false; keep only integers k from [1, ..., n] for which
                   the chain returns 0.
B                    Convert k to binary.
 J                   Get the indices of all digits.
  Œċ                 Take all combination of two indices, with replacement.
    Ṭ                Untruth; map each index pair [i, j] to the Boolean array of
                     length j that has 1's at (and only at) indices i and j.
     U               Upend; reverse each Boolean array.
      Ḅ              Unbinary; convert each array from base 2 to integer.
       ^             XOR the resulting numbers with k.
        ;⁸           Append k to the resulting list.
          Æḍ         Count the number of proper divisors of each result.
            Ṃ        Take the minimum.
             Ị       Insignificant; test if the minimum is 0 or 1.
added 5 characters in body
Source Link
Dennis
  • 211.9k
  • 41
  • 381
  • 833

Jelly, 2020 17 bytes

BLḶ2*0;^þ`F^⁸ÆḍṂỊµÐḟBJŒċṬUḄ^;⁸ÆḍṂỊµÐḟ

Try it online!Try it online!

Jelly, 20 bytes

BLḶ2*0;^þ`F^⁸ÆḍṂỊµÐḟ

Try it online!

Jelly, 20 17 bytes

BJŒċṬUḄ^;⁸ÆḍṂỊµÐḟ

Try it online!

Post Undeleted by Dennis
Post Deleted by Dennis
Source Link
Dennis
  • 211.9k
  • 41
  • 381
  • 833

Jelly, 20 bytes

BLḶ2*0;^þ`F^⁸ÆḍṂỊµÐḟ

Try it online!