This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A257232 #19 Sep 23 2021 01:26:53 %S A257232 1,2,0,3,1,0,4,2,1,1,5,3,2,2,0,6,4,3,3,1,1,7,5,4,4,2,2,0,8,6,5,5,3,3, %T A257232 1,1,9,7,6,6,4,4,2,2,1,10,8,7,7,5,5,3,3,2,1,11,9,8,8,6,6,4,4,3,2,0 %N A257232 Triangle T(n, k) with the natural numbers in columns with nonprime k and the nonnegative numbers in columns with prime k, for 1 <= k <= n. %C A257232 This triangle is motivated by sequence A256885 by _Wesley Ivan Hurt_, which is the sequence of row sums for n >= 1. %C A257232 Row n ends in a 0 if n is prime; otherwise it ends in 1. %C A257232 The alternating row sums give 1, seven times 2, six times 3, six times 4, four times 5, twice 6, ..., and the multiplicity sequence 1, 7, 6, 6, 4, 2, ... is given in A257233. %H A257232 Reinhard Zumkeller, <a href="/A257232/b257232.txt">Rows n = 1..125 of triangle, flattened</a> %F A257232 T(n, k) = n - (k-1) - [isprime(k)], with [isprime(k)] = A010051(k), for 1 <= k <= n. %F A257232 O.g.f. for column k (with leading zeros): x^k/(1-x)^2 if k is nonprime, otherwise x^(k+1)/(1-x)^2. %F A257232 T(n+1,k) = T(n,k) + 1, 1 <= k <= n, T(n+1,n+1) = 1 - A010051(n+1). - _Reinhard Zumkeller_, Apr 21 2015 %e A257232 The triangle T(n, k) begins: %e A257232 n\k 1 2 3 4 5 6 7 8 9 10 11 ... %e A257232 1: 1 %e A257232 2: 2 0 %e A257232 3: 3 1 0 %e A257232 4: 4 2 1 1 %e A257232 5: 5 3 2 2 0 %e A257232 6: 6 4 3 3 1 1 %e A257232 7: 7 5 4 4 2 2 0 %e A257232 8: 8 6 5 5 3 3 1 1 %e A257232 9: 9 7 6 6 4 4 2 2 1 %e A257232 10: 10 8 7 7 5 5 3 3 2 1 %e A257232 11: 11 9 8 8 6 6 4 4 3 2 0 %e A257232 ... %t A257232 Table[n - (k - 1) - Boole[PrimeQ@ k], {n, 11}, {k, n}] // Flatten (* _Michael De Vlieger_, Apr 19 2015 *) %o A257232 (Haskell) %o A257232 a257232 n k = a257232_tabl !! (n-1) !! (k-1) %o A257232 a257232_row n = a257232_tabl !! (n-1) %o A257232 a257232_tabl = iterate %o A257232 (\xs@(x:_) -> map (+ 1) xs ++ [1 - a010051 (x + 1)]) [1] %o A257232 -- _Reinhard Zumkeller_, Apr 21 2015 %Y A257232 Cf. A256885 (row sums), A257233 (multiplicities for alternating row sums). %Y A257232 Cf. A010051. %K A257232 nonn,easy,tabl %O A257232 1,2 %A A257232 _Wolfdieter Lang_, Apr 19 2015