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.

A004434 Numbers that are the sum of 5 distinct nonzero squares.

Original entry on oeis.org

55, 66, 75, 79, 82, 87, 88, 90, 94, 95, 99, 100, 103, 106, 110, 111, 114, 115, 118, 120, 121, 123, 126, 127, 129, 130, 131, 132, 134, 135, 138, 139, 142, 143, 144, 145, 146, 147, 148, 150, 151, 152, 154, 155, 156, 157, 158, 159, 160, 162, 163
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a004434 n = a004434_list !! (n-1)
    a004434_list = filter (p 5 $ tail a000290_list) [1..] where
       p k (q:qs) m = k == 0 && m == 0 ||
                      q <= m && k >= 0 && (p (k - 1) qs (m - q) || p k qs m)
    -- Reinhard Zumkeller, Apr 22 2013
  • PARI
    upto(lim)=my(v=List(), tb, tc, td, te); for(a=5, sqrt(lim), for(b=4, min(a-1, sqrt(lim-a^2)), tb=a^2+b^2; for(c=3, min(b-1, sqrt(lim-tb)), tc=tb+c^2; for(d=2, min(c-1, sqrt(lim-tc)), td=tc+d^2; for(e=1, d-1, te=td+e^2; if(te>lim, break,listput(v, te))))))); vecsort(Vec(v), , 8) \\ Charles R Greathouse IV, Jul 17 2011
    

Formula

a(n) = n + 124 for n > 121. - Charles R Greathouse IV, Jul 17 2011