login
A234575
Triangle T(n,k) read by rows: T(n,k) = floor(n/k) + n mod k, with 1<=k<=n.
7
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
OFFSET
1,2
FORMULA
T(n,k) = A048158(n,k) + A010766(n,k). - Reinhard Zumkeller, Apr 29 2015
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)))
(define (A234575 n) (A234575bi (A002024 n) (A002260 n)))
;; 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
Sequence in context: A082404 A334725 A120885 * A294733 A275724 A375025
KEYWORD
nonn,easy,tabl
AUTHOR
Alex Ratushnyak, Dec 28 2013
STATUS
approved