login
A364353
Numbers that cannot be expressed as the sum of the squares of four Fibonacci numbers.
1
24, 32, 40, 41, 45, 46, 48, 49, 53, 56, 57, 61, 62, 71, 80, 85, 87, 88, 92, 95, 96, 101, 103, 104, 105, 106, 108, 109, 110, 111, 112, 113, 116, 117, 119, 120, 121, 122, 124, 125, 126, 127, 131, 134, 135, 140, 142, 143, 144
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
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
Cf. A000045, A007598, A364354 (complement).
Sequence in context: A334589 A334936 A102374 * A317534 A240068 A269424
KEYWORD
nonn
AUTHOR
Calvin Khor, Jul 20 2023
STATUS
approved