[go: up one dir, main page]

login
A 2nd order recursion: a(1)=a(2)=1; a(n) = prime(a(n-2)+a(n-1)) = A000040(a(n-2)+a(n-1)).
3

%I #17 Sep 08 2022 08:45:09

%S 1,1,3,7,29,151,1069,9887,115891,1666421,28700933,580669933,

%T 13578126713,362075579539,10886955278951,365589325548857,

%U 13598064388599629,556220494250764093

%N A 2nd order recursion: a(1)=a(2)=1; a(n) = prime(a(n-2)+a(n-1)) = A000040(a(n-2)+a(n-1)).

%t a[n_]:= a[n]= If[n<3, 1, Prime[a[n-1]+a[n-2]]]; Table[a[n], {n,13}] (* modified by _G. C. Greubel_, Aug 31 2019 *)

%t nxt[{a_,b_}]:={b,Prime[a+b]}; Transpose[NestList[nxt,{1,1},13]][[1]] (* _Harvey P. Dale_, Oct 02 2013 *)

%o (Magma) a:= func< n | n lt 3 select 1 else NthPrime(Self(n-1) + Self(n-2)) >;

%o [a(n): n in [1..12]]; // _G. C. Greubel_, Aug 31 2019

%Y Cf. A069103, A082094, A082095.

%K nonn,more

%O 1,3

%A _Labos Elemer_, Apr 11 2003

%E a(15) from _G. C. Greubel_, Aug 31 2019

%E a(16)-a(18) from _Chai Wah Wu_, Sep 18 2019