login
a(n) = a(n-1)^2 + prime(n-1), with a(1) = 1.
1

%I #11 Jan 04 2024 06:33:02

%S 1,3,12,149,22208,493195275,243241579282325638,

%T 59166465891759909038312569872107061,

%U 3500670686120788688272744016815662448699251721439983660470143846057740

%N a(n) = a(n-1)^2 + prime(n-1), with a(1) = 1.

%H G. C. Greubel, <a href="/A028301/b028301.txt">Table of n, a(n) for n = 1..12</a>

%H <a href="/index/Aa#AHSL">Index entries for sequences of form a(n+1)=a(n)^2 + ...</a>

%t nxt[{n_,a_}]:={n+1,a^2+Prime[n]}; NestList[nxt,{1,1},9][[All,2]] (* _Harvey P. Dale_, Aug 02 2017 *)

%o (Magma) [n le 1 select 1 else Self(n-1)^2 + NthPrime(n-1): n in [1..14]]; // _G. C. Greubel_, Jan 04 2024

%o (SageMath)

%o def a(n): return 1 if n==1 else a(n-1)^2 + nth_prime(n-1) # a = A028301

%o [a(n) for n in range(1,15)] # _G. C. Greubel_, Jan 04 2024

%Y Cf. A028300.

%K nonn,easy

%O 1,2

%A A.R. Fink (fink(AT)cadvision.com)