OFFSET
1,1
COMMENTS
The formula is a consequence of the Lambek-Moser theorem.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
Wikipedia, Lambek-Moser theorem
FORMULA
a(n) = floor(1/2 - LambertW(-1, -log(phi)/phi^(n+1/2))/log(phi)) with phi = (1+sqrt(5))/2. - Nicolas Normand (nicolas.normand (at) polytech.univ-nantes.fr)
a(n) = A090946(n+2). - R. J. Mathar, Jan 29 2019
MAPLE
a := proc(n) floor(-1/ln(1/2+1/2*5^(1/2))*LambertW(-1, -ln(1/2+1/2*5^(1/2))/ ((1/2+1/2*5^(1/2))^(n+1/2)))+1/2) end; # Simon Plouffe, Nov 30 2017
# alternative
isA000032 := proc(n)
local l1, l2 ;
if n <= 0 then
false;
elif n <= 4 then
true ;
else
l1 := 3 ; l2 := 4 ;
while true do
l := l1+l2 ;
if l > n then
return false;
elif l = n then
return true;
else
l1 := l2 ; l2 := l ;
end if;
end do:
end if;
end proc:
isA057854 := proc(n)
not isA000032(n) ;
end proc:
A057854 := proc(n)
option remember;
if n = 1 then
5 ;
else
for a from procname(n-1)+1 do
if isA057854(a) then
return a;
end if;
end do:
end if;
end proc:
seq(A057854(n), n=1..10) ; # R. J. Mathar, Feb 01 2019
MATHEMATICA
a[n_] := With[{phi = (1 + Sqrt[5])/2}, Floor[1/2 - LambertW[-1, -Log[phi]/phi^(n + 1/2)]/Log[phi]]];
Table[a[n], {n, 1, 70}] (* Peter Luschny, Nov 30 2017 *)
b:= Complement[Range[1, 100], LucasL[Range[20]]]; Table[b[[n+1]], {n, 1, 70}] (* G. C. Greubel, Jun 19 2019 *)
PROG
(Python)
def A057854(n):
def f(x):
if x<=2: return n+2
a, b, c = 1, 3, 0
while b<=x:
a, b = b, a+b
c += 1
return n+c+2
m, k = n, f(n)
while m != k: m, k = k, f(k)
return m # Chai Wah Wu, Sep 10 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger Cuculière, Nov 12 2000
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), Nov 28 2000
STATUS
approved