A276136 Numbers m > 1 such that the largest odd divisors of m-1, m, and m+1 are prime.
6, 11, 12, 13, 23, 47, 192, 193, 383, 786432
Offset: 1
Keywords
Examples
6 is in this sequence because the largest odd divisor of 5 is 5, the largest odd divisor of 6 is 3 and the largest odd divisor of 7 is 7, and all three are prime.
Crossrefs
Programs
-
Magma
[n: n in [2..3000000] | NumberOfDivisors(2*(n-1))- NumberOfDivisors(n-1)eq 2 and NumberOfDivisors(2(n))-NumberOfDivisors(n) eq 2 and NumberOfDivisors(2*(n+1))- NumberOfDivisors(n+1) eq 2];
-
Maple
Res:= 6: for k from 2 while length(3*2^k-1)<1000 do if (isprime(3*2^k-1) and isprime(3*2^(k-1)-1)) then Res:= Res, 3*2^k-1 fi; if (isprime(3*2^k-1) and isprime(3*2^k+1)) then Res:= Res, 3*2^k; fi; if (isprime(3*2^k+1) and isprime(3*2^(k-1)+1)) then Res:= Res, 3*2^k+1; fi; od: Res; # Robert Israel, Apr 27 2020
-
Mathematica
Select[Range[2, 10^6], Function[n, Times @@ Boole@ PrimeQ@ Map[First@ Reverse@ DeleteCases[Divisors@ #, d_ /; EvenQ@ d] &, n + Range[-1, 1]] == 1]] (* Michael De Vlieger, Aug 22 2016 *) SequencePosition[Table[If[PrimeQ[Max[Select[Divisors[n],OddQ]]],1,0],{n,800000}],{1,1,1}][[;;,1]]+1 (* Harvey P. Dale, Jun 27 2023 *)
-
PARI
isA038550(n)=isprime(n>>valuation(n,2)) is(n)=isA038550(n-1) && isA038550(n) && isA038550(n+1) \\ Charles R Greathouse IV, Aug 22 2016
-
PARI
forprime(p=2,1e11, my(a=isA038550(p-1),b=isA038550(p+1)); if(a && isA038550(p-2), print1(p-1", ")); if(a && b, print1(p", ")); if(b && isA038550(p+2), print1(p+1", "))) \\ may print numbers several times, but won't skip numbers; Charles R Greathouse IV, Aug 22 2016
Formula
a(n) >> n log n. - Charles R Greathouse IV, Aug 22 2016
Comments