login
A084695
Triangle read by rows in which row n lists the n smallest positive numbers k such that k + n is a prime.
3
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,3
FORMULA
T(n, k) = prime(PrimePi(n) + k) - n. - G. C. Greubel, May 12 2023
EXAMPLE
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;
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 *)
PROG
(Magma) [NthPrime(#PrimesUpTo(n) +k) -n: k in [1..n], n in [1..16]]; // 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
CROSSREFS
First column gives A013632, last gives A084747.
Sequence in context: A128885 A215335 A229976 * A317704 A201422 A231330
KEYWORD
easy,nonn,tabl
AUTHOR
Amarnath Murthy and Jason Earls, Jul 12 2003
STATUS
approved