Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

deleted 1 character in body
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

J, 75 73 7367 bytes

(>:@][[echo@}:^:((~.-:}:)*{.={:)@]@]1&((,i.@{:(1#.[#~0=|){:)@]^:(>:#@])^:_)^:_&1

Try it online! Try it online!

Prints infinitely.

Note: TIO only iterates 9999 times (replace 9999 withhas +3 in the byte count because I changed infinite _ iteration to get posted byte count)9999 times.

J, 75 73 bytes

(>:@][[echo@}:^:((~.-:}:)*{.={:)@](,i.@{:(1#.[#~0=|){:)@]^:(>:#)^:_)^:_&1

Try it online!

Prints infinitely.

Note: TIO only iterates 9999 times (replace 9999 with _ to get posted byte count).

J, 75 73 67 bytes

(>:@][[echo@}:^:((~.-:}:)*{.={:)@]1&((,i.@{:(1#.[#~0=|){:)@]))^:_&1

Try it online!

Prints infinitely.

Note: TIO has +3 in the byte count because I changed infinite _ iteration to 9999 times.

deleted 978 characters in body
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

J, 7575 73 bytes

(>:@][[echo@]^@][[echo@}:^:(=#)[(~.-:}:[:(#~)*{.={:)@](,i.@{:(1#.[#~0=|){:)^@]^:(=&#~.>:#)^:_@]_)^:_&1

Try it online! Try it online!

Prints infinitely. Because this works by trying all numbers, and will therefore timeout on 276, here are links that start just before the known answer, and iterate a finite number of times to guarantee results will display:

n = 1

n = 2 (starting at 219)

n = 2 (starting at 281)

n = 4 (starting at 1264459) Note: TIO only iterates 9999 times (replace 9999 with _ to get posted byte count).

J, 75 bytes

(>:@][[echo@]^:(=#)[:}:[:(#~{.={:)(,i.@{:(1#.[#~0=|){:)^:(=&#~.)^:_@])^:_&1

Try it online!

Prints infinitely. Because this works by trying all numbers, and will therefore timeout on 276, here are links that start just before the known answer, and iterate a finite number of times to guarantee results will display:

n = 1

n = 2 (starting at 219)

n = 2 (starting at 281)

n = 4 (starting at 1264459)

J, 75 73 bytes

(>:@][[echo@}:^:((~.-:}:)*{.={:)@](,i.@{:(1#.[#~0=|){:)@]^:(>:#)^:_)^:_&1

Try it online!

Prints infinitely.

Note: TIO only iterates 9999 times (replace 9999 with _ to get posted byte count).

Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

J, 75 bytes

(>:@][[echo@]^:(=#)[:}:[:(#~{.={:)(,i.@{:(1#.[#~0=|){:)^:(=&#~.)^:_@])^:_&1

Try it online!

Prints infinitely. Because this works by trying all numbers, and will therefore timeout on 276, here are links that start just before the known answer, and iterate a finite number of times to guarantee results will display:

n = 1

n = 2 (starting at 219)

n = 2 (starting at 281)

n = 4 (starting at 1264459)

AltStyle によって変換されたページ (->オリジナル) /