A227181 Irregular table: integers from n to n^2 followed by integers from (n+1) to (n+1)^2.
0, 1, 2, 3, 4, 3, 4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36
Offset: 0
Examples
Row n is A002061(n) terms long, and contains successive integers from n to n*n: 0; 1; 2, 3, 4; 3, 4, 5, 6, 7, 8, 9; 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16; ...
Links
- Antti Karttunen, Rows 0..31, flattened
Programs
-
Mathematica
Flatten[(#+Range[(#1-2) (#1-1)+1]-2&)[Range[7]]] (* Peter J. C. Moses, Jul 11 2013 *) Table[Range[n,n^2],{n,0,6}]//Flatten (* Harvey P. Dale, Apr 03 2021 *)
-
Python
from sympy import integer_nthroot def A227181(n): return n-(r:=(m:=integer_nthroot(k:=3*n,3)[0])-(k<=m*(m**2+2)))*(r**2-1)//3 # Chai Wah Wu, Nov 07 2024
-
Scheme
(define (A227181 n) (+ (A227177 n) (A227179 n)))