%I #29 Jun 18 2021 17:09:11
%S 5,7,11,23,47,59,83,107,167,179,227,239,263,347,359,383,443,467,479,
%T 503,563,587,647,659,719,827,839,863,887,983,1019,1187,1223,1259,1283,
%U 1307,1319,1367,1439,1487,1499,1523,1619,1787,1823,1847,1907,2027,2039,2063
%N Primes p such that there are no primes q, 3 < q < p, such that (q-1) divides (p-1).
%C Using a sieve, these primes can be generated quickly. In the set of primes < 10^9, the density of these primes is about 1/10. It is easy to show that this sequence contains all "safe" primes (A005385).
%C Primes p such that 6p is the denominator of some Bernoulli number. - _T. D. Noe_, Sep 26 2006
%C Except for 5 and 7, primes p such that 12p is the denominator of B(p - 1)/(p - 1) where B(n) is the Bernoulli number. [_Peter Luschny_, Dec 24 2008]
%C Primes p such that A027642(p-1) = 6p. Composites m such that A027642(m-1) = 6m are Carmichael numbers 310049210890163447, 18220439770979212619, ... - _Amiram Eldar_ and _Thomas Ordowski_, May 26 2021
%H T. D. Noe, <a href="/A092307/b092307.txt">Table of n, a(n) for n=1..1000</a>
%H P. Luschny, <a href="http://www.luschny.de/math/zeta/VonStaudtPrimes.html">Von Staudt prime number, definition and computation.</a> [From _Peter Luschny_, Dec 24 2008]
%F Let h(x) = 12x(x + log(exp(-x) -1) - log(x)) and [x^n]S(h) denote the coefficient of x^n in the series expansion of h. Consider for n > 1 the relation n = denominator((n - 1)![x^n]S(h)). [_Peter Luschny_, Dec 24 2008]
%e 11 is in the sequence because 10 is not a multiple of either 4 or 6.
%e 13 is not in the sequence because, although 12 is not a multiple of 6 or 10, it is a multiple of 4.
%p For p>7: seq(`if`(denom(bernoulli(n-1)/(n-1))=12*n,n,NULL),n=2..500); # _Peter Luschny_, Dec 24 2008
%t t = Table[p = Prime[n]; Length[Select[Divisors[p - 1] + 1, PrimeQ]], {n, 311}]; Prime[Flatten[Position[t, 3]]]
%t npqQ[n_]:=NoneTrue[Prime[Range[3,PrimePi[n]-1]],Mod[n-1,#-1]==0&]; Select[ Prime[ Range[3,400]],npqQ] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, May 26 2019 *)
%o (Perl) use ntheory ":all"; forprimes { say if (bernfrac($_-1))[1] == 6*$_ } 1000; # _Dana Jacobsen_, Dec 29 2015
%o (Perl) use ntheory ":all"; forprimes { my $p=$_; say if vecnone { $_ > 3 && $_ < $p-1 && is_prime($_+1) } divisors($p-1); } 5,1000; # _Dana Jacobsen_, Dec 29 2015
%Y Cf. A090801 (distinct numbers appearing as denominators of Bernoulli numbers)
%Y Cf. A092308 (for p=prime(n), the number of primes q such that q-1 divides p-1).
%Y Cf. A005385 (primes p such that (p-1)/2 is also prime).
%Y Cf. A152951. [From _Peter Luschny_, Dec 24 2008]
%K nonn
%O 1,1
%A _T. D. Noe_, Feb 12 2004