# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a217831 Showing 1-1 of 1 %I A217831 #51 May 14 2024 16:59:38 %S A217831 0,1,1,0,1,0,0,1,1,0,0,1,0,1,0,0,1,1,1,1,0,0,1,0,0,0,1,0,0,1,1,1,1,1, %T A217831 1,0,0,1,0,1,0,1,0,1,0,0,1,1,0,1,1,0,1,1,0,0,1,0,1,0,0,0,1,0,1,0,0,1, %U A217831 1,1,1,1,1,1,1,1,1,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,1,1,1,1 %N A217831 Euclid's triangle read by rows. T(n, k) = 1 if k is prime to n, otherwise 0. %C A217831 Turner defined his triangle T by use of a 'neck-tie' device, and a 'double-cycling' procedure, in order to define his cycle-numbers. See the links below for further details. %C A217831 From _Peter Luschny_, Jul 28 2023: (Start) %C A217831 Two nonnegative integers n, k are relatively prime or coprime if they are not both equal to 0 and there does not exist an integer d > 1 with d | k and d | n. The triangle is the indicator function of this relation, for 0 <= k <= n. %C A217831 J. C. Turner thinks that a development of the number system that is more basic than the one obtained from Peano's axioms can be based on this triangle, with the basic concepts of the set {0, 1}, the zero number 0, and a cycle generation operation that he describes in his paper. (End) %D A217831 Ronald L. Graham, Donald E. Knuth, and Oren Patashnik, Concrete Mathematics, Addison-Wesley, Reading, 2nd ed. 1994, thirty-fourth printing 2022, p.115. [The authors propose to use the term 'prime' instead of 'coprime' (as in "a is prime to b"), a suggestion followed in the title.] %H A217831 Paolo Xausa, Table of n, a(n) for n = 0..11475 (rows 0..150 of the triangle, flattened). %H A217831 John C. Turner, Musings of a Mathematician %H A217831 John C. Turner and William J. Rogers, A representation of the natural numbers by means of cycle-numbers, with consequences in number theory, Annales Mathematicae et Informaticae, 41 (2013) pp. 235-254. Presented to the Fifteenth International Conference on Fibonacci numbers and Their Applications, in Eger, Hungary, on 25 June 2012. See also. %H A217831 Eric Weisstein's World of Mathematics, Relatively Prime. %H A217831 Wikipedia, Coprime integers. %F A217831 Previous name was: Label the entries T(0,0), T(1,0), T(0,1), T(2,0), T(1,1), T(0,2), T(3,0), ... Then T(n,k) = T(k,n), T(0,0) = 0, T(1,0) = 1, and for n > 1, T(n,0) = 0 and T(n,in+j) = T(n-j,j) (i,j >= 0, not both 0). %F A217831 From _Peter Luschny_, Jul 28 2023: (Start) %F A217831 T(n, 0) = 1 = T(n, n) if n = 1, otherwise 0. %F A217831 T(n, 1) = 1 = T(n, n-1) if n >= 1. %F A217831 For n >= 2 the row sum is A000010(n). %F A217831 Each row is palindromic. (End) %e A217831 The triangle begins: %e A217831 [ 0] [0], %e A217831 [ 1] [1, 1], %e A217831 [ 2] [0, 1, 0], %e A217831 [ 3] [0, 1, 1, 0], %e A217831 [ 4] [0, 1, 0, 1, 0], %e A217831 [ 5] [0, 1, 1, 1, 1, 0], %e A217831 [ 6] [0, 1, 0, 0, 0, 1, 0], %e A217831 [ 7] [0, 1, 1, 1, 1, 1, 1, 0], %e A217831 [ 8] [0, 1, 0, 1, 0, 1, 0, 1, 0], %e A217831 [ 9] [0, 1, 1, 0, 1, 1, 0, 1, 1, 0], %e A217831 [10] [0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0], %e A217831 [11] [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], %e A217831 ... %e A217831 Seen as an array: %e A217831 [ 0] 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... %e A217831 [ 1] 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... %e A217831 [ 2] 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, ... %e A217831 [ 3] 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, ... %e A217831 [ 4] 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, ... %e A217831 [ 5] 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, ... %e A217831 [ 6] 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, ... %e A217831 [ 7] 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, ... %e A217831 [ 8] 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, ... %e A217831 [ 9] 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, ... %e A217831 [10] 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, ... %e A217831 [11] 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, ... %p A217831 T := proc(n,k) option remember; local j; %p A217831 if n=0 and k=0 then 0; %p A217831 elif n=1 then 1; %p A217831 elif k=0 or k=n then 0; %p A217831 elif k>n then T(k,n); %p A217831 else j:= (k mod n); T(n-j,j); fi; end; %p A217831 g := n -> [seq(T(n-i,i), i=0..n)]; %p A217831 [seq(g(n),n=0..20)]; # _Peter Luschny_, Jul 28 2023 %p A217831 # Alternative: %p A217831 A217831 := (n, k) -> if NumberTheory:-AreCoprime(n, k) then 1 else 0 fi: %p A217831 for n from 0 to 11 do seq(A217831(n, k),k=0..n) od; # _Peter Luschny_, May 14 2024 %t A217831 T[n_, k_] := T[n, k] = Module[{i, j}, Which[n == 0 && k == 0, 0, n == 1, 1, k == 0 || k == n, 0, k>n, T[k, n], True, j = Mod[k, n]; i = (k-j)/n; T[n-j, j]]]; g[n_] := Table[T[n-i, i], {i, 0, n}]; Table[g[n], {n, 0, 20}] // Flatten (* _Jean-François Alcover_, Mar 06 2014, after Maple *) %t A217831 Table[Boole[CoprimeQ[n,k]],{n,0,10},{k,0,n}] (* _Paolo Xausa_, Nov 24 2023 *) %o A217831 (SageMath) %o A217831 def coprimes(n): return [int(gcd(i, n) == 1) for i in (0..n)] %o A217831 for n in range(12): print(coprimes(n)) # _Peter Luschny_, Jul 28 2023 %o A217831 (Python) %o A217831 def Euclid(x, y): %o A217831 while y != 0: t = y; y = x % y; x = t %o A217831 return 1 if x == 1 else 0 %o A217831 def EuclidTriangle(L): return [Euclid(i,n) for n in range(L) for i in range(n+1)] %o A217831 print(EuclidTriangle(12)) # _Peter Luschny_, Jul 29 2023 %Y A217831 Cf. A000010, A349136, A055034, A062570, A023022, A092790, A056188, A023896, A092790, A053818, A063524 (main diagonal), A113704. %Y A217831 Cf. A054431, A054521, A300294, A367544 - A367547. %K A217831 core,nice,easy,nonn,tabl %O A217831 0 %A A217831 _N. J. A. Sloane_, Oct 14 2012 %E A217831 New name by _Peter Luschny_, Jul 28 2023 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE