login
Repeat (n+1)^2 n times.
5

%I #20 Nov 07 2024 20:37:29

%S 4,9,9,16,16,16,25,25,25,25,36,36,36,36,36,49,49,49,49,49,49,64,64,64,

%T 64,64,64,64,81,81,81,81,81,81,81,81,100,100,100,100,100,100,100,100,

%U 100,121,121,121,121,121,121,121,121,121,121

%N Repeat (n+1)^2 n times.

%C See A093995.

%C Frenicle writes the entries in the form a(n) = A055096(n)-A133819(n), with the flattened index view of A133819: 4=5-1, 9=10-1, 9=13-4, 16=17-1, 16=20-4, 16=25-9 etc.

%C Also triangle T(n, k) = (n+1)^2, 1<=k<=n. - _Michel Marcus_, Feb 03 2013

%H Reinhard Zumkeller, <a href="/A140978/b140978.txt">Rows n = 1..120 of triangle, flattened</a>

%H M. de Frenicle, <a href="http://gallica.bnf.fr/ark:/12148/bpt6k5493994j/">Methode pour trouver la solutions des problemes par les exclusions</a>, in: Divers ouvrages des mathematiques et de physique par messieurs de l'academie royale des sciences, (1693) pp 1-44, table page 11.

%F a(n)=(A003057(n+1))^2. - _R. J. Mathar_, Aug 25 2008

%t Table[PadRight[{},n,(n+1)^2],{n,10}]//Flatten (* _Harvey P. Dale_, Oct 10 2019 *)

%o (Haskell)

%o a140978 n k = a140978_tabl !! (n-1) !! (k-1)

%o a140978_row n = a140978_tabl !! (n-1)

%o a140978_tabl = map snd $ iterate

%o (\(i, xs@(x:_)) -> (i + 2, map (+ i) (x:xs))) (5, [4])

%o -- _Reinhard Zumkeller_, Mar 23 2013

%o (Python)

%o from math import isqrt

%o def A140978(n): return ((m:=isqrt(k:=n<<1))+(k>m*(m+1))+1)**2 # _Chai Wah Wu_, Nov 07 2024

%Y Cf. A000290.

%K nonn,easy,tabl,changed

%O 1,1

%A _Paul Curtz_, Aug 17 2008