Post History
Python 3, 235 185 141 118 bytes a=[[],[],[]] n=1;exec("d=sum(i for i in range(1,n)if n%i<1)-n;a[[[1,2][d<0],0][d>0]]+=n,;n+=1;"*int(input())) print(a) Try it online! Golfed 50 byt...
Answer
#4: Post edited
# [Python 3], <s>235</s> <s>185</s> 141 bytes- <!-- language-all: lang-python -->
<pre><code>b=[];c=[];a=[]for n in range(1,int(input())+1):	d=sum(i for i in range(1,n)if n%i<1)	if d>n:a+=n,	elif d<n:b+=n,	else:c+=n,print(a,c,b)</code></pre>[Try it online!][TIO-ks770mv3]Golfed 50 bytes by [**@caird coinheringaahing**](https://codegolf.codidact.com/users/53912). Golfed 44 bytes by [**@bastolki**](https://codegolf.codidact.com/users/54221).- [Python 3]: https://docs.python.org/3/
[TIO-ks770mv3]: https://tio.run/##TY3BCgIhFEXX@hVvE/gYNxJtbOxHooU6Tj2oN@I4i77exiBoc7gHDtz8ro@Fj60Fd72dY4ffIeelAAMxFM/3pIwmroo4b1UhDgatFJNbt5ci6Cn9p4w0Ax9oNCjFPqcLWz841lKkZ/eRbfj5mmz87lz6hddRB2zNnD4 "Python 3 – Try It Online"
- # [Python 3], <s>235</s> <s>185</s> <s>141</s> 118 bytes
- <!-- language-all: lang-python -->
- a=[[],[],[]]
- n=1;exec("d=sum(i for i in range(1,n)if n%i<1)-n;a[[[1,2][d<0],0][d>0]]+=n,;n+=1;"*int(input()))
- print(a)
- [Try it online!][TIO-ks7io3nw]
- Golfed 50 bytes by [**@caird coinheringaahing**](https://codegolf.codidact.com/users/53912). Golfed 44 bytes by [**@bastolki**](https://codegolf.codidact.com/users/54221). Golfed another 23 bytes by [**@bastolki**](https://codegolf.codidact.com/users/54221).
- [Python 3]: https://docs.python.org/3/
- [TIO-ks7io3nw]: https://tio.run/##HYxBCsIwEADvfUUoCFkbIVE8pfEjyx6CTXUPbkOagr4@VmFgmMvkT30ucmktBkQyf6iT4Hx6p7vup7BuL81qXopixaJKlEfSzgjwrOTAo4OT@IiIzpwJp9GSsbtvlmgIYrwM@6w/slTNkreqAaDL5dcRWnPXLw "Python 3 – Try It Online"
#3: Post edited
# [Python 3], <s>235</s> 185 bytes- <!-- language-all: lang-python -->
<pre><code>b=[1];c=[];a=[]for n in range(2,int(input())+1):	d=1	for i in range(2,int(n**.5)+1):		if n%i<1:			d+=i;j=n//i			if j!=i:d+=j- 	if d>n:a+=n,
- 	elif d<n:b+=n,
- 	else:c+=n,
- print(a,c,b)
- </code></pre>
[Try it online!][TIO-kq7n6zf0]-50 by caird coinheringaahing- [Python 3]: https://docs.python.org/3/
[TIO-kq7n6zf0]: https://tio.run/##XY3LDoIwEEXX7VfUhQmljaQaNoXxRwiL8tJpyEAqLvz6So1u3NzcM3OSu762@0KXGDtoTFv10LSV24NPSxAkkERwdBuzs0baMqT1uWVSKiMtZwMYzpKH/x7l@an8WgwnQUesTepsUICVByoKTLj//AHQ7mfPEw1Xsk4Bac7GOXFNtvvxY7T9p68hrTjd607GaMo3 "Python 3 – Try It Online"
- # [Python 3], <s>235</s> <s>185</s> 141 bytes
- <!-- language-all: lang-python -->
- <pre><code>b=[];c=[];a=[]
- for n in range(1,int(input())+1):
- 	d=sum(i for i in range(1,n)if n%i<1)
- 	if d>n:a+=n,
- 	elif d<n:b+=n,
- 	else:c+=n,
- print(a,c,b)
- </code></pre>
- [Try it online!][TIO-ks770mv3]
- Golfed 50 bytes by [**@caird coinheringaahing**](https://codegolf.codidact.com/users/53912). Golfed 44 bytes by [**@bastolki**](https://codegolf.codidact.com/users/54221).
- [Python 3]: https://docs.python.org/3/
- [TIO-ks770mv3]: https://tio.run/##TY3BCgIhFEXX@hVvE/gYNxJtbOxHooU6Tj2oN@I4i77exiBoc7gHDtz8ro@Fj60Fd72dY4ffIeelAAMxFM/3pIwmroo4b1UhDgatFJNbt5ci6Cn9p4w0Ax9oNCjFPqcLWz841lKkZ/eRbfj5mmz87lz6hddRB2zNnD4 "Python 3 – Try It Online"
#2: Post edited
# [Python 3], 235 bytes- <!-- language-all: lang-python -->
<pre><code>from math import *x=int(input());b=[ 1 ];c=[];a=[]for n in range(2,x+1):- 	d=1
	for i in range(2,int(sqrt(n))+1):		if n%i==0:- 			d+=i;j=n//i
- 			if j!=i:d+=j
	if d>n:a.append(n)	elif d<n:b.append(n)	else:c.append(n)print([ a,c,b ])- </code></pre>
[Try it online!][TIO-kq6hualg]- [Python 3]: https://docs.python.org/3/
[TIO-kq6hualg]: https://tio.run/##VY3LDoIwEEXX7VeMCxMqREXjpjj@CGFRXjJEhlprol9fadzoZpJ7zs0d@/bDzMcQejdPMBk/AE12dh428oXEPiG2T58oVdRYQg5V0WBZFWY5sp8dMBCDM3ztkkP2SnOlpWgxlyJK@pVx7HF3PmGlvj1BPfCaEPcxiDZFKkbk3Y5iXOS4QtILHmVM7YW12RprO26XESm6W6Rn1vU/fXS6@SHWxdclmKzJaqhUCPnpAw "Python 3 – Try It Online"
- # [Python 3], <s>235</s> 185 bytes
- <!-- language-all: lang-python -->
- <pre><code>b=[1];c=[];a=[]
- for n in range(2,int(input())+1):
- 	d=1
- 	for i in range(2,int(n**.5)+1):
- 		if n%i<1:
- 			d+=i;j=n//i
- 			if j!=i:d+=j
- 	if d>n:a+=n,
- 	elif d<n:b+=n,
- 	else:c+=n,
- print(a,c,b)
- </code></pre>
- [Try it online!][TIO-kq7n6zf0]
- -50 by caird coinheringaahing
- [Python 3]: https://docs.python.org/3/
- [TIO-kq7n6zf0]: https://tio.run/##XY3LDoIwEEXX7VfUhQmljaQaNoXxRwiL8tJpyEAqLvz6So1u3NzcM3OSu762@0KXGDtoTFv10LSV24NPSxAkkERwdBuzs0baMqT1uWVSKiMtZwMYzpKH/x7l@an8WgwnQUesTepsUICVByoKTLj//AHQ7mfPEw1Xsk4Bac7GOXFNtvvxY7T9p68hrTjd607GaMo3 "Python 3 – Try It Online"
#1: Initial revision
# [Python 3], 235 bytes <!-- language-all: lang-python --> <pre><code>from math import * x=int(input());b=[ 1 ];c=[];a=[] for n in range(2,x+1): 	d=1 	for i in range(2,int(sqrt(n))+1): 		if n%i==0: 			d+=i;j=n//i 			if j!=i:d+=j 	if d>n:a.append(n) 	elif d<n:b.append(n) 	else:c.append(n) print([ a,c,b ]) </code></pre> [Try it online!][TIO-kq6hualg] [Python 3]: https://docs.python.org/3/ [TIO-kq6hualg]: https://tio.run/##VY3LDoIwEEXX7VeMCxMqREXjpjj@CGFRXjJEhlprol9fadzoZpJ7zs0d@/bDzMcQejdPMBk/AE12dh428oXEPiG2T58oVdRYQg5V0WBZFWY5sp8dMBCDM3ztkkP2SnOlpWgxlyJK@pVx7HF3PmGlvj1BPfCaEPcxiDZFKkbk3Y5iXOS4QtILHmVM7YW12RprO26XESm6W6Rn1vU/fXS6@SHWxdclmKzJaqhUCPnpAw "Python 3 – Try It Online"