login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A354721 Absolute values of first differences of A354687. 4

%I #15 Jun 04 2022 13:26:36

%S 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 23,46,48,7,30,34,32,49,35,36,51,45,42,25,44,55,38,66,19,57,40,87,58,

%U 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 Absolute values of first differences of A354687.

%C See A354687 for further details.

%H 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 Scott R. Shannon, <a href="/A354721/a354721.png">Image of the first 100000 terms</a>. The green line is y = n.

%e a(5) = 8 as | A354687(6) - A354687(5) | = | 6 - 14 | = 8.

%t 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 (Python)

%o from math import gcd

%o from sympy import isprime, nextprime

%o from itertools import count, islice

%o def agen(): # generator of terms

%o aset, diffset, an, mink = {1, 2}, {1}, 2, 3

%o yield from [1]

%o for n in count(3):

%o k = mink

%o while k in aset or abs(an-k) in diffset or gcd(an, k) == 1: k += 1

%o aset.add(k); diffset.add(abs(k-an)); yield abs(an-k); an = k

%o while mink in aset: mink += 1

%o print(list(islice(agen(), 76))) # _Michael S. Branicky_, Jun 04 2022

%Y Cf. A354687, A064413, A354688, A354731, A354087, A352763.

%K nonn

%O 1,2

%A _Scott R. Shannon_, Jun 04 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 4 14:17 EDT 2024. Contains 373994 sequences. (Running on oeis4.)