A214320 a(0)=a(1)=a(2)=1; thereafter a(n) = gpf(a(n-1)+a(n-3)), where gpf = "greatest prime factor".
1, 1, 1, 2, 3, 2, 2, 5, 7, 3, 2, 3, 3, 5, 2, 5, 5, 7, 3, 2, 3, 3, 5, 2, 5, 5, 7, 3, 2, 3, 3, 5, 2, 5, 5, 7, 3, 2, 3, 3, 5, 2, 5, 5, 7, 3, 2, 3, 3, 5, 2, 5, 5, 7, 3, 2, 3, 3, 5, 2, 5, 5, 7, 3, 2, 3, 3, 5, 2, 5, 5, 7, 3, 2, 3, 3, 5, 2, 5, 5, 7, 3, 2, 3, 3, 5, 2, 5, 5, 7, 3, 2, 3, 3, 5, 2, 5, 5, 7, 3, 2, 3, 3, 5, 2, 5, 5, 7, 3, 2, 3, 3, 5, 2, 5, 5, 7, 3, 2, 3, 3
Offset: 0
Keywords
Programs
-
Haskell
a214320 n = a214320_list !! n a214320_list = 1 : 1 : 1 : (map a006530 $ zipWith (+) a214320_list (drop 2 $ a214320_list)) -- Reinhard Zumkeller, Jul 24 2012
-
Maple
with(numtheory, divisors); A006530 := proc(n) local i, t1, t2, t3, t4, t5; t1 := divisors(n); t2 := convert(t1, list); t3 := sort(t2); t4 := nops(t3); t5 := 1; for i from 1 to t4 do if isprime(t3[t4+1-i]) then RETURN(t3[t4+1-i]); fi; od; 1; end; f:=proc(n) option remember; if n <= 2 then 1 else A006530(f(n-1)+f(n-3)); fi; end; [seq(f(n),n=0..120)];
-
Mathematica
nxt[{a_,b_,c_}]:={b,c,FactorInteger[c+a][[-1,1]]}; NestList[nxt,{1,1,1},120][[All,1]] (* or *) PadRight[{1,1,1,2,3,2,2},130,{3,2,3,3,5,2,5,5,7}] (* Harvey P. Dale, Jul 08 2017 *)
Formula
After 7 terms, cycles with period 9.
Comments