Pretty Smooth Moves
Jelly, 12 bytes
Æf>½S
³²ḊÇÐḟ
Try it online!
How it works
³²ḊÇÐḟ Main link. No arguments.
³ Yield 100.
² Square it to yield 10,000.
Ḋ Dequeue; yield [2, ..., 10,000].
ÇÐḟ Filter-false; keep elements for which the helper link returns 0.
Æf>½S Helper link. Argument: n
Æf Compute the prime factorization of n.
>½ Compare the prime factors with the square root of n.
S Sum; add the resulting Booleans.
Brachylog, 21 19 bytes
1 byte thanks to Fatalize, for inspiration of another 1 byte.
100^:4reP$ph^<=P@w\
Try it online!
Takes about 6 seconds here.
100^:4reP$ph^<=P@w\
100 100
^ squared
:4 [10000,4]
r [4,10000]
eP P is an integer in that interval (choice point),
P$ph^<=P P, prime factorized (from biggest to smallest),
take the first element, squared, is less than
or equal to P
P@w Write P with a newline,
\ Backtrack to the last choice point and make
a different choice until there is no more
choice and the program halts.
Previous 21-byte solution
100^:4reP'($pe^>P)@w\
Try it online!
Takes about 6 seconds here.
100^:4reP'($pe^>P)@w\
100 100
^ squared
:4 [10000,4]
r [4,10000]
eP P is an integer in that interval (choice point),
P'( ) The following about P cannot be proved:
$pe one of its prime factor
^ squared
>P is greater than P
@w Write P with a newline,
\ Backtrack to the last choice point and make
a different choice until there is no more
choice and the program halts.
Haskell, 53 bytes
r=[1..10^4]
[n|n<-r,product[x|x<-r,x*x<=n]^n`mod`n<1]
I don't have time to golf this now, but I want to illustrate a method for testing if n
is pretty smooth: Multiply the numbers from 1
to sqrt(n)
(i.e. compute a factorial), raise the product to a high power, and check if the result is a multiple of n
.
Change to r=[2..10^4]
if 1
should not be output.