OFFSET
1,1
COMMENTS
The tribonacci numbers are indexed so that trib(0) = trib(1) = 0, trib(2) = 1, for n>2: trib(n) = trib(n-1) + trib(n-2) + trib(n-3). See A112618 for another version.
LINKS
J. L. Brenner, Linear Recurrence Relations, Amer. Math. Monthly, Vol. 61 (1954), 171-173.
Eric Weisstein's World of Mathematics, MathWorld: Tribonacci Number
FORMULA
EXAMPLE
a(1) = 4 because prime(1) = 2 and tribonacci( 4) = 2.
a(2) = 8 because prime(2) = 3 and tribonacci( 8) = 24 = 3 * 2^3.
a(3) = 15 because prime(3) = 5 and tribonacci(15) = 1705 = 5 *(11 * 31).
a(4) = 6 because prime(4) = 7 and tribonacci( 6) = 7.
a(5) = 9 because prime(5) = 11 and tribonacci( 9) = 44 = 11 * 4.
a(6) = 7 because prime(6) = 13 and tribonacci( 7) = 13.
a(7) = 29 because prime(7) = 17 and tribonacci(29) = 8646064 = 17 *(2^4 * 7 * 19 * 239).
MATHEMATICA
a[0] = a[1] = 0; a[2] = 1; a[n_] := a[n] = a[n - 1] + a[n - 2] + a[n - 3]; f[n_] := Module[{k = 2, p = Prime[n]}, While[Mod[a[k], p] != 0, k++ ]; k]; Array[f, 64] (* Robert G. Wilson v *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Nov 29 2005
EXTENSIONS
Corrected and extended by Robert G. Wilson v, Dec 01 2005
STATUS
approved