login
Primes not occurring as |differences| in Cald's sequence A006509.
2

%I #25 Mar 11 2024 04:53:50

%S 641,1213,2617,2957,3727,5443,9283,17359,33829,66173,131303,264763,

%T 494743,957547,1888157,3753647,7490797,14961157,29899357,59773871,

%U 119551489,239106347,478234723,956607929,1913366111,3826828409,7653840367,15308666783,30619196381,57415599151

%N Primes not occurring as |differences| in Cald's sequence A006509.

%C In other words, primes that do not occur as absolute values of differences of successive terms in Cald's sequence A006509.

%F a(n) = prime(A112877(n) - 1).

%o (Python)

%o from itertools import count, islice

%o from sympy import nextprime

%o def A117129_gen(): # generator of terms

%o a, aset, p = 1, {1}, 2

%o for c in count(2):

%o if (b:=a-p) > 0 and b not in aset:

%o a = b

%o elif (b:=a+p) not in aset:

%o a = b

%o else:

%o a = 0

%o yield p

%o aset.add(a)

%o p = nextprime(p)

%o A117129_list = list(islice(A117129_gen(),10)) # _Chai Wah Wu_, Mar 04 2024

%Y Cf. A006509, A112877.

%K nonn

%O 1,1

%A _N. J. A. Sloane_, Apr 20 2006

%E a(19)-a(26) from _Donovan Johnson_, Feb 18 2010

%E a(27)-a(29) from _Chai Wah Wu_, Mar 04 2024

%E a(30) from _Chai Wah Wu_, Mar 10 2024