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.

A191225 Number of Ramanujan primes R_k between triangular numbers T(n-1) < R_k <= T(n).

This page as a plain text file.
%I A191225 #27 Nov 07 2018 04:17:51
%S A191225 0,1,0,0,1,1,0,1,1,1,1,2,0,2,1,1,2,1,2,0,2,3,2,1,2,2,2,1,4,2,2,1,0,4,
%T A191225 3,5,1,3,2,1,5,1,2,3,4,4,4,2,2,2,4,2,3,4,3,5,4,3,2,5,4,2,5,1,6,1,5,5,
%U A191225 7,2,2,1,10,6,6,2,2,5,0,3,7,5,4,6,7,4
%N A191225 Number of Ramanujan primes R_k between triangular numbers T(n-1) < R_k <= T(n).
%C A191225 The function eta(x), A191228, returns the greatest value of k of R_k <= x, and where R_k is the k-th Ramanujan prime (A104272).
%H A191225 T. D. Noe, <a href="/A191225/b191225.txt">Table of n, a(n) for n = 1..10000</a>
%H A191225 J. Sondow, J. W. Nicholson, and T. D. Noe, <a href="http://arxiv.org/abs/1105.2249"> Ramanujan Primes: Bounds, Runs, Twins, and Gaps</a>, J. Integer Seq. 14 (2011) Article 11.6.2
%F A191225 a(n) = eta(T(n))- eta(T(n-1)).
%e A191225 Write the numbers 1, 2, ... in a triangle with n terms in the n-th row; a(n) = number of Ramanujan primes in n-th row.
%e A191225 Triangle begins
%e A191225 1                 (0 Ramanujan primes, eta(1) = 0)
%e A191225 2  3              (1 Ramanujan primes, eta(3) - eta(1) = 1)
%e A191225 4  5  6           (0 Ramanujan primes, eta(6) - eta(3) = 0)
%e A191225 7  8  9  10       (0 Ramanujan primes, eta(10) - eta(6) = 0)
%e A191225 11 12 13 14 15    (1 Ramanujan primes, eta(15) - eta(10) = 1)
%e A191225 16 17 18 19 20 21 (1 Ramanujan primes, eta(21) - eta(15) = 1)
%t A191225 terms = 100; nn = terms^2; R = Table[0, {nn}]; s = 0;
%t A191225 Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s < nn, R[[s+1]] = k], {k, Prime[3 nn]}];
%t A191225 A104272 = R + 1;
%t A191225 eta = Table[Boole[MemberQ[A104272, k]], {k, 1, nn}] // Accumulate;
%t A191225 T[n_] := n(n+1)/2;
%t A191225 a[1] = 0; a[n_] := eta[[T[n]]] - eta[[T[n-1]]];
%t A191225 Array[a, terms] (* _Jean-François Alcover_, Nov 07 2018, using _T. D. Noe_'s code for A104272 *)
%o A191225 (Perl) use ntheory ":all"; sub a191225 { my $n = shift; ramanujan_prime_count( (($n-1)*$n)/2+1, ($n*($n+1))/2 ); } say a191225($_) for 1..10; # _Dana Jacobsen_, Dec 30 2015
%Y A191225 Cf. A000217, A000040, A104272, A191228, A014085, A190661, A083382, A191226, A191227.
%K A191225 nonn
%O A191225 1,12
%A A191225 _John W. Nicholson_, May 27 2011