OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
IsSubList:= proc(T, S)
local i;
if T = [] then return true fi;
if S = [] then return false fi;
i:= ListTools:-Search(T[1], S);
if i = 0 then false else procname(T[2..-1], S[i+1..-1]) fi
end proc:
f:= proc(n) local T, S, k, v;
T:= convert(n, base, 10);
for k from 1 do
v:= combinat:-fibonacci(k);
S:= convert(v, base, 10);
if IsSubList(T, S) then return v fi
od
end proc:
map(f, [$1..100]); # Robert Israel, Mar 10 2020
MATHEMATICA
a[n_] := Block[{p = RegularExpression[ StringJoin @@ Riffle[ ToString /@ IntegerDigits[ n], ".*"]], f, k=2}, While[! StringContainsQ[ ToString[f = Fibonacci[ k++]], p]]; f]; Array[a, 42] (* Giovanni Resta, Mar 10 2020 *)
PROG
(Python)
def dmo(n, t):
if t < n: return False
while n and t:
if n%10 == t%10:
n //= 10
t //= 10
return n == 0
def fibo(f=1, g=2):
while True: yield f; f, g = g, f+g
def a(n):
return next(f for f in fibo() if dmo(n, f))
print([a(n) for n in range(1, 77)]) # Michael S. Branicky, Jan 21 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Mar 07 2003
EXTENSIONS
Corrected and extended by Ray Chandler, Oct 11 2003
STATUS
approved