# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a177186 Showing 1-1 of 1 %I A177186 #12 Dec 17 2022 18:28:04 %S A177186 1,2,4,5,10,12,15,20,22,33,36,38,57,60,65,78,81,82,123,126,133,152, %T A177186 154,165,170,187,198,201,268,270,275,286,299,322,329,376,378,385,396, %U A177186 399,418,429,442,459,462,473,516,519,692,694,1041,1044,1073,1110,1115,1338 %N A177186 a(n+1) = a(n) + p, where p is the largest prime dividing a(n) but not a(n-1), or 1 if there is no such prime. %C A177186 Setting a(1) = 1 is arbitrary; since 1 has no prime divisors, we must then have p = 1 => a(2) = 2, without reference to a(0). %C A177186 There are three cases where p = 1: n=1 (a(n)=1); n=3 (a(n)=4); n=17 (a(n)=81); and no others through n = 10000. Except that there cannot be such cases consecutively, p=1 iff a(n) is a prime power. %H A177186 Harvey P. Dale, Table of n, a(n) for n = 1..1000 %e A177186 After a(9)=22, a(10)=33, the prime divisors of a(10) are 3 and 11; 11 divides 22, so p=3, and a(11)=36. %t A177186 p[n1_, n2_] := If[pp = Complement[Transpose[FactorInteger[n2]][[1]], %t A177186 Transpose[FactorInteger[n1]][[1]]]; pp == {}, 1, Last[pp]]; a[1] = 1; a[2] = 2; a[n_] := a[n] = a[n-1] + p[a[n-2], a[n-1]]; Table[a[n], {n, 56}] (* _Jean-François Alcover_, Sep 02 2011 *) %t A177186 nxt[{a_,b_}]:={b,b+Max[1,Complement[FactorInteger[b][[All,1]],FactorInteger[ a] [[All,1]]]]}; NestList[nxt,{1,2},60][[All,1]] (* _Harvey P. Dale_, Dec 17 2022 *) %o A177186 (PARI) invec(v,x)=for(i=1,#v,if(v[i]==x,return(1)));0 %o A177186 lastnotin(vi,vx,dft)=forstep(i=#vi,1,-1,if(!invec(vx,vi[i]),return(vi[i])));dft %o A177186 al(n)=local(r);r=vector(n);r[1]=1;r[2]=2;for(k=3,n,r[k]=r[k-1]+lastnotin(factor(r[k-1])[,1]~,factor(r[k-2])[,1]~,1));r %Y A177186 Cf. A076271, A060735, A002620. %K A177186 nonn %O A177186 1,2 %A A177186 _Franklin T. Adams-Watters_, May 04 2010 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE