A162872 Primes p such that p-1 and p+1 each contain at least one squared prime in their prime factorization.
19, 149, 197, 199, 293, 307, 349, 491, 523, 557, 577, 739, 773, 883, 1013, 1051, 1061, 1151, 1171, 1277, 1451, 1493, 1531, 1549, 1601, 1637, 1667, 1693, 1709, 1733, 1747, 1861, 1949, 2069, 2141, 2179, 2251, 2351, 2357, 2467, 2549, 2683, 2789, 2843, 2851
Offset: 1
Keywords
Examples
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.
Links
- R. J. Mathar and Robert Israel, Table of n, a(n) for n = 1..10000 (n = 1..536 from R. J. Mathar)
Programs
-
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 ospQ[n_]:=AnyTrue[FactorInteger[n+1][[;;,2]],#==2&]&&AnyTrue[FactorInteger[n-1][[;;,2]],#==2&]; Select[Prime[Range[500]],ospQ] (* Harvey P. Dale, May 11 2025 *)
Formula
Extensions
Role of squarefree numbers clarified by R. J. Mathar, Jul 31 2007
Comments