Skip to main content
added 173 characters in body
Source Link
FrownyFrog
  • 3.8k
  • 1
  • 14
  • 20

[J], 37 33 bytes

+^:(((=1#."."0)*:(e.".\.))":)^:_~

Try it online!

                                ~    A = N
+^:                          ^:_     while(...)A+=N; return A
   (                      ":)        A to string
   (((    "."0)          )  )        digits of A
   ((( 1#.    )          )  )        sum
   (((=       )          )  )        equals N
   ((            (e.".\.))  )        N is one of the suffixes of A-string
   ((          *:        )  )        not AND

Prepending the iteration counter is ~5 times faster but 5 bytes longer:

(]+[((=1#.,.&.":)<:|),~&.":)^:_&1,&":]

Try it online!

Incrementing by 100, 27 bytes:

(]+100*(=1#.,.&.":)<:|)^:_~

Try it online! [J]: http://jsoftware.com/

[J], 37 33 bytes

+^:(((=1#."."0)*:(e.".\.))":)^:_~

Try it online!

                                ~    A = N
+^:                          ^:_     while(...)A+=N; return A
   (                      ":)        A to string
   (((    "."0)          )  )        digits of A
   ((( 1#.    )          )  )        sum
   (((=       )          )  )        equals N
   ((            (e.".\.))  )        N is one of the suffixes of A-string
   ((          *:        )  )        not AND

Prepending the iteration counter is ~5 times faster but 5 bytes longer:

(]+[((=1#.,.&.":)<:|),~&.":)^:_&1,&":]

Try it online! [J]: http://jsoftware.com/

[J], 37 33 bytes

+^:(((=1#."."0)*:(e.".\.))":)^:_~

Try it online!

                                ~    A = N
+^:                          ^:_     while(...)A+=N; return A
   (                      ":)        A to string
   (((    "."0)          )  )        digits of A
   ((( 1#.    )          )  )        sum
   (((=       )          )  )        equals N
   ((            (e.".\.))  )        N is one of the suffixes of A-string
   ((          *:        )  )        not AND

Prepending the iteration counter is ~5 times faster but 5 bytes longer:

(]+[((=1#.,.&.":)<:|),~&.":)^:_&1,&":]

Try it online!

Incrementing by 100, 27 bytes:

(]+100*(=1#.,.&.":)<:|)^:_~

Try it online! [J]: http://jsoftware.com/

added 249 characters in body
Source Link
FrownyFrog
  • 3.8k
  • 1
  • 14
  • 20

J[J], 37 33 bytes

+^:(((=1#."."0)*:(e.".\.))":)^:_~

Try it online!

                                ~    A = N
+^:                          ^:_     while(...)A+=N; return A
   (                      ":)        A to string
   (((    "."0)          )  )        digits of A
   ((( 1#.    )          )  )        sum
   (((=       )          )  )        equals N
   ((            (e.".\.))  )        N is one of the suffixes of A-string
   ((          *:        )  )        not AND

Prepending the iteration counter is ~5 times faster but 5 bytes longer:

(]+[((=1#.,.&.":)<:|),~&.":)^:_&1,&":]

Try it online! [J]: http://jsoftware.com/

J, 37 33 bytes

+^:(((=1#."."0)*:(e.".\.))":)^:_~

Try it online!

                                ~    A = N
+^:                          ^:_     while(...)A+=N; return A
   (                      ":)        A to string
   (((    "."0)          )  )        digits of A
   ((( 1#.    )          )  )        sum
   (((=       )          )  )        equals N
   ((            (e.".\.))  )        N is one of the suffixes of A-string
   ((          *:        )  )        not AND

[J], 37 33 bytes

+^:(((=1#."."0)*:(e.".\.))":)^:_~

Try it online!

                                ~    A = N
+^:                          ^:_     while(...)A+=N; return A
   (                      ":)        A to string
   (((    "."0)          )  )        digits of A
   ((( 1#.    )          )  )        sum
   (((=       )          )  )        equals N
   ((            (e.".\.))  )        N is one of the suffixes of A-string
   ((          *:        )  )        not AND

Prepending the iteration counter is ~5 times faster but 5 bytes longer:

(]+[((=1#.,.&.":)<:|),~&.":)^:_&1,&":]

Try it online! [J]: http://jsoftware.com/

deleted 7 characters in body
Source Link
FrownyFrog
  • 3.8k
  • 1
  • 14
  • 20

J, 37 33 bytes

+^:(((=1#."."0)*:(e.".\.))":)^:_~

Try it online!

                                ~    A = N
+^:                          ^:_     while(...)A+=N; return A
   (                      ":)        A to string
   (((    "."0)          )  )        digits of A-string
   ((( 1#.    )          )  )        sum
   (((=       )          )  )        equals N
   ((            (e.".\.))  )        N is one of the suffixes of A-string
   ((          *:        )  )        not AND

J, 37 33 bytes

+^:(((=1#."."0)*:(e.".\.))":)^:_~

Try it online!

                                ~    A = N
+^:                          ^:_     while(...)A+=N; return A
   (                      ":)        A to string
   (((    "."0)          )  )        digits of A-string
   ((( 1#.    )          )  )        sum
   (((=       )          )  )        equals N
   ((            (e.".\.))  )        N is one of the suffixes of A-string
   ((          *:        )  )        not AND

J, 37 33 bytes

+^:(((=1#."."0)*:(e.".\.))":)^:_~

Try it online!

                                ~    A = N
+^:                          ^:_     while(...)A+=N; return A
   (                      ":)        A to string
   (((    "."0)          )  )        digits of A
   ((( 1#.    )          )  )        sum
   (((=       )          )  )        equals N
   ((            (e.".\.))  )        N is one of the suffixes of A-string
   ((          *:        )  )        not AND
deleted 19 characters in body
Source Link
FrownyFrog
  • 3.8k
  • 1
  • 14
  • 20
Loading
Source Link
FrownyFrog
  • 3.8k
  • 1
  • 14
  • 20
Loading