OFFSET
1,1
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
43 is included because 43 - 1 = 2 * 3 * 7 and 43 + 1 = 2^2 * 11 are both cubefree.
71 is omitted because the p+1 side, 72 = 2^3 * 3^2, has a cube factor.
MAPLE
isA089194 := proc(n)
if isprime(n) then
isA004709(n-1) and isA004709(n+1) ;
else
false;
end if;
end proc: # R. J. Mathar, Dec 08 2015
MATHEMATICA
f[n_]:=Module[{a=m=0}, Do[If[FactorInteger[n][[m, 2]]>2, a=1], {m, Length[FactorInteger[n]]}]; a]; lst={}; Do[p=Prime[n]; If[f[p-1]==0&&f[p+1]==0, AppendTo[lst, p]], {n, 6!}]; lst (* Vladimir Joseph Stephan Orlovsky, Jul 15 2009 *)
p3fQ[n_]:=Max[Transpose[FactorInteger[n]][[2]]]<3; Select[Prime[Range[ 200]], AllTrue[#+{1, -1}, p3fQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Apr 08 2015 *)
PROG
(PARI)
\\ input number of iterations n, power p and the number to subtract k.
powerfreep2(n, p, d) = { c=0; pc=0; forprime(x=2, n, pc++; if(ispowerfree(x-d, p) && ispowerfree(x+d, p), c++; print1(x", "); ) ); print(); print(c", "pc", "c/pc+.0) }
ispowerfree(m, p1) = { flag=1; y=component(factor(m), 2); for(i=1, length(y), if(y[i] >= p1, flag=0; break); ); return(flag) }
(Haskell)
a089194 n = a089194_list !! (n-1)
a089194_list = filter ((== 1) . a212793 . (+ 1)) a097375_list
-- Reinhard Zumkeller, May 27 2012
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Dec 08 2003
STATUS
approved