OFFSET
1,1
COMMENTS
The selection criterion is that p-1 and p+1 are in the subsequence 4=2^2, 9=3^2, 12=2^2*3, 18=2*3^2, ... of nonsquarefree numbers (A013929) that actually display at least one square in their standard prime factorization.
So at least one of the e_i in p-1=product p_i^e_i, and at least one of the e_j in p+1=product p_j^e_j must equal 2. This is more stringent than being nonsquarefree, and the sequence becomes a subsequence of A075432.
LINKS
R. J. Mathar and Robert Israel, Table of n, a(n) for n = 1..10000 (n = 1..536 from R. J. Mathar)
FORMULA
EXAMPLE
19 is in the sequence because 19 - 1 = 2*3^2 contains 3^2 and because 19 + 1 = 2^2*5 contains 2^2 in the factorization.
MAPLE
isA162872 := proc(n)
if isprime(n) then
isA038109(n-1) and isA038109(n+1) ;
else
false;
end if;
end proc:
n := 1:
for c from 1 to 50000 do
if isA162872(c) then
printf("%d %d\n", n, c) ;
n := n+1 ;
end if; # R. J. Mathar, Dec 08 2015
N:= 10^5: # to get all terms < N, where N is even
V:= Vector(N/2):
for i from 1 do
p:= ithprime(i);
if p^2 > N+1 then break fi;
if p = 2 then inds:= 2*[seq(i, i=1..floor(N/4), 2)]
else inds:= p^2*select(t -> t mod p <> 0, [$1..floor(N/2/p^2)])
fi;
V[inds]:= 1;
od:
select(t -> V[(t-1)/2] = 1 and V[(t+1)/2] = 1 and isprime(t), [seq(t, t=3..N, 2)]); # Robert Israel, 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]==1&&f[p+1]==1, AppendTo[lst, p]], {n, 7!}]; lst
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Jul 15 2009
EXTENSIONS
Role of squarefree numbers clarified by R. J. Mathar, Jul 31 2007
STATUS
approved