login
a(1) = a(2) = 2; a(n) = a(n-1) + gpf(a(n-2)), where gpf is greatest prime factor.
1

%I #20 Nov 22 2015 06:06:02

%S 2,2,4,6,8,11,13,24,37,40,77,82,93,134,165,232,243,272,275,292,303,

%T 376,477,524,577,708,1285,1344,1601,1608,3209,3276,6485,6498,7795,

%U 7814,9373,13280,13383,13466,14953,21686,22473,24022,24249,36260

%N a(1) = a(2) = 2; a(n) = a(n-1) + gpf(a(n-2)), where gpf is greatest prime factor.

%H Anders Hellström, <a href="/A258125/b258125.txt">Table of n, a(n) for n = 1..1000</a>

%t a[1] = a[2] = 2; a[n_] := a[n] = a[n - 1] + FactorInteger[a[n - 2]][[-1, 1]]; Table[a@ n, {n, 46}] (* _Michael De Vlieger_, Nov 16 2015 *)

%t nxt[{a_,b_}]:={b,b+FactorInteger[a][[-1,1]]}; Transpose[NestList[nxt,{2,2},50]][[1]] (* _Harvey P. Dale_, Nov 22 2015 *)

%o (PARI) gpf(n)=my(f=factor(n)[, 1]);f[#f];

%o first(m)=my(v=vector(m));v[1]=2;v[2]=2;for(i=3,m,v[i]=v[i-1]+gpf(v[i-2]));v

%o (Haskell)

%o a258125 n = a258125_list !! (n-1)

%o a258125_list = 2 : 2 : zipWith (+)

%o (map a006530 a258125_list) (tail a258125_list)

%o -- _Reinhard Zumkeller_, Nov 17 2015

%Y Cf. A006530 (gpf), A078695 (same recurrence).

%K nonn

%O 1,1

%A _Anders Hellström_, Nov 16 2015