cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

1, 10, 28, 50, 56, 874, 1575, 3604, 4966, 30704, 55964, 56372, 145616, 195016, 200792, 227278, 1679518, 2611874, 3028502, 23070602, 27365684, 45639626
Offset: 1

Views

Author

Dana Jacobsen, Jan 08 2016

Keywords

Comments

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

Examples

			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.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • Perl
    use ntheory ":all"; sub is { my $n = shift; nth_prime($n) == nth_ramanujan_prime(euler_phi($n)); } for (1..1e5) { say if is($_) }
    
  • 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