OFFSET
0,3
COMMENTS
Conjecture: for k > 12, a(2k) = a(2k-1) + 1.
EXAMPLE
First occurrence of 4 in A182576(n) has index 11, so a(4)=11.
PROG
(C)
#include <stdio.h> // GCC // ~880 secs
typedef unsigned long long U64;
U64 fibs[992], first[992], prpr=0, prev=1, current, n, sq;
long long ftop, fpos, terms;
int main(int argc, char **argv)
{
for (ftop=0; ftop<900; ++ftop) {
fibs[ftop] = current = prpr+prev;
if (current<prev) break;
prpr = prev, prev = current;
}
printf("%llu\n%llu\n%llu\n%llu\n", ftop, prev, prpr, (U64)-1-prev);
for (n=0; n < ((U64)1<<32); ++n) {
fpos=ftop-1, terms=0;
for (sq=n*n; sq>0 && fpos>=0; ++terms, sq-=fibs[fpos], --fpos) {
while (fibs[fpos]>sq && fpos>0) --fpos;
}
if (sq>0) { printf("Error!"); exit(1); }
if (first[terms]==0)
first[terms]=n, printf("%2llu %llu\n", terms, n);
}
for (n=0; n<ftop; ++n) printf("%llu, ", first[n]);
return 0;
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, May 05 2012
STATUS
approved