GNU sed + coreutils, 55 bytes
#GNU sed + coreutils, 55 bytes
(including +1 for -r flag)
s/^/factor /e
s/ ([^ ]+)(( 1円)*)/2円/g
s/[^ ]//g
y/ /1/
Input in decimal, on stdin; output in unary, on stdout.
##Explanation
Explanation
#!/bin/sed -rf
# factor the number
s/^/factor /e
# remove first of each number repeated 0 or more times
s/ ([^ ]+)(( 1円)*)/2円/g
# count just the spaces
s/[^ ]//g
y/ /1/
#GNU sed + coreutils, 55 bytes
(including +1 for -r flag)
s/^/factor /e
s/ ([^ ]+)(( 1円)*)/2円/g
s/[^ ]//g
y/ /1/
Input in decimal, on stdin; output in unary, on stdout.
##Explanation
#!/bin/sed -rf
# factor the number
s/^/factor /e
# remove first of each number repeated 0 or more times
s/ ([^ ]+)(( 1円)*)/2円/g
# count just the spaces
s/[^ ]//g
y/ /1/
GNU sed + coreutils, 55 bytes
(including +1 for -r flag)
s/^/factor /e
s/ ([^ ]+)(( 1円)*)/2円/g
s/[^ ]//g
y/ /1/
Input in decimal, on stdin; output in unary, on stdout.
Explanation
#!/bin/sed -rf
# factor the number
s/^/factor /e
# remove first of each number repeated 0 or more times
s/ ([^ ]+)(( 1円)*)/2円/g
# count just the spaces
s/[^ ]//g
y/ /1/
#GNU sed + coreutils, 55 bytes
(including +1 for -r flag)
s/^/factor /e
s/ ([^ ]+)(( 1円)*)/2円/g
s/[^ ]//g
y/ /1/
Input in decimal, on stdin; output in unary, on stdout.
##Explanation
#!/bin/sed -rf
# factor the number
s/^/factor /e
# remove first of each number repeated 0 or more times
s/ ([^ ]+)(( 1円)*)/2円/g
# count just the spaces
s/[^ ]//g
y/ /1/
##Explanation
#!/bin/sed -rf
# factor the number
s/^/factor /e
# remove first of each number repeated 0 or more times
s/ ([^ ]+)(( 1円)*)/2円/g
# count just the spaces
s/[^ ]//g
y/ /1/
#GNU sed + coreutils, 55 bytes
(including +1 for -r flag)
s/^/factor /e
s/ ([^ ]+)(( 1円)*)/2円/g
s/[^ ]//g
y/ /1/
Input in decimal, on stdin; output in unary, on stdout.
##Explanation
#!/bin/sed -rf
# factor the number
s/^/factor /e
# remove first of each number repeated 0 or more times
s/ ([^ ]+)(( 1円)*)/2円/g
# count just the spaces
s/[^ ]//g
y/ /1/
#GNU sed + coreutils, 55 bytes
(including +1 for -r flag)
s/^/factor /e
s/ ([^ ]+)(( 1円)*)/2円/g
s/[^ ]//g
y/ /1/
Input in decimal, on stdin; output in unary, on stdout.
##Explanation
#!/bin/sed -rf
# factor the number
s/^/factor /e
# remove first of each number repeated 0 or more times
s/ ([^ ]+)(( 1円)*)/2円/g
# count just the spaces
s/[^ ]//g
y/ /1/
#GNU sed + coreutils, 55 bytes
(including +1 for -r flag)
s/^/factor /e
s/ ([^ ]+)(( 1円)*)/2円/g
s/[^ ]//g
y/ /1/
Input in decimal, on stdin; output in unary, on stdout.
##Explanation
#!/bin/sed -rf
# factor the number
s/^/factor /e
# remove first of each number repeated 0 or more times
s/ ([^ ]+)(( 1円)*)/2円/g
# count just the spaces
s/[^ ]//g
y/ /1/