cp's OEIS Frontend

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.

A199332 Triangle read by rows, where even numbered rows contain the nonsquares (cf. A000037) and odd rows contain replicated squares.

This page as a plain text file.
%I A199332 #23 Feb 16 2025 08:33:16
%S A199332 1,2,3,4,4,4,5,6,7,8,9,9,9,9,9,10,11,12,13,14,15,16,16,16,16,16,16,16,
%T A199332 17,18,19,20,21,22,23,24,25,25,25,25,25,25,25,25,25,26,27,28,29,30,31,
%U A199332 32,33,34,35,36,36,36,36,36,36,36,36,36,36,36,37,38
%N A199332 Triangle read by rows, where even numbered rows contain the nonsquares (cf. A000037) and odd rows contain replicated squares.
%C A199332 An approximation of the Euler-Mascheroni constant by rational numbers: the sum ((-1)^(n+1) * Sum_{k=1..n} (1/T(n,k))) converges to gamma, cf. Pólya-Szegő reference.
%D A199332 G. Pólya and G. Szegő, Problems and Theorems in Analysis I (Springer 1924, reprinted 1972), Part Two, Chap. 1, sec. 2, Problem 19.2., page 51.
%H A199332 Reinhard Zumkeller, <a href="/A199332/b199332.txt">Rows n = 1..150 of triangle, flattened</a>
%H A199332 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Euler-MascheroniConstant.html">Euler-Mascheroni Constant</a>
%H A199332 Wikipedia, <a href="http://en.wikipedia.org/wiki/Euler-Mascheroni_constant">Euler-Mascheroni constant</a>
%e A199332 1:                    1                           1
%e A199332 2:                  2   3                      2 .. 3
%e A199332 3:                4   4   4                       4
%e A199332 4:              5   6   7   8                  5 .. 8
%e A199332 5:            9   9   9   9   9                   9
%e A199332 6:         10  11  12  13  14  15             10 .. 15
%e A199332 7:       16  16  16  16  16  16  16              16
%e A199332 8:     17  18  19  20  21  22  23  24         17 .. 24
%e A199332 9:   25  25  25  25  25  25  25  25  25          25 .
%t A199332 t[n_, k_] := If[OddQ[n], (n+1)^2/4, n^2/4 + k]; Flatten[ Table[ t[n, k], {n, 1, 12}, {k, 1, n}]](* _Jean-François Alcover_, Dec 05 2011 *)
%t A199332 Flatten[Table[If[IntegerQ[Sqrt[n]],Table[n,{2*Sqrt[n]-1}],n],{n,40}]] (* _Harvey P. Dale_, Nov 11 2013 *)
%o A199332 (Haskell)
%o A199332 a199332 n k = a199332_tabl !! (n-1) !! (k-1)
%o A199332 a199332_row n = a199332_tabl !! (n-1)
%o A199332 a199332_list = concat a199332_tabl
%o A199332 a199332_tabl = f [1..] [1..] where
%o A199332    f (x:xs) ys'@(y:ys) | odd x  = (replicate x y) : f xs ys
%o A199332                        | even x = us : f xs vs
%o A199332                        where (us,vs) = splitAt x ys'
%Y A199332 Cf. A000037, A000290 & A002620 (central terms),  A199771 (row sums).
%K A199332 nonn,tabl
%O A199332 1,2
%A A199332 _Reinhard Zumkeller_, Nov 23 2011