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.

A236247 Sequence of distinct least squares such that the arithmetic mean of the first n squares is also a square.

Original entry on oeis.org

1, 49, 25, 121, 784, 196, 33124, 4900, 4, 4356, 2304324, 213444, 2371600, 379456, 87616, 360000, 3802500, 562500, 100, 532900, 5456896, 767376, 5934096, 992016, 9947716, 1350244, 32467204, 44100, 2414916, 10458756, 2683044
Offset: 1

Views

Author

Derek Orr, Jan 20 2014

Keywords

Examples

			a(1) = 1.
a(2) is the smallest unused square such that (a(2)+a(1))/2 is a square. So, a(2) = 49.
a(3) is the smallest unused square such that (a(3)+a(2)+a(1))/3 is a square. So, a(3) = 25.
...and so on.
		

Crossrefs

Programs

  • Python
    def Sq(x):
      for n in range(10**15):
        if x == n**2:
          return True
        if x < n**2:
          return False
      return False
    def SqAve(init):
      print(init)
      lst = []
      lst.append(init)
      n = 1
      while n < 10**9:
        if n**2 not in lst:
          if Sq(((sum(lst)+n**2)/(len(lst)+1))):
            print(n**2)
            lst.append(n**2)
            n = 1
          else:
            n += 1
        else:
          n += 1
    SqAve(1)

Formula

a(n) = A141391(n)^2