OFFSET
1,1
COMMENTS
Numbers n>9 with following property: form a sequence b(i) whose initial terms are the t digits of n, later terms given by rule that b(i) = sum of t previous terms; then n - 1 or n + 1 appears in the sequence.
EXAMPLE
a(1) = 12 because 1 + 2 = 3, 2 + 3 = 5, 3 + 5 = 8, 5 + 8 = 13 = 12 + 1.
a(2) = 18 because 1 + 8 = 9, 8 + 9 = 17 = 18 - 1.
MAPLE
P:=proc(q) local b, k, n, v; for n from 1 to q do b:=ilog10(n)+1;
if b>1 then v:=[]; for k from 1 to b do
v:=[op(v), trunc(n/10^(b-k)) mod 10]; od; v:=[op(v), add(v[k], k=1..b)];
while v[nops(v)]<n-1 do v:=[op(v), add(v[k], k=nops(v)-b+1..nops(v))]; od;
if v[nops(v)]=n-1 or v[nops(v)]=n+1 then print(n); fi; fi; od; end: P(10^7);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Sep 27 2018
STATUS
approved