A164295 Triangle T(n,k) read by rows: sum of the triangles A054521 and A051731.
2, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1
Offset: 1
Examples
The table starts 2 2, 1 2, 1, 1 2, 1, 1, 1 2, 1, 1, 1, 1 2, 1, 1, 0, 1, 1 2, 1, 1, 1, 1, 1, 1 2, 1, 1, 1, 1, 0, 1, 1 2, 1, 1, 1, 1, 0, 1, 1, 1 2, 1, 1, 0, 1, 0, 1, 0, 1, 1
Links
- G. C. Greubel, Table of n, a(n) for the first 50 rows, flattened
Programs
-
Maple
A054521 := proc(n,k) if gcd(n,k) = 1 then 1; else 0 ; fi; end: A051731 := proc(n,k) if (n mod k) = 0 then 1; else 0 ; fi; end: A164295 := proc(n,k) A054521(n,k)+A051731(n,k) ; end: seq(seq(A164295(n,k),k=1..n),n=1..10) ;
-
Mathematica
T[n_, k_] = If[Mod[n, k] == 0, 1, 0] + If[GCD[n, k] == 1, 1, 0]; Table[Table[T[n, k], {k, 1, n}], {n, 1, 10}]; Flatten[%]
Extensions
Edited by the Associate Editors of the OEIS, Aug 28 2009
Comments