login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A114009 Regular triangle where n-th row is composed of n primes beginning with prime(n). 2

%I #25 Jan 19 2023 11:02:14

%S 2,3,31,5,53,59,7,71,73,79,11,113,1103,1109,1117,13,131,137,139,1301,

%T 1303,17,173,179,1709,1721,1723,1733,19,191,193,197,199,1901,1907,

%U 1913,23,233,239,2309,2311,2333,2339,2341,2347,29,293,2903,2909,2917,2927,2939,2953,2957,2963

%N Regular triangle where n-th row is composed of n primes beginning with prime(n).

%H Michael S. Branicky, <a href="/A114009/b114009.txt">Table of n, a(n) for n = 1..11325</a> (rows 1..150)

%e One prime beginning with 2, followed by the two primes 3, 31 beginning with 3.

%e Triangle begins:

%e 2;

%e 3, 31;

%e 5, 53, 59;

%e 7, 71, 73, 79;

%e ...

%t 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 *)

%o (Python)

%o from itertools import count

%o from sympy import isprime, prime

%o def row(n):

%o if n == 1: return [2]

%o pn, c = prime(n), 1; out = [pn]

%o for d in count(1):

%o pow10 = 10**d

%o base = pn * pow10

%o for i in range(1, pow10, 2):

%o t = base + i

%o if isprime(t): out.append(t); c += 1

%o if c == n: return out

%o print([an for r in range(1, 11) for an in row(r)]) # _Michael S. Branicky_, Jan 19 2023

%Y Cf. A000040 (first column).

%K base,nonn,tabl

%O 1,1

%A _Amarnath Murthy_, Nov 12 2005

%E More terms from _Robert G. Wilson v_, Nov 17 2005

%E Name clarified by _Michel Marcus_, Sep 16 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 15:18 EDT 2024. Contains 371960 sequences. (Running on oeis4.)