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.

Original entry on oeis.org

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, 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, 2, 6, 8, 12, 18, 20, 26, 30, 32, 36, 42, 1, 5, 7, 11, 17, 19, 25, 29, 31, 35, 41, 47
Offset: 1

Views

Author

Amarnath Murthy and Jason Earls, Jul 12 2003

Keywords

Examples

			Triangle begins:
  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;
		

Crossrefs

First column gives A013632, last gives A084747.

Programs

  • Magma
    [NthPrime(#PrimesUpTo(n) +k) -n: k in [1..n], n in [1..16]]; // G. C. Greubel, May 12 2023
    
  • Mathematica
    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 *)
    Table[Prime[PrimePi[n] +k] -n, {n,16}, {k,n}]//Flatten (* G. C. Greubel, May 12 2023 *)
  • SageMath
    def A084695(n,k): return nth_prime(prime_pi(n) + k) - n
    flatten([[A084695(n,k) for k in range(1,n+1)] for n in range(1,17)]) # G. C. Greubel, May 12 2023

Formula

T(n, k) = prime(PrimePi(n) + k) - n. - G. C. Greubel, May 12 2023