A354731 Absolute values of first differences of A354688.
1, 3, 2, 4, 5, 7, 15, 9, 8, 13, 17, 19, 11, 6, 12, 14, 20, 10, 29, 21, 16, 22, 23, 27, 25, 31, 18, 47, 35, 33, 37, 26, 61, 39, 34, 28, 24, 55, 43, 41, 45, 38, 40, 30, 32, 44, 89, 59, 57, 49, 53, 65, 58, 51, 63, 115, 67, 56, 46, 36, 91, 71, 69, 73, 62, 48, 42, 99, 77, 50, 125, 79, 75, 83, 85, 81
Offset: 1
Keywords
Examples
a(3) = 2 as | A354688(4) - A354688(3) | = | 3 - 5 | = 2.
Links
- Michael De Vlieger, Annotated log log scatterplot of a(n), n = 1..2^14, showing records in red and local minima in blue, highlighting primes in green and fixed points in gold.
- Scott R. Shannon, Image of the first 10000. The green line is y = n.
Programs
-
Mathematica
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 *)
-
Python
from math import gcd from sympy import isprime, nextprime from itertools import count, islice def agen(): # generator of terms aset, diffset, an, mink = {1}, set(), 1, 2 for n in count(2): k = mink while k in aset or abs(an-k) in diffset or gcd(an, k) != 1: k += 1 aset.add(k); diffset.add(abs(k-an)); yield abs(k-an); an = k while mink in aset: mink += 1 print(list(islice(agen(), 76))) # Michael S. Branicky, Jun 04 2022
Comments