|
|
A103266
|
|
Minimal number of squares needed to sum to Fibonacci(n+1).
|
|
3
|
|
|
1, 2, 3, 2, 2, 2, 3, 2, 4, 2, 1, 2, 2, 2, 3, 2, 3, 2, 3, 2, 4, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 2, 4, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 2, 4, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 4, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 2, 4, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 2, 4, 2, 4, 2, 2, 2, 3, 2, 3, 2, 3, 2, 4, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 2, 4
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Since every positive integer is the sum of four squares, no term is greater than 4. Also, since any positive integer not of the form 4^k(8m+7) is the sum 3 or fewer squares, the next occurrences of a(n)=4 are at n = 45, 57, 69, 81, 83, 93, .... - John W. Layman, Mar 30 2005
|
|
REFERENCES
|
Hardy and Wright, An Introduction to the Theory of Numbers, Fourth Ed., Oxford, Section 20.10.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
Fibonacci(10+1) = 89 = 25+64, so a(10)=2.
|
|
MATHEMATICA
|
|
|
PROG
|
(PARI)
istwo(n:int) = { my(f); if(n<3, return(n>=0); ); f=factor(n>>valuation(n, 2)); for(i=1, #f[, 1], if(bitand(f[i, 2], 1)==1&&bitand(f[i, 1], 3)==3, return(0))); 1 };
isthree(n:int) = { my(tmp=valuation(n, 2)); bitand(tmp, 1)||bitand(n>>tmp, 7)!=7 };
A002828(n) = if(issquare(n), !!n, if(istwo(n), 2, 4-isthree(n))); \\ From A002828
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|