[go: up one dir, main page]

login
A075348
Group the natural numbers such that the n-th group contains n terms and the group sum is the smallest possible prime.
6
2, 1, 4, 3, 5, 9, 6, 7, 8, 10, 11, 12, 13, 14, 17, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 32, 28, 29, 30, 31, 33, 34, 35, 37, 36, 38, 39, 40, 41, 42, 43, 44, 50, 45, 46, 47, 48, 49, 51, 52, 53, 54, 58, 55, 56, 57, 59, 60, 61, 62, 63, 64, 65, 71, 66, 67, 68, 69, 70, 72
OFFSET
1,1
COMMENTS
Row sums (the primes) are in A075345. In case there is more than one way to write the given prime, e.g., A075345(3) = 3+5+9 = 3+6+8, the lexicographically smallest is to be chosen, here (3,5,9) rather than (3,6,8). - M. F. Hasler, Sep 26 2015
The flattened triangle is a permutation of the positive integers with inverse = A262663 and fixed points A262665.
FORMULA
T(n,1)=A075346(n); T(n,n)=A075347(n); A075344(n) = Sum_{k=1..n} T(n,k). - Reinhard Zumkeller, Sep 26 2015
EXAMPLE
Triangle starts:
2;
1, 4;
3, 5, 9;
6, 7, 8, 10;
11, 12, 13, 14, 17;
15, 16, 18, 19, 20, 21;
...
PROG
(Haskell)
import Data.List ((\\))
a075348 n k = a075348_tabl !! (n-1) !! (k-1)
a075348_row n = a075348_tabl !! (n-1)
a075348_tabl = f 0 [1..] where
f x zs = (us ++ [y]) : f (x + 1) (zs \\ (y : us)) where
y = g vs
g (w:ws) = if a010051' (sum us + w) == 1 then w else g ws
(us, vs) = splitAt x zs
a075348_list = concat a075348_tabl
-- Reinhard Zumkeller, Sep 26 2015
CROSSREFS
Cf. A262663 (inverse), A262665 (fixed points).
Sequence in context: A375779 A262663 A375469 * A326062 A055631 A234586
KEYWORD
nonn,tabl
AUTHOR
Amarnath Murthy, Sep 19 2002
EXTENSIONS
Extended by Ray Chandler, Apr 09 2014
Name changed by M. F. Hasler, Sep 26 2015
STATUS
approved