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!)
A098311 Smallest number not occurring earlier and coprime to a(ceiling(n/2)); a(1)=1. 4
1, 2, 3, 5, 4, 7, 6, 8, 9, 11, 10, 12, 13, 17, 15, 19, 14, 16, 18, 20, 21, 23, 25, 29, 22, 24, 26, 27, 28, 31, 30, 32, 33, 37, 35, 39, 41, 43, 47, 49, 34, 38, 36, 40, 42, 44, 45, 46, 51, 53, 55, 59, 57, 61, 50, 52, 65, 67, 48, 54, 71, 73, 63, 69, 56, 58, 60, 62, 64, 66, 68, 70 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(2*n) > a(2*n-1).
Permutation of the natural numbers with inverse A098313: A098312(n) = a(a(n)).
LINKS
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^12, showing records in red, local minima in blue, highlighting primes in green and other prime powers in gold.
MATHEMATICA
nn = 72; c[_] = False; Set[{a[1], c[1]}, {1, True}]; u = 2; Do[Set[{j, k}, {a[Ceiling[n/2]], u}]; While[Nand[! c[k], CoprimeQ[j, k]], k++]; Set[{a[n], c[k]}, {k, True}]; If[k == u, While[c[u], u++]], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Oct 28 2022 *)
PROG
(Haskell)
import Data.List ((\\))
a098311 n = a098311_list !! (n-1)
a098311_list = 1 : ys where
ys = 2 : f ys [3..] where
f (v:vs) ws = us ++ f vs (ws \\ us) where
us = take 2 $ filter ((== 1) . (gcd v)) ws
-- Reinhard Zumkeller, Oct 11 2014
CROSSREFS
Sequence in context: A351298 A082746 A098313 * A342265 A230086 A333404
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Sep 02 2004
EXTENSIONS
Typo in definition fixed by Reinhard Zumkeller, Oct 11 2014
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 August 11 14:50 EDT 2024. Contains 375073 sequences. (Running on oeis4.)