11
1
Clarification: Basically, you need to make this
Euler's totient function has the name phi.
Let's try to calculate phi(8)
First, list all numbers 8 and under backwards, not including 0 or under
8
7
6
5
4
3
2
1
Now find which numbers don't share a factor with 8 (1 doesn't count), and place a #
in their place.
8
#
6
#
4
#
2
#
Remove the numbers.
#
#
#
#
-
Now do this, but string the outputs together in a triangle
9
88
777
6666
55555
444444
3333333
22222222
111111111
---------
123456789
#
out non-factor sharing numbers
9
8#
7##
6#66
5####
4#4#4#
3##3##3
2#2#2#2#
#########
Remove numbers:
#
##
#
####
# # #
## ##
# # # #
#########
This would be the output for input 9 (since 9 columns.)
Leading + trailing newlines allowed.
Clarification needed. – None – 2016-05-01T23:29:05.793
4if you need to clarify, try the sandbox first. – Rɪᴋᴇʀ – 2016-05-01T23:35:45.237
can I output as a list of lines? – Maltysen – 2016-05-02T00:52:00.487
Leading newline allowed? – Luis Mendo – 2016-05-02T01:25:16.457