Class SumOf4Squares

java.lang.Object
de.tilman_neumann.jml.squareSums.SumOf4Squares

public class SumOf4Squares
extends java.lang.Object
Stuff concerning sums of 4 squares representations of natural numbers.
  • Constructor Summary

    Constructors
    Constructor Description
    SumOf4Squares()  
  • Method Summary

    Modifier and Type Method Description
    static java.util.TreeSet<java.lang.Long> getA004215​(long m)
    Compute all elements of A004215 below m, i.e.
    static java.util.TreeSet<java.lang.Long> getA004215_v2​(int n)
    Compute all elements of A004215 below m = 2^n, i.e.
    static int getA004215_v3​(int n, long[] array)
    Another implementation using arrays, much faster than the previous ones.
    static void main​(java.lang.String[] args)
    A test of the hypothesis that A023105(2^n) == 2 + the number of entries of A004215 that are less than 2^n, for n>0.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SumOf4Squares

      public SumOf4Squares()
  • Method Details

    • getA004215

      public static java.util.TreeSet<java.lang.Long> getA004215​(long m)
      Compute all elements of A004215 below m, i.e. all k= 0, j >= 0.
      Parameters:
      m -
      Returns:
      A004215 entries < m
    • getA004215_v2

      public static java.util.TreeSet<java.lang.Long> getA004215_v2​(int n)
      Compute all elements of A004215 below m = 2^n, i.e. all k
      Parameters:
      n -
      Returns:
      A004215 entries < 2^n
    • getA004215_v3

      public static int getA004215_v3​(int n, long[] array)
      Another implementation using arrays, much faster than the previous ones.
      Parameters:
      n - such that m=2^n
      array - an array big enough to take roughly 2^n/6 values
      Returns:
      number of entries
    • main

      public static void main​(java.lang.String[] args)
      A test of the hypothesis that A023105(2^n) == 2 + the number of entries of A004215 that are less than 2^n, for n>0. Confirmed until n=29.
      Parameters:
      args - ignored