OFFSET
1,1
COMMENTS
User vvg asked on Math StackExchange if this sequence is empty, by analogy with Lagrange's Four Square Theorem and Zeckendorf's Theorem (see links). As mentioned by user Empy2, 'most' of the positive integers belong to this sequence: there are O(log n) Fibonacci squares below n, so there are at most O( (log n)^4 ) distinct sums below n, which is asymptotically much smaller than n.
LINKS
Math StackExchange, Is every integer representable as the sum of four Fibonacci squares?.
Eric Weisstein's World of Mathematics, Lagrange's Four-Square Theorem.
Eric Weisstein's World of Mathematics, Zeckendorf's Theorem.
EXAMPLE
24 is a term, which can be seen as follows. The Fibonacci squares less than 24 are 0,1,4 and 9. We must use at least two 9s, as 24>9+4+4+4=21. But 24-18=6 is neither a square nor a sum of two Fibonacci squares. Hence, 24 has no representation of the required form.
32 is a term, as follows. The Fibonacci squares less than 32 are 0,1,4,9, and 25. We cannot use 25 as 7 cannot be written with 3 Fibonacci squares. Therefore, we must have at least three 9s, but 32-9-9-9=5 is not a Fibonacci square. The result follows.
PROG
(Scala)
@main def main(args: Int*): Unit =
val max = 10000
def fibFrom(n: Int, m: Int): LazyList[Int] =
n #:: m #:: fibFrom(n + m, n + 2 * m)
val fib = fibFrom(0, 1)
def computeReprs(min: Int, max: Int) = (for
n <- min to max
f1 <- fib.takeWhile(f => f * f <= n)
f2 <- fib.dropWhile(_ < f1).takeWhile(f => f * f <= n - f1 * f1)
f3 <- fib
.dropWhile(_ < f2)
.takeWhile(f => f * f <= n - f1 * f1 - f2 * f2)
f4 = fib
.dropWhile(f => f * f < n - f1 * f1 - f2 * f2 - f3 * f3)
.head
if n == f1 * f1 + f2 * f2 + f3 * f3 + f4 * f4
yield (n +: Seq(f1, f2, f3, f4)
.filter(_ != 0)
.map(fib.indexOf(_)))).distinct
val reprs = computeReprs(0, max)
// printing out to console for creating b-file
val nosWithoutReprs = (0 to max)
.filter(i => reprs.forall(k => k(0) != i))
((1 to nosWithoutReprs.length) zip nosWithoutReprs)
.foreach((p, q) => println(s"$p $q"))
CROSSREFS
KEYWORD
nonn
AUTHOR
Calvin Khor, Jul 20 2023
STATUS
approved