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!)
A049765 Triangular array T, read by rows: T(n,k) = (k mod n) + (n mod k), for k = 1..n and n >= 1. 2

%I #20 Sep 08 2022 08:44:58

%S 0,1,0,1,3,0,1,2,4,0,1,3,5,5,0,1,2,3,6,6,0,1,3,4,7,7,7,0,1,2,5,4,8,8,

%T 8,0,1,3,3,5,9,9,9,9,0,1,2,4,6,5,10,10,10,10,0,1,3,5,7,6,11,11,11,11,

%U 11,0,1,2,3,4,7,6,12,12,12,12,12,0

%N Triangular array T, read by rows: T(n,k) = (k mod n) + (n mod k), for k = 1..n and n >= 1.

%H G. C. Greubel, <a href="/A049765/b049765.txt">Rows n = 1..100 of triangle, flattened</a>

%e Triangle T(n,k) (with rows n >= 1 and columns k >= 1) begins as follows:

%e 0;

%e 1, 0;

%e 1, 3, 0;

%e 1, 2, 4, 0;

%e 1, 3, 5, 5, 0;

%e 1, 2, 3, 6, 6, 0;

%e 1, 3, 4, 7, 7, 7, 0;

%e 1, 2, 5, 4, 8, 8, 8, 0;

%e 1, 3, 3, 5, 9, 9, 9, 9, 0;

%e 1, 2, 4, 6, 5, 10, 10, 10, 10, 0;

%e ...

%p seq(seq( `mod`(k, n) + `mod`(n, k), k = 1..n), n = 1..15); # _G. C. Greubel_, Dec 13 2019

%t Table[Mod[k,n] + Mod[n,k], {n,15}, {k,n}]//Flatten (* _G. C. Greubel_, Dec 13 2019 *)

%o (PARI) T(n,k) = k%n + n%k;

%o for(n=1,15, for(k=1,n, print1(T(n,k), ", "))) \\ _G. C. Greubel_, Dec 13 2019

%o (Magma) [[(k mod n) + (n mod k): k in [1..n]]: n in [1..15]]; // _G. C. Greubel_, Dec 13 2019

%o (Sage) [[(k%n) + (n%k) for k in (1..n)] for n in (1..15)] # _G. C. Greubel_, Dec 13 2019

%o (GAP) Flat(List([1..15], n-> List([1..n], k-> (k mod n) + (n mod k) ))); # _G. C. Greubel_, Dec 13 2019

%Y Row sums are in A049766.

%Y Cf. A048158, A049767, A049768.

%K nonn,tabl

%O 1,5

%A _Clark Kimberling_

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 23 08:33 EDT 2024. Contains 371905 sequences. (Running on oeis4.)