A169643 Numbers k such that neither composite(k)+-1 is composite.
1, 2, 6, 10, 19, 28, 42, 51, 75, 79, 104, 114, 138, 148, 152, 178, 187, 212, 221, 247, 278, 338, 348, 372, 423, 465, 490, 504, 525, 539, 669, 679, 683, 709, 729, 848, 858, 873, 883, 909, 961, 1028, 1071, 1080, 1089, 1104, 1202, 1221, 1247, 1251, 1354, 1363
Offset: 1
Keywords
Examples
a(1)=1 because composite(1)-1=3=prime and composite(1)+1=5=prime.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
Comp:= remove(isprime,[$4..2000]): nC:= nops(Comp): select(t -> isprime(Comp[t]-1) and isprime(Comp[t]+1), [$1..nC]); # Robert Israel, Oct 21 2024
-
Mathematica
Position[Select[Range[2000],CompositeQ],?(AllTrue[#+{1,-1},PrimeQ]&),1,Heads->False]// Flatten (* _Harvey P. Dale, Jan 16 2024 *)
Extensions
Corrected by Ray Chandler, Apr 05 2010
Comments