OFFSET
1,2
LINKS
Antti Karttunen, Rows n = 1..144 of triangular table, flattened
FORMULA
G.f. of the k-th column: x^k*((Sum_{i=0..k-1} x^i) - (k-1)*x^k)/((1 - x)^2*Sum_{i=0..k-1} x^i). - Stefano Spezia, May 08 2024
EXAMPLE
Triangle begins:
1
2 1
3 2 1
4 2 2 1
5 3 3 2 1
6 3 2 3 2 1
7 4 3 4 3 2 1
8 4 4 2 4 3 2 1
9 5 3 3 5 4 3 2 1
10 5 4 4 2 5 4 3 2 1
11 6 5 5 3 6 5 4 3 2 1
12 6 4 3 4 2 6 5 4 3 2 1
13 7 5 4 5 3 7 6 5 4 3 2 1
14 7 6 5 6 4 2 7 6 5 4 3 2 1
15 8 5 6 3 5 3 8 7 6 5 4 3 2 1
MATHEMATICA
With[{rows=10}, Table[Floor[n/k]+Mod[n, k], {n, rows}, {k, n}]] (* Paolo Xausa, Sep 26 2023 *)
PROG
(Python)
for n in range(1, 19):
for k in range(1, n+1):
c = n//k + n%k
print('%2d' % c, end=' ')
print()
(Scheme)
;; MIT/GNU Scheme
(define (A234575bi n k) (+ (floor->exact (/ n k)) (modulo n k)))
;; Antti Karttunen, Dec 29 2013
(Haskell)
a234575 n k = a234575_tabl !! (n-1) !! (k-1)
a234575_row n = a234575_tabl !! (n-1)
a234575_tabl = zipWith (zipWith (+)) a048158_tabl a010766_tabl
-- Reinhard Zumkeller, Apr 29 2015
CROSSREFS
KEYWORD
AUTHOR
Alex Ratushnyak, Dec 28 2013
STATUS
approved