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.

A110534 Number of ways of writing 8n+5 as a sum of 5 odd squares.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 3, 2, 4, 4, 3, 5, 5, 4, 6, 6, 4, 7, 7, 5, 8, 8, 7, 9, 9, 6, 10, 10, 8, 11, 11, 10, 12, 13, 8, 13, 14, 11, 14, 14, 12, 15, 16, 12, 16, 18, 14, 18, 18, 14, 20, 20, 14, 19, 20, 16, 21, 24, 19, 21, 24, 18, 23, 24, 20, 24, 27, 23, 26, 25, 20, 29, 30, 23, 25, 31, 26
Offset: 0

Views

Author

Philippe Deléham, Sep 03 2005

Keywords

Comments

a(n) is also the number of ways of writing n as a sum of 5 triangular numbers (A000217). - Kenny Lau, Jul 05 2016

Crossrefs

Cf. A004770.

Programs

  • Python
    f = open('b110534.txt', 'w')
    N = 20000
    n = 1
    t = [0]  #triangular numbers
    while t[-1] <= N:
        t += [t[-1]+n]
        n += 1
    t = t[:-1]
    a = [0]*(N+1)  #the sequence
    length = len(t)
    for i in range(length):
        for j in range(i,length):
            p = t[i] + t[j]
            if p > N: continue
            for k in range(j,length):
                q = p + t[k]
                if q > N: continue
                for l in range(k,length):
                    r = q + t[l]
                    if r > N: continue
                    for m in range(l,length):
                        s = r + t[m]
                        if s > N: break
                        else: a[s] += 1
    for index,value in enumerate(a):
        f.write(str(index)+" "+str(value)+"\n")
    f.close()
    # Kenny Lau, Jul 05 2016

Extensions

More terms from Don Reble, Sep 17 2005