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.

A365117 a(1) = 1. Thereafter a(n) is the least novel multiple m of the smallest prime which does not divide a(n-1) and such that m is coprime to a(n-1).

Original entry on oeis.org

1, 2, 3, 4, 9, 8, 15, 14, 27, 10, 21, 16, 33, 20, 39, 22, 45, 26, 51, 28, 57, 32, 63, 34, 69, 38, 75, 44, 81, 40, 87, 46, 93, 50, 99, 52, 105, 58, 111, 56, 117, 62, 123, 64, 129, 68, 135, 74, 141, 70, 153, 76, 147, 80, 159, 82, 165, 86, 171, 88, 177, 92, 183, 94
Offset: 1

Views

Author

David James Sycamore, Aug 22 2023

Keywords

Comments

The Name is as for A351495, but with an extra constraint: namely that a(n) is prime to a(n-1).
{a(n)}; n > 1 is a permutation of A047228.

Examples

			a(2) = 2 because 2 is the smallest prime which does not divide 1, and 2 is prime to 1.
3(3) = 3 because 3 is the smallest prime which does not divide 2, and 3 is prime to 2.
a(4) = 4 since it is the second multiple of 2, the smallest prime that does not divide 3, and 4 is prime to 3.
a(5) = 9 since it is the least novel multiple of 3, the smallest prime that does not divide 4, and is the least such number prime to 4.
		

Crossrefs

Programs

  • Mathematica
    nn = 12; m[] := 1; a[1] = j = 1; m[1] = 2; c[1] = True; c[] := False; f[x_] := Block[{q}, q = 2; While[! CoprimeQ[q, x], q = NextPrime[q]]; q]; Do[{k = m[#]; While[Or[! CoprimeQ[j, k], c[# k]], k++]; If[k == m[#], While[c[m[#] #], m[#]++]]; Set[{a[n], j, c[k #]}, {k #, k #, True}]} &@ f[j], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Aug 22 2023 *)
  • PARI
    first(n) = {my(res = vector(n)); sofar = Set([1..4]); for(i = 1, 4, res[i] = i); for(i = 5, n, res[i] = nxt(res[i-1])); res}
    nxt(n) = {my(start, step); if(n % 2 == 0, start = 3; step = 6, start = 2; step = [2,4]); forstep(i = start, oo, step, s = Set(i); if(gcd(i, n) == 1 && #setminus(s, sofar) == 1, sofar = setunion(sofar, s); return(i)))} \\ David A. Corneth, Aug 22 2023

Formula

From Michael De Vlieger, Aug 22 2023: (Start)
a(2n) == +-2 (mod 6).
a(2n+1) == 3 (mod 6), n > 0. (End)

Extensions

More terms from David A. Corneth, Aug 22 2023