OFFSET
1,2
COMMENTS
Is this sequence infinite?
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..632 (terms below 10^100)
Felice Russo, A Set of New Smarandache Functions, Sequences and Conjectures in Numer Theory., Lupton, AZ: American Research Press, 2000.
FORMULA
Let [x1.x2.x3. ... .xi] be the decimal expansion of n. Then define F(0) = |x1-x2-...-xi|, F(1) = x1 + x2 + x3 + ... + xi, and for k>1, F(k) = F(k-1) + F(k-2). If F(k)=n for some k, then n belongs to the sequence.
MATHEMATICA
check[abs_, sum_, max_] := Module[{s = {}, a = abs, b = sum, c}, c = b; While[c <= max, id = IntegerDigits[c]; If[c > 10 && abs == Abs[id[[1]] - Total[Rest@id]] && sum == Total[id ], AppendTo[s, c]]; c = a + b; a = b; b = c]; s]; seq[digmax_] := Module[{s = {}}, Do[s = Join[s, check[a, b, 10^digmax]], {a, 0, 10*digmax}, {b, 1, 10*digmax}]; Join[{0}, Sort[s]]]; seq[7] (* Amiram Eldar, Jul 07 2021 *)
PROG
(PARI) for(n=0, 10000000, s=eval(Vec(Str(n))); f1=sum(i=1, #s, s[i]); f0=abs(2*s[1]-f1); f=f0+f1; while(f<=n, if(f==n, print1(n", "); break); f0=f1; f1=f; f=f0+f1)) \\ Herman Jamke (hermanjamke(AT)fastmail.fm), Mar 30 2008
KEYWORD
base,nonn
AUTHOR
EXTENSIONS
Corrected and extended by Larry Reeves (larryr(AT)acm.org), Sep 28 2000
2 more terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Mar 30 2008
Offset corrected by Amiram Eldar, Jul 07 2021
STATUS
approved