Class SumOf4Squares


  • public class SumOf4Squares
    extends Object
    Stuff concerning sums of 4 squares representations of natural numbers.
    Author:
    Tilman Neumann
    • Constructor Detail

      • SumOf4Squares

        public SumOf4Squares()
    • Method Detail

      • getA004215

        public static TreeSet<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 TreeSet<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​(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