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.

A121217 a(1)=1, a(2)=2, a(3)=3; for n > 3, a(n) is the smallest positive integer which does not occur earlier in the sequence and which is not coprime to a(n-2).

This page as a plain text file.
%I A121217 #44 Feb 03 2019 11:42:30
%S A121217 1,2,3,4,6,8,9,10,12,5,14,15,7,18,21,16,24,20,22,25,11,30,33,26,27,13,
%T A121217 36,39,28,42,32,34,38,17,19,51,57,45,48,35,40,49,44,56,46,50,23,52,69,
%U A121217 54,60,58,55,29,65,87,70,63,62,66,31,64,93,68,72,74,75,37,78,111,76,81
%N A121217 a(1)=1, a(2)=2, a(3)=3; for n > 3, a(n) is the smallest positive integer which does not occur earlier in the sequence and which is not coprime to a(n-2).
%C A121217 Conjecture: this is a permutation of the positive integers, cf. A256618. - _Reinhard Zumkeller_, Apr 05 2015
%C A121217 The B-sequence mentioned in the Maple program is not in the OEIS. It is 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, ... - _Alois P. Heinz_, Feb 02 2019
%H A121217 N. J. A. Sloane, <a href="/A121217/b121217.txt">Table of n, a(n) for n = 1..20632</a>
%p A121217 # From _N. J. A. Sloane_, Apr 04 2015: A121217 gcd(A[n],A[n-2])>1 A=seq, for B see the COMMENTS
%p A121217 N:= 60: # to get a(1) to a(n) where a(n+1) is the first term > N
%p A121217 B:= Vector(N, datatype=integer[4]):
%p A121217 for n from 1 to 3 do A[n]:= n: od:
%p A121217 for n from 4 do
%p A121217   for k from 4 to N do
%p A121217     if B[k] = 0 and igcd(k, A[n-2]) > 1 then
%p A121217        A[n]:= k;
%p A121217        B[k]:= 1;
%p A121217        break
%p A121217     fi
%p A121217   od:
%p A121217   if k > N then break fi
%p A121217 od:
%p A121217 [seq(A[i], i=1..n-1)];
%t A121217 a = Range@ 3; Do[k = 4; While[Or[MemberQ[a, k], CoprimeQ[a[[i - 2]], k]], k++]; AppendTo[a, k], {i, 4, 72}]; a (* _Michael De Vlieger_, Aug 19 2017 *)
%o A121217 (Haskell)
%o A121217 a121217 n = a121217_list !! (n-1)
%o A121217 a121217_list = 1 : 2 : 3 : f 2 3 [4..] where
%o A121217    f u v xs = g xs where
%o A121217      g (w:ws) = if gcd w u > 1 then w : f v w (delete w xs) else g ws
%o A121217 -- _Reinhard Zumkeller_, Apr 05 2015
%Y A121217 Cf. A064413, A121216, A251622, A256414 (indices of primes), A256419 (smoothed version).
%Y A121217 Cf. A256618 (conjectured inverse).
%K A121217 nonn
%O A121217 1,2
%A A121217 _Leroy Quet_, Aug 20 2006
%E A121217 Extended by _Ray Chandler_, Aug 22 2006