%I M0894 #72 May 20 2024 14:05:22
%S 2,3,8,63,3968,15745023,247905749270528,61457260521381894004129398783,
%T 3776994870793005510047522464634252677140721938309041881088
%N a(n) = a(n-1)^2 - 1, a(0) = 2.
%C After a(0) = 2 and a(1) = 3, this can never be prime, since a(n) = (a(n-1) + 1) * (a(n-1) - 1). Each term is relatively prime to its successor. - _Jonathan Vos Post_, Jun 06 2008
%C Mensa (see Dutch link below) indicates high intelligence by offering a self test containing a number of problems, one of which is "Complete each series with the element that logically continues the series: 3968, 63, 8, 3". - _David A. Corneth_, May 19 2024
%D R. K. Guy, How to factor a number, Proc. 5th Manitoba Conf. Numerical Math., Congress. Num. 16 (1975), 49-89.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H G. C. Greubel, <a href="/A003096/b003096.txt">Table of n, a(n) for n = 0..12</a>
%H A. V. Aho and N. J. A. Sloane, <a href="https://www.fq.math.ca/Scanned/11-4/aho-a.pdf">Some doubly exponential sequences</a>, Fibonacci Quarterly, Vol. 11, No. 4 (1973), pp. 429-437, <a href="http://neilsloane.com/doc/doubly.html">alternative link</a>.
%H Mensa, <a href="https://www.mensa.nl/start-de-thuistest">self-test indicative for high IQ</a>
%H <a href="/index/Aa#AHSL">Index entries for sequences of form a(n+1)=a(n)^2 + ...</a>
%F a(n-1) = ceiling(c^(2^n)) where c = 1.295553... = A077124. - _Benoit Cloitre_, Nov 29 2002
%p a := proc(n) local k, v: v := 2: for k from 1 to n do v := v^2-1: od: v: end:
%p seq(a(n), n = 0 .. 8); # _Lorenzo Sauras Altuzarra_, Feb 01 2023
%t NestList[#^2-1&,2,10] (* _Harvey P. Dale_, Nov 06 2011 *)
%o (PARI) a(n)=if(n<1,2*(n==0),a(n-1)^2-1)
%o (Magma) [n le 1 select 2 else Self(n-1)^2 -1: n in [1..12]]; // _G. C. Greubel_, Oct 27 2022
%o (SageMath)
%o def A003096(n): return 2 if (n==0) else A003096(n-1)^2 -1
%o [A003096(n) for n in range(12)] # _G. C. Greubel_, Oct 27 2022
%Y Cf. A003095, A077124, A139244.
%K nonn,easy,nice
%O 0,1
%A _N. J. A. Sloane_