login
a(1)=5; for n>0, a(n+1)=a(n)+p-1, where p is the smallest prime divisor of (a(n))^2-4.
4

%I #12 Dec 14 2018 06:05:06

%S 5,7,9,15,27,31,33,37,39,75,81,159,165,327,331,333,337,339,349,351,

%T 699,715,717,721,723,727,729,745,747,751,753,757,759,1515,1531,1533,

%U 1537,1539,1561,1563,1567,1569,3135,3147,3151,3153,3157,3159,3165,6327,6331,6333,6337

%N a(1)=5; for n>0, a(n+1)=a(n)+p-1, where p is the smallest prime divisor of (a(n))^2-4.

%p A020639 := proc(n) if n = 1 then 1 ; else numtheory[factorset](n) ; min(op(%)) ; end if; end proc:

%p A177941 := proc(n) option remember; if n = 1 then 5 else A020639((procname(n-1))^2-4) ; procname(n-1)+%-1 ; end if; end proc: seq(A177941(n),n=1..120) ; # _R. J. Mathar_, Jun 30 2010

%t NestList[# + FactorInteger[#^2 - 4][[1, 1]] - 1 &, 5, 52] (* or *)

%t a[1] = 5; a[n_] := a[n] = # + FactorInteger[#^2 - 4][[1, 1]] - 1 &@ a[n - 1]; Array[a, {53}] (* _Michael De Vlieger_, Feb 07 2016 *)

%o (PARI) lista(nn) = {my(va = vector(nn)); va[1] = 5; for (n=2, nn, va[n] = va[n-1] + factor(va[n-1]^2-4)[1,1] - 1;); va;} \\ _Michel Marcus_, Dec 14 2018

%Y Cf. A177929.

%K nonn

%O 1,1

%A _Vladimir Shevelev_, May 15 2010

%E Entries checked by _R. J. Mathar_, Jun 30 2010