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.

A277278 a(n) = smallest m for which there is a sequence n = b_1 < b_2 < ... < b_t = m such that b_1 + b_2 +...+ b_t is a perfect square.

Original entry on oeis.org

0, 1, 4, 6, 4, 10, 10, 9, 14, 9, 14, 13, 13, 18, 18, 18, 16, 19, 22, 23, 23, 27, 27, 26, 25, 25, 28, 33, 32, 35, 34, 33, 35, 38, 38, 40, 36, 42, 42, 42, 41, 48, 48, 47, 51, 50, 50, 49, 52, 49, 57, 57, 59, 59, 58, 58, 63, 63, 63, 62, 61, 66, 66, 67, 64, 73, 73
Offset: 0

Views

Author

Peter Kagey, Oct 15 2016

Keywords

Comments

Sum analog of R. L. Graham's sequence (A006255).

Examples

			a(0) = 0  via 0                  = 0^2
a(1) = 1  via 1                  = 1^2
a(2) = 4  via 2 + 3 + 4          = 3^2
a(3) = 6  via 3 + 6              = 3^2
a(4) = 4  via 4                  = 2^2
a(5) = 10 via 5 + 6 + 7 + 8 + 10 = 6^2
a(6) = 10 via 6 + 10             = 4^2
		

Crossrefs

Cf. A006255.

Programs

  • Haskell
    import Data.List (find)
    import Data.Maybe (fromJust)
    isSquare m = m == (integerRoot * integerRoot) where
    integerRoot = floor (sqrt (fromIntegral m)::Double)
    a277278 n
    | isSquare n = n
    | otherwise = last $ fromJust $ find (isSquare . sum) s where
    s = map ((n:) . map (n+)) a048793_tabf
    -- Peter Kagey, Oct 19 2016
  • PARI
    a(n)=if (issquare(n), return (n)); ok = 0; d = 1; while (!ok, for (j=1, 2^d-1, b = Vecrev(binary(j)); if (issquare(n+sum(k=1,#b, b[k]*(n+k))), ok = 1; break);); if (! ok, d++);); n+d; \\ Michel Marcus, Oct 16 2016
    

Formula

a(n^2) = n^2.