login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 6
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, 36, 39, 28, 42, 32, 34, 38, 17, 19, 51, 57, 45, 48, 35, 40, 49, 44, 56, 46, 50, 23, 52, 69, 54, 60, 58, 55, 29, 65, 87, 70, 63, 62, 66, 31, 64, 93, 68, 72, 74, 75, 37, 78, 111, 76, 81 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Conjecture: this is a permutation of the positive integers, cf. A256618. - Reinhard Zumkeller, Apr 05 2015
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
LINKS
MAPLE
# From N. J. A. Sloane, Apr 04 2015: A121217 gcd(A[n], A[n-2])>1 A=seq, for B see the COMMENTS
N:= 60: # to get a(1) to a(n) where a(n+1) is the first term > N
B:= Vector(N, datatype=integer[4]):
for n from 1 to 3 do A[n]:= n: od:
for n from 4 do
for k from 4 to N do
if B[k] = 0 and igcd(k, A[n-2]) > 1 then
A[n]:= k;
B[k]:= 1;
break
fi
od:
if k > N then break fi
od:
[seq(A[i], i=1..n-1)];
MATHEMATICA
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 *)
PROG
(Haskell)
a121217 n = a121217_list !! (n-1)
a121217_list = 1 : 2 : 3 : f 2 3 [4..] where
f u v xs = g xs where
g (w:ws) = if gcd w u > 1 then w : f v w (delete w xs) else g ws
-- Reinhard Zumkeller, Apr 05 2015
CROSSREFS
Cf. A064413, A121216, A251622, A256414 (indices of primes), A256419 (smoothed version).
Cf. A256618 (conjectured inverse).
Sequence in context: A184899 A039034 A047302 * A357992 A255582 A254077
KEYWORD
nonn
AUTHOR
Leroy Quet, Aug 20 2006
EXTENSIONS
Extended by Ray Chandler, Aug 22 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 14:10 EDT 2024. Contains 371792 sequences. (Running on oeis4.)