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.

A181902 Numbers k such that the k-th triangular number is prime or the arithmetic mean of 2 successive primes.

This page as a plain text file.
%I A181902 #33 Sep 08 2022 08:45:54
%S A181902 2,3,5,6,9,14,15,21,24,26,30,38,39,41,48,53,54,78,80,81,87,89,92,104,
%T A181902 116,117,119,121,122,125,126,146,149,150,153,156,158,164,165,170,171,
%U A181902 185,186,194,206,210,218,245,248,252,255,258,270,281,285,290,296,297
%N A181902 Numbers k such that the k-th triangular number is prime or the arithmetic mean of 2 successive primes.
%H A181902 Charles R Greathouse IV, <a href="/A181902/b181902.txt">Table of n, a(n) for n = 1..10000</a>
%e A181902 2 is a term because 2*(2+1)/2 = 3 is prime,
%e A181902 3 is a term because 3*(3+1)/2 = (5+7)/2,
%e A181902 5 is a term because 5*(5+1)/2 = (13+17)/2.
%t A181902 a = {2}; For[n = 1, n < 320, n++, t = n*(n + 1)/2;
%t A181902 If[t == (NextPrime[t] + NextPrime[t, -1])/2, AppendTo[a, n],
%t A181902   1]]; Print[a]; (* _David Scambler_, Apr 02 2012 *)
%o A181902 (PARI) is(n)=n*=(n+1)/2;n>1&&2*n==nextprime(n)+precprime(n) \\ _Charles R Greathouse IV_, Apr 04 2012
%o A181902 (Magma) [2] cat [n: n in [3..320] | 2*t eq PreviousPrime(t)+NextPrime(t) where t is n*(n+1) div 2]; // _Bruno Berselli_, Apr 04 2012
%Y A181902 Cf. A000217, A001043.
%K A181902 nonn
%O A181902 1,1
%A A181902 _Juri-Stepan Gerasimov_, Mar 31 2012
%E A181902 Terms corrected by _Gerasimov Sergey_, _R. J. Mathar_, and _Charles R Greathouse IV_, Apr 04 2012