A327742 Triangle T(k, n) read by rows, where the entries of the triangle are lengths of longest runs of consecutive sums of k-length combinations of first n primes. Specially, T(0, n) = 1.
1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 4, 2, 1, 1, 2, 4, 4, 2, 1, 1, 2, 5, 6, 5, 2, 1, 1, 2, 5, 10, 10, 5, 2, 1, 1, 2, 5, 18, 16, 18, 5, 2, 1, 1, 2, 5, 22, 28, 28, 22, 5, 2, 1, 1, 2, 5, 22, 38, 46, 38, 22, 5, 2, 1, 1, 2, 5, 40, 46, 58, 58, 46, 40, 5, 2, 1, 1, 2, 5, 42, 64, 72, 76, 72, 64, 42, 5, 2, 1
Offset: 0
Examples
Specially, if k=0, then we do not have sums, and this is defined as 1 = T(0, n). Trivially, if k=n, then T(n, n) = 1, since we have only one sum, the sum of first n prime numbers. Nontrivial example: if n=4, we have first four primes {2,3,5,7}. Now, for example, if k=2, we have the following sums of 2-combinations: "5,7,8,9,10,12", since: {2,3} -> 2+3 = 5 {2,5} -> 2+5 = 7 {3,5} -> 3+5 = 8 {2,7} -> 2+7 = 9 {3,7} -> 3+7 = 10 {5,7} -> 5+7 = 12 We now see that the triangle entry is: T(k=2, n=4)=4, since "7,8,9,10" is the longest run of consecutive sums of 2-combinations of first 4 primes. First 16 rows of triangle T(k, n) where n=0..15, k=0..n: 1; 1, 1; 1, 2, 1; 1, 2, 2, 1; 1, 2, 4, 2, 1; 1, 2, 4, 4, 2, 1; 1, 2, 5, 6, 5, 2, 1; 1, 2, 5, 10, 10, 5, 2, 1; 1, 2, 5, 18, 16, 18, 5, 2, 1; 1, 2, 5, 22, 28, 28, 22, 5, 2, 1; 1, 2, 5, 22, 38, 46, 38, 22, 5, 2, 1; 1, 2, 5, 40, 46, 58, 58, 46, 40, 5, 2, 1; 1, 2, 5, 42, 64, 72, 76, 72, 64, 42, 5, 2, 1; 1, 2, 5, 46, 70, 94, 94, 94, 94, 70, 46, 5, 2, 1; 1, 2, 5, 60, 76, 102, 118, 114, 118, 102, 76, 60, 5, 2, 1; 1, 2, 5, 66, 94, 124, 130, 142, 142, 130, 124, 94, 66, 5, 2, 1;
Links
- Matej Veselovac, (T(k, n) mod n) mod 2 visualization..
- Math StackExchange, How many natural number between 100 and 1000 exist which can be expressed as sum of 10 different primes..
- Wikipedia, Numerical results on prime gaps.
Crossrefs
Programs
-
Python
p = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53] from itertools import combinations, groupby, count def T(k, n): if k==0: return [0] lst = sorted(set([sum(combo) for combo in combinations(p[:n], k)])) c = count() return max((list(g) for _, g in groupby(lst, lambda x: x-next(c))), key=len) for n in range(len(p)+1): for k in range(n+1): print(len(T(k,n)),end=", ") #print()
Comments