This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A244915 #104 Sep 24 2024 02:13:34 %S A244915 1,1,2,3,8,5,2,7,8,13,2,15,4,1,6,5,4,9,10,1,14,9,16,1,20,3,10,7,12,13, %T A244915 10,17,2,27,10,19,6,11,4,21,10,29,4,25,6,29,16,5,18,7,20,11,14,15,22, %U A244915 5,24,1,26,5,28,13,20,19,14,25,12,17,8,23,12,43,8 %N A244915 Smallest positive integer a(n) such that b(n) = a(n)^2 + a(n-1)^2 is a prime different from the primes b(1), b(2), ..., b(n-1), where a(0) = 1. %C A244915 If every positive integer appears in the sequence infinitely often then the sequence b(n) is a permutation of all primes of the form x^2 + y^2. %H A244915 Jens Kruse Andersen, <a href="/A244915/b244915.txt">Table of n, a(n) for n = 0..10000</a> %o A244915 (PARI) %o A244915 a244915(maxn) = { %o A244915 my(a=[1], b=[], an, bn); %o A244915 for(n=1, maxn, %o A244915 an=1; %o A244915 while(!(isprime(bn=an^2+a[#a]^2) && setsearch(b, bn)==0), an++); %o A244915 a=concat(a, an); %o A244915 b=setunion(b, [bn]) %o A244915 ); %o A244915 a %o A244915 } %o A244915 a244915(100) \\ _Colin Barker_, Aug 24 2014 %o A244915 (Python) %o A244915 from sympy import isprime %o A244915 A244915 = [1] %o A244915 blist = [] %o A244915 for n in range(1, 100): %o A244915 a, b = 1, 1 + A244915[-1]**2 %o A244915 while not isprime(b) or b in blist: %o A244915 b += 2*a+1 %o A244915 a += 1 %o A244915 blist.append(b) %o A244915 A244915.append(a) %o A244915 # _Chai Wah Wu_, Aug 28 2014 %Y A244915 Cf. A100208. %K A244915 nonn %O A244915 0,3 %A A244915 _Thomas Ordowski_, Aug 21 2014 %E A244915 More terms from _Colin Barker_, Aug 24 2014