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.

A227181 Irregular table: integers from n to n^2 followed by integers from (n+1) to (n+1)^2.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 03 2013

Keywords

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;
  ...
		

Crossrefs

Right edge: A000290. Central diagonal: A000217. Cf. also A227147.

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)))
    

Formula

a(n) = A227177(n)+ A227179(n). [As a sequence].