cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A175781 a(n) = n^(1/k) with the smallest k>1 such that n is a k-th power, taking k=1 if no such k>1 exists.

This page as a plain text file.
%I A175781 #19 Jan 28 2018 18:36:49
%S A175781 1,2,3,2,5,6,7,2,3,10,11,12,13,14,15,4,17,18,19,20,21,22,23,24,5,26,3,
%T A175781 28,29,30,31,2,33,34,35,6,37,38,39,40,41,42,43,44,45,46,47,48,7,50,51,
%U A175781 52,53,54,55,56,57,58,59,60,61,62,63,8,65,66,67,68,69,70,71,72,73,74,75
%N A175781 a(n) = n^(1/k) with the smallest k>1 such that n is a k-th power, taking k=1 if no such k>1 exists.
%H A175781 Robert Israel, <a href="/A175781/b175781.txt">Table of n, a(n) for n = 1..10000</a>
%e A175781 a(32) = 2 since the least k, in this case 5, yields 32^(1/5) = 2.
%p A175781 f:= proc(n) local F,m;
%p A175781      F:= ifactors(n)[2];
%p A175781      m:= igcd(op(map(t->t[2],F)));
%p A175781      if m = 1 then n
%p A175781      else m:= min(numtheory:-factorset(m)); mul(t[1]^(t[2]/m),t=F)
%p A175781      fi
%p A175781 end proc:
%p A175781 map(f, [$1..100]); # _Robert Israel_, Jan 10 2018
%t A175781 perfectPowerQ[n_] := n == 1 || GCD @@ FactorInteger[n][[All, 2]] > 1; f[n_] := If[ perfectPowerQ@ n, k = 2; While[ !IntegerQ[n^(1/k)], k++]; n^(1/k), n]; Array[f, 75] (* _Robert G. Wilson v_, Jan 09 2018 *)
%o A175781 (PARI) a(n) = my(p = ispower(n)); if (!p, n, sqrtnint(n, divisors(p)[2])); \\ _Michel Marcus_, Jan 02 2018
%Y A175781 Cf. A007947, A052410.
%K A175781 nonn
%O A175781 1,2
%A A175781 _Vincenzo Librandi_, Sep 03 2010
%E A175781 Edited by the Associate Editors of the OEIS, Sep 03 2010
%E A175781 a(32) corrected by _Gionata Neri_, Jan 02 2018