OFFSET
1,6
COMMENTS
a(n)=1 if the index n is an odd prime.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..8192
Antti Karttunen, Data supplement: n, a(n) computed for n = 1..65537
MAPLE
A006530 := proc(n) option remember; if n = 1 then 1; else max(op(numtheory[factorset](n)) ) ; end if; end proc:
A174869 := proc(n) if n <= 2 then 0; else gpf := A006530(n) ; if gpf = 2 then 0; else for k from 1 do if A006530(n+k) < gpf then return k; end if; end do: end if; end if; end proc:
seq(A174869(n), n=1..120) ; # R. J. Mathar, Aug 10 2010
MATHEMATICA
Block[{s = Array[FactorInteger[#][[-1, 1]] &, 120]}, Array[If[IntegerQ@ Log2[#], 0, Block[{k = 1, n = s[[#]]}, While[n <= s[[# + k]], k++; If[# + k > Length[s], AppendTo[s, FactorInteger[# + k][[-1, 1]] ]] ]; k]] &, 102, 2]] (* Michael De Vlieger, Apr 06 2021 *)
PROG
(PARI)
A006530(n) = if(n>1, vecmax(factor(n)[, 1]), 1);
A174869(n) = if(!bitand(n, n-1), 0, my(gpf=A006530(n)); for(k=1, oo, if(A006530(n+k)<gpf, return(k)))); \\ Antti Karttunen, Apr 06 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Mar 31 2010
EXTENSIONS
More terms from R. J. Mathar, Aug 10 2010
STATUS
approved