A143544 Triangle read by rows, T(n,k) = 2 if n is prime, 1 otherwise; 1<=k<=n.
1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 1
Examples
First few rows of the triangle = 1; 2, 2; 2, 2, 2; 1, 1, 1, 1; 2, 2, 2, 2, 2; 1, 1, 1, 1, 1, 1; 2, 2, 2, 2, 2, 2, 2; ...
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..11325
Programs
-
Mathematica
Table[1 + Boole[PrimeQ[n]], {n, 11}, {k, n}] // Flatten (* Michael De Vlieger, Oct 31 2021 *)
Formula
Triangle read by rows, T(n,k) = 2 if n is prime, 1 otherwise; 1<=k<=n.
T(n, k) = A143536(n, k) + 1. - Georg Fischer, Oct 31 2021
Comments