cp's OEIS Frontend

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.

A354721 Absolute values of first differences of A354687.

This page as a plain text file.
%I A354721 #15 Jun 04 2022 13:26:36
%S A354721 1,2,4,6,8,3,9,10,12,5,15,14,18,16,20,39,13,22,33,21,27,24,11,26,28,
%T A354721 23,46,48,7,30,34,32,49,35,36,51,45,42,25,44,55,38,66,19,57,40,87,58,
%U A354721 54,102,52,56,50,68,85,62,60,75,65,63,108,69,64,70,72,141,17,74,88,76,78,148,80,91,77,81
%N A354721 Absolute values of first differences of A354687.
%C A354721 See A354687 for further details.
%H A354721 Michael De Vlieger, <a href="/A354721/a354721_1.png">Annotated log log scatterplot of a(n)</a>, n = 1..2^14, showing records in red and local minima in blue, highlighting primes in green and fixed points in gold.
%H A354721 Scott R. Shannon, <a href="/A354721/a354721.png">Image of the first 100000 terms</a>. The green line is y = n.
%e A354721 a(5) = 8 as | A354687(6) - A354687(5) | = | 6 - 14 | = 8.
%t A354721 nn = 120; c[_] = d[_] = 0; a[1] = c[1] = 1; a[2] = c[2] = j = 2; u = 3; {1}~Join~Reap[Do[Set[k, u]; While[Nand[c[k] == 0, d[Abs[k - j]] == 0, ! CoprimeQ[j, k]], k++]; Set[{a[i], c[k], d[Abs[k - j]]}, {k, i, i}]; Sow[Abs[k - j]]; j = k; If[k == u, While[c[u] > 0, u++]], {i, 3, nn}]][[-1, -1]] (* _Michael De Vlieger_, Jun 04 2022 *)
%o A354721 (Python)
%o A354721 from math import gcd
%o A354721 from sympy import isprime, nextprime
%o A354721 from itertools import count, islice
%o A354721 def agen(): # generator of terms
%o A354721     aset, diffset, an, mink = {1, 2}, {1}, 2, 3
%o A354721     yield from [1]
%o A354721     for n in count(3):
%o A354721         k = mink
%o A354721         while k in aset or abs(an-k) in diffset or gcd(an, k) == 1: k += 1
%o A354721         aset.add(k); diffset.add(abs(k-an)); yield abs(an-k); an = k
%o A354721         while mink in aset: mink += 1
%o A354721 print(list(islice(agen(), 76))) # _Michael S. Branicky_, Jun 04 2022
%Y A354721 Cf. A354687, A064413, A354688, A354731, A354087, A352763.
%K A354721 nonn
%O A354721 1,2
%A A354721 _Scott R. Shannon_, Jun 04 2022