OFFSET
1,2
COMMENTS
This sequence illustrates why 197 is a Keith number (cf. A007629).
Other multiples of 197 in the sequence are 4137 and 992207243244533. - Alonso del Arte, Mar 14 2011
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..1000
Martin Klazar and Florian Luca, Counting Keith numbers, Journal of Integer Sequences, Vol. 10 (2007), Article 07.2.2.
Eric Weisstein's World of Mathematics, Keith Number.
Index entries for linear recurrences with constant coefficients, signature (1,1,1).
FORMULA
a(1)=1, a(2)=9, a(3)=7; thereafter a(n) = sum of previous three terms. Note that 197 appears in the sequence, which is why 197 is a Keith number.
G.f.: x*(1+8*x-3*x^2)/(1-x-x^2-x^3). - Colin Barker, Jun 19 2012
MATHEMATICA
keithSeq[n_Integer, b_:10, goBeyondN_:0] := Module[{seq = IntegerDigits[n, b], ord, max = n + goBeyondN, curr}, ord = Length[seq]; curr = seq[[-1]]; While[curr < max, curr = Plus@@Take[seq, -ord]; seq = Append[seq, curr]]; Return[seq]]; keithSeq[197, 10, 10^8] (* Alonso del Arte, Mar 14 2011 *)
LinearRecurrence[{1, 1, 1}, {1, 9, 7}, 36] (* Amiram Eldar, Jan 20 2026 *)
PROG
(PARI) Vec((1+8*x-3*x^2)/(1-x-x^2-x^3)+O(x^99)) \\ Charles R Greathouse IV, Feb 04 2013
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
N. J. A. Sloane, Feb 27 2011
EXTENSIONS
a(31)-a(36) from Amiram Eldar, Jan 20 2026
STATUS
approved
