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 A370951 #22 Mar 24 2024 10:48:46 %S A370951 82,182,46,94,200,430,846,1628,2982,5662,10940,17924,34308,65768, %T A370951 125760,240732,460672,883598,1697502,3268008,6297778,12152690, %U A370951 23482980,45422208,87949242,170465380,330760622,642315104,1094147916,2132023868,4153355532,8093060816,15777058876 %N A370951 First differences of A112877 (zero terms in Cald's sequence A006509). %C A370951 The terms essentially double at each step. The ratios of successive terms are 2.219512195, 0.2527472527, 2.043478261, 2.127659574, 2.150000000, 1.967441860, 1.924349882, 1.831695332, 1.898725687, 1.932179442, 1.638391225, 1.914081678, 1.916987292, 1.912176134, 1.914217557, 1.913630095, 1.918063177, 1.921124765, 1.925186539, 1.927099934, 1.929679007, 1.932327740, 1.934260814, 1.936260826, 1.938224550, 1.940338983, 1.941933414, 1.703444165, 1.948570058, 1.948081161, 1.948559605, 1.949455124... %t A370951 nn = 2^20; c[_] := False; a[1] = j = 1; c[1] = True; %t A370951 Differences@ Monitor[Reap[ %t A370951 Do[p = Prime[n - 1]; %t A370951 If[And[# > 0, ! c[#]], k = #, %t A370951 If[c[#], k = 0; Sow[n], k = #] &[j + p]] &[j - p]; %t A370951 Set[{c[k], j}, {True, k}], {n, 2, nn}]][[-1, 1]], n] (* _Michael De Vlieger_, Mar 07 2024 *) %o A370951 (Python) %o A370951 from itertools import count, islice %o A370951 from sympy import nextprime %o A370951 def A370951_gen(): # generator of terms %o A370951 a, aset, p, q = 1, {1}, 2, 0 %o A370951 for c in count(2): %o A370951 if (b:=a-p) > 0 and b not in aset: %o A370951 a = b %o A370951 elif (b:=a+p) not in aset: %o A370951 a = b %o A370951 else: %o A370951 a = 0 %o A370951 if q: %o A370951 yield c-q %o A370951 q = c %o A370951 aset.add(a) %o A370951 p = nextprime(p) %o A370951 A370951_list = list(islice(A370951_gen(),10)) # _Chai Wah Wu_, Mar 07 2024 %Y A370951 Cf. A006509, A112877. %K A370951 nonn %O A370951 1,1 %A A370951 _N. J. A. Sloane_, Mar 07 2024 %E A370951 a(29)-a(33) from _Martin Ehrenstein_, Mar 07 2024