A semiperfect/pseudoperfect number is an integer equal to the sum of a part of or all of its divisors (excluding itself). Numbers which are equal to the sum of all of their divisors are perfect.
Divisors of 6 : 1,2,3 6 = 1+2+3 -> semiperfect (perfect) Divisors of 28 : 1,2,4,7,14 28 = 14+7+4+2+1 -> semiperfect (perfect) Divisors of 40 : 1,2,4,5,8,10,20 40 = 1+4+5+10+20 or 2+8+10+20 -> semiperfect
A primitive semiperfect number is a semiperfect number with no semiperfect divisors (except itself :))
Divisors of 6 : 1,2,3 6 = 1+2+3 -> primitive Divisors of 12 : 1,2,3,4,6 12 = 2+4+6 -> semiperfect
Write a program or a function in any language. It will take as input a number n as a function parameter or from STDIN/your language's closest alternative, and will output all the primitive semi-perfect numbers from 1 to n (inclusive).
The output must be formated as
6[separator]20[separator]28[separator]88... where [separator] is either as newline, a space or a comma. There must not be a starting [separator] nor a ending one.
Edit : you can leave a trailing newline
6 20 28 88
This is code-golf, so the shortest code in bytes win.
Don't try to fool us with loopholes please :).
I'd be glad you could leave an explanation of your golfed code once you think you're done golfing it!