New answers tagged

4

There is this way: SetAttributes[test, Listable] test[n_] := FirstPosition[Reverse[#[[2 ;; Ceiling[Length[#]/2]]] &[ Divisors[n]]], _?(IntegerQ[Log[#, n]] &), 0] =!= 0 Pick[#, test[#]] &[Range[1000]]


6

I offer the following as a fast way of testing cubic and higher powers primes = Select[Range[59], PrimeQ] Get a list of all the relevant powers up to a specified limit list[nmax_] := Sort[Flatten[Table[Range[2, Floor[nmax^(1/p)]]^p, {p, Drop[primes, 1]}]]]; For example list[1000] (* {8, 27, 32, 64, 125, 128, 216, 243, 343, 512, 729, 1000} *) Define ...



Top 50 recent answers are included