login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A225318 Numbers n such that either prime(n-1) == -1 (mod n) or prime(n+1) == -1 (mod n) but not both. 0
2, 4, 7, 8, 14, 16, 26, 27, 32, 33, 35, 76, 78, 169, 170, 172, 175, 177, 183, 184, 185, 434, 446, 1054, 1056, 2638, 2702, 6468, 15930, 40069, 40070, 40080, 40112, 40115, 40157, 251721, 251758, 251767, 251770, 251788, 637286, 4124464, 4124704 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
2nd prime is 3 and 2 is a member because 1st prime, 2, is congruent to 0 mod 2 and 3rd prime, 5, is congruent to -1 mod 2;
6th prime is 11 and 6 is not a member because 5th prime, 11, is congruent to -1 mod 6 and 7th prime, 17, is congruent to -1 mod 6;
7th prime is 17 and 7 is a member because 6th prime, 13, is congruent to -1 mod 7 and 8th prime, 19, is congruent to 1 mod 6;
14th prime is 43 and 14 is a member because 13th prime, 41, is congruent to -1 mod 14 and 15th prime, 47, is congruent to 5 mod 14.
MAPLE
for n from 2 to 100000 do
if modp(ithprime(n-1), n) = modp(-1, n) then
pn := true ;
else
pn := false ;
end if;
if modp(ithprime(n+1), n) = modp(-1, n) then
pm := true ;
else
pm := false ;
end if;
if pn <> pm then
printf("%d, ", n) ;
end if;
end do: # R. J. Mathar, May 09 2013
PROG
(PARI) is(n)=my(p=prime(n-1), q=nextprime(nextprime(p+1)+1), v=[p+1, q+1]%n); !vecmin(v) && vecmax(v) \\ Charles R Greathouse IV, Mar 18 2014
CROSSREFS
Sequence in context: A102824 A324588 A201364 * A308267 A177805 A003591
KEYWORD
nonn
AUTHOR
Irina Gerasimova, May 05 2013
EXTENSIONS
Corrected by R. J. Mathar, May 09 2013
a(36)-a(43) from Alois P. Heinz, May 18 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)