|
|
A370951
|
|
First differences of A112877 (zero terms in Cald's sequence A006509).
|
|
3
|
|
|
82, 182, 46, 94, 200, 430, 846, 1628, 2982, 5662, 10940, 17924, 34308, 65768, 125760, 240732, 460672, 883598, 1697502, 3268008, 6297778, 12152690, 23482980, 45422208, 87949242, 170465380, 330760622, 642315104, 1094147916, 2132023868, 4153355532, 8093060816, 15777058876
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
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...
|
|
LINKS
|
|
|
MATHEMATICA
|
nn = 2^20; c[_] := False; a[1] = j = 1; c[1] = True;
Differences@ Monitor[Reap[
Do[p = Prime[n - 1];
If[And[# > 0, ! c[#]], k = #,
If[c[#], k = 0; Sow[n], k = #] &[j + p]] &[j - p];
Set[{c[k], j}, {True, k}], {n, 2, nn}]][[-1, 1]], n] (* Michael De Vlieger, Mar 07 2024 *)
|
|
PROG
|
(Python)
from itertools import count, islice
from sympy import nextprime
def A370951_gen(): # generator of terms
a, aset, p, q = 1, {1}, 2, 0
for c in count(2):
if (b:=a-p) > 0 and b not in aset:
a = b
elif (b:=a+p) not in aset:
a = b
else:
a = 0
if q:
yield c-q
q = c
aset.add(a)
p = nextprime(p)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|