Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #15 Mar 13 2023 04:44:00
%S 3,5,7,11,13,19,29,41,43,59,83,89,107,109,127,139,157,163,173,199,211,
%T 223,257,271,277,293,307,331,347,367,397,421,443,457,491,541,557,587,
%U 601,631,691,761,769,821,911,941,971,991,1009,1033,1103,1129,1153,1201
%N Primes in "Ulam's Prime sequence". A prime is in the sequence iff p+1 can be expressed in exactly 1 way as the sum of 2 previous distinct primes.
%C a(1) = 3, a(2) = 5; for n >= 3, a(n) is smallest prime which is uniquely a(j) + a(k) - 1, with 1<= j < k < n.
%C Is the (3,5) sequence finite or infinite? Note that (3,7) as a starting sequence has only 2 terms and (7,11) yields 7, 11, 17, 23, 29 only. Equally using -1 as a rule creates more variants.
%C The sequence continues at least up to a(2227) = 400031.
%C After about 500 terms, the graph of this sequences appears almost linear. - _T. D. Noe_, Jan 20 2008
%H T. D. Noe, <a href="/A078425/b078425.txt">Table of n, a(n) for n=1..10000</a>
%H <a href="/index/U#Ulam_num">Index entries for Ulam numbers</a>
%e a(3)=7 as 8=3+5. a(4)=11 as 12=5+7 (and nothing else).
%o (PARI) v=vector(1220);vc=2;v[1]=3;v[2]=5; forprime (p=7,1220,p1=p+1;pc=0;fl=0;for (i=1,vc-1, for (j=i+1,vc,if (v[i]+v[j]==p1,pc++);if (pc>1,fl=1);if (fl,break));if (fl,break));if (pc==0,fl=1);if (!fl,vc++;v[vc]=p));print(vecextract(v,concat("1..",vc)))
%Y Cf. A002858 (Ulam numbers), A002859, A003666, A003667, A001857, A048951, A007300.
%K nonn
%O 1,1
%A _Jon Perry_, Dec 29 2002
%E Edited and extended by _Klaus Brockhaus_, Apr 14 2005