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.

A124939 Prime tetrahedron, read by rows.

This page as a plain text file.
%I A124939 #12 Feb 16 2025 08:33:03
%S A124939 1,1,1,2,1,1,4,1,6,5,1,1,10,1,12,7,1,16,3,8,1,1,18,1,22,9,1,28,13,24,
%T A124939 1,30,11,20,17,1,1,36,1,40,19,1,42,25,34,1,46,15,14,23,1,52,21,26,27,
%U A124939 32,1,1,58,1,60,29,1,66,31,48,1,70,33,38,35,1,72,37,64,39,44,1,78,49,54,43
%N A124939 Prime tetrahedron, read by rows.
%C A124939 Each triangular layer of the unique tetrahedron begins with 1, never uses any value other than 1 which has occurred already on this or earlier levels, always uses the least available integer such that the sum of each two consecutive entries is a prime. The number of values of the n-th level is the n-th triangular number A000217(n) = C(n+1,2) = n(n+1)/2 = 0+1+2+...+n. The number of values through the n-th level is the n-th tetrahedral number A000292(n) = C(n+2,3) = n(n+1)(n+2)/6.
%D A124939 R. K. Guy, Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, p. 106, 1994.
%D A124939 Kenney, M. J. "Student Math Notes." NCTM News Bulletin. Nov. 1986.
%H A124939 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimeTriangle.html">Prime Triangle</a>.
%F A124939 a(n) flattens the 3-D table so that level 1 (the apex, with only the value 1) occurs first, then level 2 (with values 1, 1, 2), then level 3 ... and for each level, reads that triangle by rows.
%e A124939 Tetrahedron begins
%e A124939 =================
%e A124939 1
%e A124939 =================
%e A124939 1
%e A124939 1..2
%e A124939 =================
%e A124939 1
%e A124939 1..4
%e A124939 1..6..5
%e A124939 =================
%e A124939 1
%e A124939 1.10
%e A124939 1.12..7
%e A124939 1.16..3..8
%e A124939 =================
%e A124939 1
%e A124939 1.18
%e A124939 1.22..9
%e A124939 1.28.13.24
%e A124939 1.30.11.20.17
%e A124939 =================
%p A124939 srch := proc(a) local res ; res := 2 ; while true do if isprime(res+op(-1,a)) and not ( res in a ) then RETURN(res) ; fi ; res := res+1 ; od ; end: a := [] ; for lvl from 1 to 10 do for row from 1 to lvl do for col from 1 to row do if col = 1 then anxt := 1 ; else anxt := srch(a) ; fi ; printf("%d,",anxt) ; a := [op(a), anxt] ; od ; od ; od ; # _R. J. Mathar_, Jan 13 2007
%Y A124939 Cf. A000040, A000217, A000292, A036440 Number of ways of arranging row n of the Prime Pyramid, A051239, A051237 Lexicographically earliest Prime Pyramid, read by rows.
%K A124939 easy,nonn,tabf
%O A124939 1,4
%A A124939 _Jonathan Vos Post_, Nov 13 2006
%E A124939 Corrected and extended by _R. J. Mathar_, Jan 13 2007