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.

A337136 a(1) = 1, a(2) = 2; for n > 1, a(n) = smallest positive number which has not yet appeared which has a common factor with a(n-2) + a(n-1).

Original entry on oeis.org

1, 2, 3, 5, 4, 6, 8, 7, 9, 10, 19, 29, 12, 41, 53, 14, 67, 15, 16, 31, 47, 13, 18, 62, 20, 22, 21, 43, 24, 134, 26, 25, 17, 27, 11, 28, 30, 32, 34, 33, 201, 36, 39, 35, 37, 38, 40, 42, 44, 46, 45, 49, 48, 97, 50, 51, 101, 52, 54, 56, 55, 57, 58, 23, 60, 83, 65
Offset: 1

Views

Author

Scott R. Shannon, Aug 18 2020

Keywords

Comments

Conjecture: This is a permutation of the natural numbers. Up to 1 million terms the only fixed points are 1,2,3,6,9,10, and it is likely that there are no others.

Examples

			a(5) = 4 as a(3) + a(4) = 3 + 5 = 8, and 4 is the smallest number that shares a common factor with 8 that has not yet appeared.
a(11) = 19 as a(9) + a(10) = 9 + 10 = 19, and as 19 is prime, a(11) must be the smallest multiple of 19 that has not yet appeared, being 19 in this case.
		

Crossrefs

Programs

  • Mathematica
    nn = 120;
    c[_] := False;
    Array[Set[{a[#], c[#]}, {#, True}] &, 2]; Set[{i, j, u},
     Range[3]]; s = i + j;
    Do[k = u;
     While[Or[c[k], CoprimeQ[s, k]], k++];
     Set[{a[n], c[k], i, j, s}, {k, True, j, k, j + k}];
     If[k == u, While[c[u], u++]], {n, 3, nn}];
    Array[a, nn] (* Michael De Vlieger, Oct 26 2023 *)
  • PARI
    lista(nn) = v=[1, 2]; for(n=3, nn, t=1; while(prod(X=1, n-1, v[X]-t)==0 || gcd(v[n-2]+v[n-1], t)==1, t++); v=concat(v, t); ); v; \\ Yifan Xie, May 18 2023