OFFSET
0,3
COMMENTS
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.
LINKS
Jens Kruse Andersen, Table of n, a(n) for n = 0..10000
PROG
(PARI)
a244915(maxn) = {
my(a=[1], b=[], an, bn);
for(n=1, maxn,
an=1;
while(!(isprime(bn=an^2+a[#a]^2) && setsearch(b, bn)==0), an++);
a=concat(a, an);
b=setunion(b, [bn])
);
a
}
a244915(100) \\ Colin Barker, Aug 24 2014
(Python)
from sympy import isprime
A244915 = [1]
blist = []
for n in range(1, 100):
a, b = 1, 1 + A244915[-1]**2
while not isprime(b) or b in blist:
b += 2*a+1
a += 1
blist.append(b)
A244915.append(a)
# Chai Wah Wu, Aug 28 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Aug 21 2014
EXTENSIONS
More terms from Colin Barker, Aug 24 2014
STATUS
approved