A286327 Least possible sum of the squares of the two initial terms of a Fibonacci-like sequence containing n.
0, 1, 1, 1, 4, 1, 4, 5, 1, 9, 4, 5, 13, 1, 10, 9, 4, 17, 5, 13, 16, 1, 20, 10, 9, 25, 4, 25, 17, 5, 34, 13, 16, 26, 1, 41, 20, 10, 37, 9, 25, 29, 4, 50, 25, 17, 40, 5, 36, 34, 13, 53, 16, 26, 45, 1, 49, 41, 20, 58, 10, 37, 52, 9, 64, 25, 29, 65, 4, 50, 61, 25
Offset: 0
Examples
See illustration of the first terms in Links section.
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..10000
- Rémy Sigrist, Scatterplot of the first 100000 terms
- Rémy Sigrist, Illustration of the first terms
- Rémy Sigrist, C program for A286327
Programs
-
Mathematica
{0}~Join~Table[Module[{a = 0, b = 1, s = {}}, While[a <= n, AppendTo[s, Flatten@ NestWhileList[{#2, #1 + #2} & @@ # &, {a, b}, Last@ # < n &]]; If[a + b >= n, a++; b = 1, b++]]; Min@ Map[Total[(#[[1 ;; 2]])^2] &, Select[s, MemberQ[#, n] &]]], {n, 71}] (* Michael De Vlieger, May 10 2017 *)
Comments