login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A234575 Triangle T(n,k) read by rows: T(n,k) = floor(n/k) + n mod k, with 1<=k<=n. 6

%I #22 Sep 26 2023 10:26:41

%S 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,

%T 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,

%U 6,4,3,4,2,6,5,4,3,2,1,13,7,5,4,5,3,7,6,5

%N Triangle T(n,k) read by rows: T(n,k) = floor(n/k) + n mod k, with 1<=k<=n.

%C T(n,k) = A048158(n,k) + A010766(n,k). - _Reinhard Zumkeller_, Apr 29 2015

%H Antti Karttunen, <a href="/A234575/b234575.txt">Rows n = 1..144 of triangular table, flattened</a>

%e Triangle begins:

%e 1

%e 2 1

%e 3 2 1

%e 4 2 2 1

%e 5 3 3 2 1

%e 6 3 2 3 2 1

%e 7 4 3 4 3 2 1

%e 8 4 4 2 4 3 2 1

%e 9 5 3 3 5 4 3 2 1

%e 10 5 4 4 2 5 4 3 2 1

%e 11 6 5 5 3 6 5 4 3 2 1

%e 12 6 4 3 4 2 6 5 4 3 2 1

%e 13 7 5 4 5 3 7 6 5 4 3 2 1

%e 14 7 6 5 6 4 2 7 6 5 4 3 2 1

%e 15 8 5 6 3 5 3 8 7 6 5 4 3 2 1

%t With[{rows=10},Table[Floor[n/k]+Mod[n,k],{n,rows},{k,n}]] (* _Paolo Xausa_, Sep 26 2023 *)

%o (Python)

%o for n in range(1, 19):

%o for k in range(1, n+1):

%o c = n//k + n%k

%o print('%2d' % c, end=' ')

%o print()

%o (Scheme)

%o ;; MIT/GNU Scheme

%o (define (A234575bi n k) (+ (floor->exact (/ n k)) (modulo n k)))

%o (define (A234575 n) (A234575bi (A002024 n) (A002260 n)))

%o ;; _Antti Karttunen_, Dec 29 2013

%o (Haskell)

%o a234575 n k = a234575_tabl !! (n-1) !! (k-1)

%o a234575_row n = a234575_tabl !! (n-1)

%o a234575_tabl = zipWith (zipWith (+)) a048158_tabl a010766_tabl

%o -- _Reinhard Zumkeller_, Apr 29 2015

%Y Cf. A048158, A010766.

%K nonn,easy,tabl

%O 1,2

%A _Alex Ratushnyak_, Dec 28 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 11:40 EDT 2024. Contains 371936 sequences. (Running on oeis4.)