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!)
A213126 Rows of triangle formed using Pascal's rule, except sums in the n-th row are modulo n: T(n,0) = T(n,n) = 1 and T(n,k) = (T(n-1,k-1) + T(n-1,k)) mod n. 1

%I #26 Oct 01 2023 16:34:02

%S 1,1,1,1,0,1,1,1,1,1,1,2,2,2,1,1,3,4,4,3,1,1,4,1,2,1,4,1,1,5,5,3,3,5,

%T 5,1,1,6,2,0,6,0,2,6,1,1,7,8,2,6,6,2,8,7,1,1,8,5,0,8,2,8,0,5,8,1,1,9,

%U 2,5,8,10,10,8,5,2,9,1,1,10,11,7,1,6,8,6

%N Rows of triangle formed using Pascal's rule, except sums in the n-th row are modulo n: T(n,0) = T(n,n) = 1 and T(n,k) = (T(n-1,k-1) + T(n-1,k)) mod n.

%e Triangle begins:

%e 1;

%e 1, 1;

%e 1, 0, 1;

%e 1, 1, 1, 1;

%e 1, 2, 2, 2, 1;

%e 1, 3, 4, 4, 3, 1;

%e 1, 4, 1, 2, 1, 4, 1;

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

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

%e 1, 7, 8, 2, 6, 6, 2, 8, 7, 1;

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

%e 1, 9, 2, 5, 8, 10, 10, 8, 5, 2, 9, 1;

%t T[n_,k_]:=If[k==0 || k==n, 1, Mod[T[n - 1, k - 1] + T[n- 1, k], n]]; Table[T[n, k], {n, 0, 15}, {k, 0, n}] // Flatten (* _Indranil Ghosh_, Apr 29 2017 *)

%o (Python)

%o src = [0]*1024

%o dst = [0]*1024

%o for n in range(19):

%o dst[0] = dst[n] = 1

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

%o dst[k] = (src[k-1]+src[k]) % n

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

%o src[k] = dst[k]

%o print(dst[k], end=',')

%Y Cf. A007318 - Pascal's triangle read by rows.

%Y Cf. A047999, A083093, A034931, A034930, A034932, A008975.

%K nonn,tabl

%O 0,12

%A _Alex Ratushnyak_, Jun 06 2012

%E Offset corrected by _Joerg Arndt_, Dec 05 2016

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 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)