OFFSET
1,1
LINKS
Eric Weisstein's World of Mathematics, Perrin Sequence.
EXAMPLE
Sum of all 1-digit Perrin numbers = 3 + 0 + 2 + 3 + 2 + 5 + 5 + 7 = 27.
Sum of all 2-digit Perrin numbers = 10 + 12 + 17 + 22 + 29 + 39 + 51 + 68 + 90 = 338.
Sum of all 3-digit Perrin numbers = 119 + 158 + 209 + 277 + 367 + 486 + 644 + 853 = 3113.
MATHEMATICA
a[n_] := a[n] = a[n - 2] + a[n - 3]; a[0] = 3; a[1] = 0; a[2] = 2; t = Table[a@n, {n, 0, 150}]; Table[Plus @@ Select[t, 10^(n - 1) -1 < # < 10^n &], {n, 18}] - Robert G. Wilson v, Oct 14 2007
With[{pernos=LinearRecurrence[{0, 1, 1}, {3, 0, 2}, 200]}, Table[Total[ Select[ pernos, IntegerLength[#]==n&]], {n, 20}]] (* Harvey P. Dale, Apr 20 2012 *)
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Parthasarathy Nambi, Oct 11 2007
EXTENSIONS
More terms from Robert G. Wilson v, Oct 14 2007
More terms from Amiram Eldar, Nov 30 2019
STATUS
approved