Not the fastest method...
f=: -.@:(1&e.)@:(#@:~."1)@(3&(]\))`0:@.(1&e.@:('0456789'&e.))@:":
D=: 1e5 + i. 1e6 - 1e5
+/ f"0 D
492
--------------------------------------------
On Mon, 4/9/18, Skip Cave <[email protected]> wrote:
Subject: [Jprogramming] Quora Problem
To: "[email protected]" <[email protected]>
Date: Monday, April 9, 2018, 2:51 PM
Here's a fun math challenge on Quora:
Find the number of 6-digit numbers made
up of the digits 1, 2, and 3 which
have no digit recurring three or more
times, consecutively?
The link to my answer on Quora is: https://goo.gl/BzBDQe
Skip Cave
Cave Consulting LLC
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm