login
Numbers n such that the n-th prime equals the n-th Ramanujan prime of the totient of n.
0

%I #13 Oct 13 2017 00:18:45

%S 1,10,28,50,56,874,1575,3604,4966,30704,55964,56372,145616,195016,

%T 200792,227278,1679518,2611874,3028502,23070602,27365684,45639626

%N Numbers n such that the n-th prime equals the n-th Ramanujan prime of the totient of n.

%C n such that A000040(n) = A104272(A000010(n)).

%C Values are not prime, since for n > 1, A104272(n) > 2 * A000040(n) and A000010(n) = n-1 for prime n.

%e 28 is in the sequence because the totient of 28 is 12, the 12th Ramanujan prime is 107, and the 28th prime is also 107.

%t lim = 60000; r = Table[0, {lim}]; s = 0; Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s < lim, r[[s + 1]] = k], {k, Prime[3 lim]}]; r = r + 1; Select[Range@ lim, Prime@ # == r[[EulerPhi@ #]] &] (* _Michael De Vlieger_, Jan 09 2016, after _T. D. Noe_ at A104272 *)

%o (Perl) use ntheory ":all"; sub is { my $n = shift; nth_prime($n) == nth_ramanujan_prime(euler_phi($n)); } for (1..1e5) { say if is($_) }

%o (Perl) use ntheory ":all"; my $lim = 1e7; my($pr,$rp) = (primes(nth_prime($lim)), ramanujan_primes(nth_ramanujan_prime($lim))); for (1..$lim) { say if $pr->[$_-1] == $rp->[euler_phi($_)-1]; } # high memory use but faster

%Y Cf. A000010, A000040, A104272.

%K nonn,more

%O 1,2

%A _Dana Jacobsen_, Jan 08 2016