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!)
A258187 Numbers n such that either n^k - 1 or n^k - 2 is prime for some positive k, but not both. 0

%I #25 Jul 22 2015 09:40:48

%S 3,4,5,6,7,8,9,11,12,13,14,15,17,18,19,20,21,23,24,25,27,29,30,31,32,

%T 33,35,37,38,39,41,42,43,44,45,47,48,49,51,53,54,55,57,59,60,61,62,63,

%U 65,67,68,69,71,72,73,74,75,77,79,80,81,83,84,85,87,89,90,91,93,95,97,98,99,101

%N Numbers n such that either n^k - 1 or n^k - 2 is prime for some positive k, but not both.

%C 10 is not in the sequence because all 10^k-2 are even and 10^k-1 are divisible by 3 (because 10^k mod 3 = 1 as 10 mod 3 =1). 16 is not in the sequence because 16^k-2 are even and because 16^k-1 are divisible by 3 (because 16^k mod 3 = 1 as 16 mod 3 =1). For the same reason almost all even numbers of the form 3m+1 (A016957) are absent, the only exception being 4 where 4^1-1 is a prime. - _R. J. Mathar_, Jul 22 2015

%C 36 is not in the sequence because 36^k-1 are even and 36^k-1 are divisible by 5 (because 36^k mod 5 =1 as 36 mod 5 =1). This reasoning excludes all numbers of A017341 (except 6 where 6^1-1 is prime) from this sequence. With the same methology we can fish for (and exclude) even numbers of the form m*p+1 for primes p>=3. - _R. J. Mathar_, Jul 22 2015

%e 2 is not in this sequence because 2^2 - 1 = 3 and 2^2 - 2 = 2 are both prime,

%e 3 is in this sequence because 3^1 - 1 = 2 (prime) and 3^1 - 2 = 1 (nonprime) or 3^2 - 1 = 5 (prime) and 3^2 - 2 = 4 (nonprime).

%o (PARI) is(n)=n>2 && if(n%2,1,isprime(n-1)) \\ _Charles R Greathouse IV_, Jun 03 2015

%K nonn,easy

%O 1,1

%A _Juri-Stepan Gerasimov_, May 23 2015

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 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)