OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..11325 (rows 1..150)
EXAMPLE
One prime beginning with 2, followed by the two primes 3, 31 beginning with 3.
Triangle begins:
2;
3, 31;
5, 53, 59;
7, 71, 73, 79;
...
MATHEMATICA
f[n_] := Block[{c = 0, t = {}, p = Prime[n]}, k = PrimePi[p]; lng = Ceiling[Log[10, p]]; While[c < n, q = Prime[k]; If[p == FromDigits@Take[IntegerDigits@q, lng], c++; AppendTo[t, q]]; k++ ]; t]; Array[f, 10] // Flatten (* Robert G. Wilson v, Nov 17 2005 *)
PROG
(Python)
from itertools import count
from sympy import isprime, prime
def row(n):
if n == 1: return [2]
pn, c = prime(n), 1; out = [pn]
for d in count(1):
pow10 = 10**d
base = pn * pow10
for i in range(1, pow10, 2):
t = base + i
if isprime(t): out.append(t); c += 1
if c == n: return out
print([an for r in range(1, 11) for an in row(r)]) # Michael S. Branicky, Jan 19 2023
CROSSREFS
KEYWORD
AUTHOR
Amarnath Murthy, Nov 12 2005
EXTENSIONS
More terms from Robert G. Wilson v, Nov 17 2005
Name clarified by Michel Marcus, Sep 16 2013
STATUS
approved