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.

A084695 Triangle read by rows in which row n lists the n smallest positive numbers k such that k + n is a prime.

This page as a plain text file.
%I A084695 #25 Apr 14 2024 03:49:08
%S A084695 1,1,3,2,4,8,1,3,7,9,2,6,8,12,14,1,5,7,11,13,17,4,6,10,12,16,22,24,3,
%T A084695 5,9,11,15,21,23,29,2,4,8,10,14,20,22,28,32,1,3,7,9,13,19,21,27,31,33,
%U A084695 2,6,8,12,18,20,26,30,32,36,42,1,5,7,11,17,19,25,29,31,35,41,47
%N A084695 Triangle read by rows in which row n lists the n smallest positive numbers k such that k + n is a prime.
%H A084695 G. C. Greubel, <a href="/A084695/b084695.txt">Rows n = 1..100 of the triangle, flattened</a>
%F A084695 T(n, k) = prime(PrimePi(n) + k) - n. - _G. C. Greubel_, May 12 2023
%e A084695 Triangle begins:
%e A084695   1;
%e A084695   1,  3;
%e A084695   2,  4,  8;
%e A084695   1,  3,  7,  9;
%e A084695   2,  6,  8, 12, 14;
%e A084695   1,  5,  7, 11, 13, 17;
%e A084695   4,  6, 10, 12, 16, 22, 24;
%t A084695 nn=30;Flatten[With[{prs=Prime[Range[nn]]},Table[Take[prs,{PrimePi[n]+1, PrimePi[n]+n}]-n,{n,Floor[nn/2]}]]] (* _Harvey P. Dale_, Dec 07 2012 *)
%t A084695 Table[Prime[PrimePi[n] +k] -n, {n,16}, {k,n}]//Flatten (* _G. C. Greubel_, May 12 2023 *)
%o A084695 (Magma) [NthPrime(#PrimesUpTo(n) +k) -n: k in [1..n], n in [1..16]]; // _G. C. Greubel_, May 12 2023
%o A084695 (SageMath)
%o A084695 def A084695(n,k): return nth_prime(prime_pi(n) + k) - n
%o A084695 flatten([[A084695(n,k) for k in range(1,n+1)] for n in range(1,17)]) # _G. C. Greubel_, May 12 2023
%Y A084695 First column gives A013632, last gives A084747.
%Y A084695 Cf. A000040, A000720.
%K A084695 easy,nonn,tabl
%O A084695 1,3
%A A084695 _Amarnath Murthy_ and _Jason Earls_, Jul 12 2003