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.

A061798 Number of sums i^3 + j^3 that occur more than once for 1<=i<=j<=n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 7, 7, 8, 8, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 13, 13, 14, 15, 16, 16, 16, 17, 17, 19, 19, 19, 19, 20, 20, 20, 21, 23, 24, 24, 24, 25, 25, 25, 25
Offset: 1

Views

Author

Labos Elemer, Jun 22 2001

Keywords

Crossrefs

Programs

  • PARI
    a(n) = my(v=vector(2*n^3, i, 0)); for(i=1, n, for(j=i, n, v[i^3+j^3]+=1)); sum(i=1, #v, v[i]>1); \\ Seiichi Manyama, May 14 2024
    
  • Ruby
    def A(n)
      h = {}
      (1..n).each{|i|
        (i..n).each{|j|
          k = i * i * i + j * j * j
          if h.has_key?(k)
            h[k] += 1
          else
            h[k] = 1
          end
        }
      }
      h.to_a.select{|i| i[1] > 1}.size
    end
    def A061798(n)
      (1..n).map{|i| A(i)}
    end
    p A061798(80) # Seiichi Manyama, May 14 2024