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.

A274620 If n^2 has an even number of digits, write n after the left half of the digits of n^2 and before the right half, otherwise if n^2 has 2t+1 digits, write n after the first t digits of n^2 and before the last t+1 digits.

Original entry on oeis.org

11, 24, 39, 146, 255, 366, 479, 684, 891, 11000, 11121, 11244, 11369, 11496, 21525, 21656, 21789, 31824, 31961, 42000, 42141, 42284, 52329, 52476, 62525, 62676, 72729, 72884, 82941, 93000, 93161, 103224, 103389, 113456, 123525, 123696, 133769, 143844, 153921, 164000
Offset: 1

Views

Author

N. J. A. Sloane, Jul 03 2016

Keywords

Comments

In short, write n in the middle of n^2.
Portions of this sequence are sometimes given as puzzles.

Examples

			4^2 = 16 so a(4) = 1.4.6 = 146.
19^2 = 361 so a(19) = 3.19.61 = 31961.
		

References

Crossrefs

Programs

  • Mathematica
    nterms=100;Table[FromDigits[Flatten[Insert[d=IntegerDigits[n^2],IntegerDigits[n],Floor[Length[d]/2]+1]]],{n,nterms}] (* Paolo Xausa, Nov 24 2021 *)
  • Python
    def a(n):
        ss = str(n*n)
        t = len(ss)//2
        return int(ss[:t] + str(n) + ss[t:])
    print([a(n) for n in range(1, 41)]) # Michael S. Branicky, Nov 24 2021