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.

A358026 Let G(n) = gcd(a(n-2),a(n-1)), a(1)=1, a(2)=2, a(3)=3. Thereafter if G(n) = 1, a(n) is the least novel m sharing a divisor with both a(n-2) and a(n-1). If G(n) > 1 and every prime divisor of a(n-1) also divides a(n-2), a(n) is the least m prime to both a(n-1) and a(n-2). Otherwise a(n) is the least novel multiple of any prime divisor of a(n-1) which does not divide a(n-2).

Original entry on oeis.org

1, 2, 3, 6, 4, 5, 10, 8, 7, 14, 12, 9, 11, 33, 15, 20, 16, 13, 26, 18, 21, 28, 22, 44, 17, 34, 24, 27, 19, 57, 30, 25, 23, 115, 35, 42, 32, 29, 58, 36, 39, 52, 38, 76, 31, 62, 40, 45, 48, 46, 69, 51, 68, 50, 55, 66, 54, 37, 74, 56, 49, 41, 287, 63, 60, 64, 43
Offset: 1

Views

Author

David James Sycamore, Oct 25 2022

Keywords

Comments

Conjectured to be a permutation of the positive integers with the primes in natural order, and primes are the slowest numbers to appear (as in A352187).

Examples

			a(4) = 6, the least novel number sharing a factor with both 2 and 3.
a(5) = 4, the least novel multiple of 2, which divides a(4) but does not divide a(3).
Since every prime dividing a(5)=4 also divides a(4)=6, a(6)=5 the least novel term prime to 3 and 6.
		

Crossrefs

Programs

  • Mathematica
    nn = 67; c[] = False; q[] = 1; u = 4; Do[(Set[{a[n], c[n]}, {n, True}]; q[n]++), {n, u - 1}]; Do[m = FactorInteger[a[n - 1]][[All, 1]]; f = Select[m, CoprimeQ[#, a[n - 2]] &]; Which[Length[f] == PrimeNu[a[n - 1]], Set[{k, q[#1]}, {#2, #2/#1}] & @@ First@ MinimalBy[Map[{#, Set[g, q[#]]; While[c[g #], g++]; # g} &, Flatten@ Outer[Times, m, FactorInteger[a[n - 2]][[All, 1]] ] ], Last], Length[f] == 0, k = u; While[Nand[! c[k], CoprimeQ[a[n - 2], k], CoprimeQ[a[n - 1], k]], k++]; If[k == u, While[c[u], u++]], True, Set[{k, q[#1]}, {#2, #2/#1}] & @@ First@ MinimalBy[Map[{#, Set[g, q[#]]; While[c[g #], g++]; # g} &, f], Last] ]; Set[{a[n], c[k]}, {k, True}], {n, 4, nn}]; Array[a, nn] (* Michael De Vlieger, Oct 25 2022 *)

Extensions

More terms from Michael De Vlieger, Oct 25 2022