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.

Showing 1-2 of 2 results.

A051237 Lexicographically earliest prime pyramid, read by rows.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 4, 3, 2, 5, 1, 4, 3, 2, 5, 6, 1, 4, 3, 2, 5, 6, 7, 1, 2, 3, 4, 7, 6, 5, 8, 1, 2, 3, 4, 7, 6, 5, 8, 9, 1, 2, 3, 4, 7, 6, 5, 8, 9, 10, 1, 2, 3, 4, 7, 10, 9, 8, 5, 6, 11, 1, 2, 3, 4, 7, 10, 9, 8, 5, 6, 11, 12, 1, 2, 3, 4, 7, 6, 5, 12, 11, 8, 9, 10, 13, 1, 2, 3, 4, 7, 6, 13, 10
Offset: 1

Views

Author

Keywords

Comments

Row n begins with 1, ends with n and sum of any two adjacent entries is prime.
From Daniel Forgues, May 17 2011 and May 18 2011: (Start)
Since the sum of any two adjacent entries is at least 3, the sum is an odd prime, which implies that any two consecutive entries have opposite parity.
Since the first and last entries of row n are fixed at 1 and n, we have to find n-2 entries, where ceiling((n-2)/2) of them are even and floor((n-2)/2) are odd, so for row n the number of possible arrangements is
(ceiling((n-2)/2))! * (floor((n-2)/2))! (Cf. A010551(n-2), n >= 2.)
The number of ways of arranging row n to get a prime pyramid is given by A036440. List them in lexicographic order and pick the first (earliest) to get row n of lexicographically earliest prime pyramid.
Prime pyramids are also (more fittingly?) called prime triangles. (End)
It appears that the limit of the rows of the lexicographically earliest prime pyramid is A055265 (see comment in that sequence).
Assuming Dickson's conjecture (or the later Hardy-Littlewood Conjecture B), no backtracking is needed: if the first n-2 elements in each row are chosen greedily, a penultimate member can be chosen such that its sums are prime. - Charles R Greathouse IV, May 18 2011

Examples

			Triangle begins:
1;
1, 2;
1, 2, 3;
1, 2, 3, 4;
1, 4, 3, 2, 5;
1, 4, 3, 2, 5, 6;
1, 4, 3, 2, 5, 6, 7;
1, 2, 3, 4, 7, 6, 5, 8;
1, 2, 3, 4, 7, 6, 5, 8, 9;
1, 2, 3, 4, 7, 6, 5, 8, 9, 10;
1, 2, 3, 4, 7, 10, 9, 8, 5, 6, 11;
1, 2, 3, 4, 7, 10, 9, 8, 5, 6, 11, 12;
1, 2, 3, 4, 7, 6, 5, 12, 11, 8, 9, 10, 13;
		

References

  • R. K. Guy, Unsolved Problems Number Theory, Section C1.

Crossrefs

See A187869 for the concatenation of the numbers for each row.

Programs

  • Mathematica
    (* first do *) Needs["Combinatorica`"] (* then *) f[n_] := Block[{r = Range@ n}, While[ Union[ PrimeQ[ Plus @@@ Partition[r, 2, 1]]][[1]] == False, r = NextPermutation@ r]; r]; f[1] = 1; Array[f, 13] // Flatten (* Robert G. Wilson v *)

Extensions

More terms from Jud McCranie

A187871 a(1)=1; for n > 1, a(n) is the smallest number that is formed by arranging the decimal numbers "1", "2", ..., "n" in some order so that the sum of every pair of adjacent numbers "i" "j" is prime.

Original entry on oeis.org

1, 12, 123, 1234, 14325, 143256, 1234765, 12347658, 123476589, 10123476589, 1103211658947, 101121123476589, 11013432111276589, 1011211231458941367, 110134151432111276589, 10112112151431613476589, 1101316151417121123476589, 101121118131615141723476589
Offset: 1

Views

Author

N. J. A. Sloane, Mar 14 2011

Keywords

Comments

A051237 and A187869 are the sequence that result if in addition we require that the number begins with "1" and ends with "n".

Crossrefs

Programs

  • PARI
    See Links section.

Extensions

a(6) to a(10) from Claudio Meller, Mar 14 2011
a(10) corrected by Nathaniel Johnston, Mar 15 2011
More terms from Rémy Sigrist, Nov 28 2021
Showing 1-2 of 2 results.