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!)
A267178 Array read by antidiagonals: T(n,k) = parity of number of steps in simple Euclidean algorithm for gcd(n,k) where n >= 1, k >= 1. 4

%I #26 Apr 25 2023 14:21:26

%S 1,0,0,1,1,1,0,1,1,0,1,0,1,0,1,0,0,0,0,0,0,1,1,0,1,0,1,1,0,1,0,1,1,0,

%T 1,0,1,0,1,1,1,1,1,0,1,0,0,1,1,0,0,1,1,0,0,1,1,1,0,1,1,1,0,1,1,1,0,1,

%U 0,0,1,1,1,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0

%N Array read by antidiagonals: T(n,k) = parity of number of steps in simple Euclidean algorithm for gcd(n,k) where n >= 1, k >= 1.

%H R. J. Mathar, <a href="/A267178/b267178.txt">Table of n, a(n) for n = 1..4950</a>

%e The array A072030 (before it is reduced mod 2) begins:

%e 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...

%e 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, ...

%e 3, 3, 1, 4, 4, 2, 5, 5, 3, 6, ...

%e 4, 2, 4, 1, 5, 3, 5, 2, 6, 4, ...

%e 5, 4, 4, 5, 1, 6, 5, 5, 6, 2, ...

%e 6, 3, 2, 3, 6, 1, 7, 4, 3, 4, ...

%e 7, 5, 5, 5, 5, 7, 1, 8, 6, 6, ...

%e 8, 4, 5, 2, 5, 4, 8, 1, 9, 5, ...

%e 9, 6, 3, 6, 6, 3, 6, 9, 1, 10, ...

%e 10, 5, 6, 4, 2, 4, 6, 5, 10, 1, ...

%e ...

%e The first few antidiagonals read mod 2 are:

%e 1,

%e 0, 0,

%e 1, 1, 1,

%e 0, 1, 1, 0,

%e 1, 0, 1, 0, 1,

%e 0, 0, 0, 0, 0, 0,

%e 1, 1, 0, 1, 0, 1, 1,

%e 0, 1, 0, 1, 1, 0, 1, 0,

%e 1, 0, 1, 1, 1, 1, 1, 0, 1,

%e 0, 0, 1, 1, 0, 0, 1, 1, 0, 0,

%e 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1,

%e 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0,

%e 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1,

%e ...

%p A267178 := proc(n,k)

%p A072030(n,k) mod 2 ;

%p end proc:

%p seq(seq(A267178(d-k,k),k=1..d-1),d=2..12) ; # _R. J. Mathar_, May 08 2016

%t T[n_, k_] := T[n, k] = Which[n < 1 || k < 1, 0, n == k, 1, n < k, T[k, n], True, 1+T[k, n-k]] // Mod[#, 2]&;

%t Table[T[d-k, k], {d, 2, 15}, {k, 1, d-1}] // Flatten (* _Jean-François Alcover_, Apr 25 2023 *)

%o (PARI)

%o tabl(nn) = {for (n=1, nn,

%o for (k=1, n, a = n-k+1; b = k; r = 1; s = 0; while (r, q = a\b; r = a - b*q; s += q; a = b; b = r); s2=s%2; print1(s2, ", "); );

%o print(); ); }

%o tabl(10)

%Y This is A072030 read mod 2.

%K nonn,tabl

%O 1

%A _N. J. A. Sloane_, Jan 14 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 July 3 09:32 EDT 2024. Contains 373971 sequences. (Running on oeis4.)