login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A074984 m^p-n, for smallest m^p>=n. 0

%I #12 Apr 19 2013 07:49:00

%S 0,2,1,0,3,2,1,0,0,6,5,4,3,2,1,0,8,7,6,5,4,3,2,1,0,1,0,4,3,2,1,0,3,2,

%T 1,0,12,11,10,9,8,7,6,5,4,3,2,1,0,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,

%U 16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,18,17,16,15,14,13,12,11,10,9,8

%N m^p-n, for smallest m^p>=n.

%C a(n) = 0 if n = m^p that is if n is a full power (square, cube etc.).

%t powerQ[n_] := GCD @@ FactorInteger[n][[All, 2]] > 1; powerQ[1] = True; a[n_] := For[k = n, True, k++, If[powerQ[k], Return[k-n]]]; Table[a[n], {n, 1, 92}] (* _Jean-François Alcover_, Apr 19 2013 *)

%o (PARI) a(n) = { if (n==1, return (0)); my(nn = n); while(! ispower(nn), nn++); return (nn - n);} \\ _Michel Marcus_, Apr 19 2013

%K nonn

%O 1,2

%A _Zak Seidov_, Oct 07 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 11:35 EDT 2024. Contains 371912 sequences. (Running on oeis4.)