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.

User: Luke E. Holland

Luke E. Holland's wiki page.

Luke E. Holland has authored 2 sequences.

A379831 Positions of records in A379857.

Original entry on oeis.org

0, 25, 50, 90, 146, 169, 260, 289, 425, 529, 625, 900, 1156, 1521, 1681, 2025, 2500, 2704, 3434, 3600, 4225, 4624, 4900, 5625, 7146, 7225, 8281, 9409, 10404, 11236, 11881, 13225, 14400, 15129, 16900, 18769, 19600, 21316, 23409, 25281, 26896, 28561, 30625, 32400, 34969, 36100, 40000, 41209, 44944, 47524
Offset: 1

Author

Luke E. Holland, Jan 03 2025

Keywords

Comments

This sequence is infinite in length.
Not all terms are squares, meaning that sometimes k=1 is not among the k values which set a new record.
Elements of this sequence are often, but not always, records of A033461.

Examples

			25 is a member of this sequence, as 25 = 5^2 = 3^2 + 4^2, meaning that it can be expressed as a sum of k squares for two values of k, in this case 1 and 2, which is more than any smaller value.
50 is a member of this sequence, as 50 = 7^2 + 1^2 = 5^2 + 4^2 + 3^2 = 6^2 + 3^2 + 2^2 + 1^2, giving 3 possible values of k, being 2, 3 and 4, more than any smaller value.
0 begins this sequence, as it is the sum of zero squares, so it has one possible value of k, being k = 0.
		

Crossrefs

Programs

  • Python
    MAXSQUARE = 500
    possibleSums = {i: [[], []] for i in range(MAXSQUARE ** 2 + 1)}
    possibleSums[0] = [[0], [0]]
    for val in range(MAXSQUARE ** 2):
        for posSquare in range(len(possibleSums[val][0])):
            newSum = possibleSums[val][0][posSquare] + 1
            curr = possibleSums[val][1][posSquare] + 1
            while val + curr ** 2 <= MAXSQUARE ** 2:
                nVal = val + curr ** 2
                if newSum not in possibleSums[nVal][0]:
                    possibleSums[nVal][0].append(newSum)
                    possibleSums[nVal][1].append(curr)
                else:
                    index = possibleSums[nVal][0].index(newSum)
                    if curr < possibleSums[nVal][1][index]:
                        possibleSums[nVal][1][index] = curr
                curr += 1
    best = 0
    for i in range(MAXSQUARE ** 2 + 1):
        if len(possibleSums[i][0]) > best:
            print(i)
            best = len(possibleSums[i][0])
    records = ()
    best = 0
    for i in range(MAXSQUARE ** 2 + 1):
        sums = len(possibleSums[i][0])
        if sums > best:
            records += (i, )
            best = sums

Formula

a(n) >> n^3. - Charles R Greathouse IV, Jan 06 2025

A379857 Number of values of k for which n can be written as a sum of k distinct positive squares.

Original entry on oeis.org

1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 0, 0, 2, 2, 0, 0, 2, 3, 1, 1, 2, 2, 1, 1, 1, 1, 1, 0, 2, 2, 1, 1, 3, 3, 0, 1, 1, 2, 1, 0, 1, 3, 3, 0, 1, 2, 2, 1, 3, 2, 1, 2
Offset: 0

Author

Luke E. Holland, Jan 04 2025

Keywords

Comments

It appears that a(n) is not bounded, but grows very slowly.
First differs from A033461 at n=62 which can be written as A033461(62) = 3 sums of squares, but among them only a(62) = 2 different numbers of squares.

Examples

			a(0) = 1, as it is the sum of 0 squares.
a(25) = 2, as 25 = 5^2 = 4^2 + 3^2, so k can be 1 or 2.
a(90) = 4, as 90 = 9^2 + 3^2 = 8^2 + 5^2 + 1^2 = 8^2 + 4^2 + 3^2 + 1^2 = 6^2 + 5^2 + 4^2 + 3^2 + 2^2, so k can be 2, 3, 4 or 5.
		

Crossrefs

Cf. A001422 (indices of 0's), A003995 (indices of not 0).
Cf. A379831 (indices of records).

Programs

  • Python
    MAXSQUARE = 500
    possibleSums = {i: [[], []] for i in range(MAXSQUARE ** 2 + 1)}
    possibleSums[0] = [[0],[0]]
    for val in range(MAXSQUARE ** 2):
        for posSquare in range(len(possibleSums[val][0])):
            newSum = possibleSums[val][0][posSquare] + 1
            curr = possibleSums[val][1][posSquare] + 1
            while val + curr ** 2 <= MAXSQUARE ** 2:
                nVal = val + curr ** 2
                if newSum not in possibleSums[nVal][0]:
                    possibleSums[nVal][0].append(newSum)
                    possibleSums[nVal][1].append(curr)
                else:
                    index = possibleSums[nVal][0].index(newSum)
                    if curr < possibleSums[nVal][1][index]:
                        possibleSums[nVal][1][index] = curr
                curr += 1
    posKVals = tuple([len(possibleSums[i][0]) for i in range(MAXSQUARE ** 2 + 1)])
    
  • Python
    from itertools import count
    from sympy.solvers.diophantine.diophantine import power_representation
    def A379857(n):
        if n == 0: return 0
        c = 0
        for i in count(1):
            if i*(i+1)*((i<<1)+1)>6*n:
                break
            if any(len(set(t))==i for t in power_representation(n,2,i)):
                c += 1
        return c # Chai Wah Wu, Jan 28 2025

Formula

a(n) < (3n)^(1/3) for n > 0. I conjecture that a(n) ~ (3n)^(1/3). - Charles R Greathouse IV, Feb 05 2025