|
|
A036552
|
|
List of pairs (m,2m) where m is the least unused positive number.
|
|
6
|
|
|
1, 2, 3, 6, 4, 8, 5, 10, 7, 14, 9, 18, 11, 22, 12, 24, 13, 26, 15, 30, 16, 32, 17, 34, 19, 38, 20, 40, 21, 42, 23, 46, 25, 50, 27, 54, 28, 56, 29, 58, 31, 62, 33, 66, 35, 70, 36, 72, 37, 74, 39, 78, 41, 82, 43, 86, 44, 88, 45, 90, 47, 94, 48, 96, 49, 98, 51, 102
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
A permutation of the natural numbers. Inverse permutation is A065037.
|
|
LINKS
|
|
|
MATHEMATICA
|
w = {}; Do[ w = If[ FreeQ[w, k], w = Join[w, {k, 2k}], w], {k, 100}]; w
|
|
PROG
|
(Haskell)
import Data.List (delete)
a036552 n = a036552_list !! (n-1)
a036552_list = g [1..] where
g (x:xs) = x : (2*x) : (g $ delete (2*x) xs)
(PARI) apairs(N) = my(m=0, r=List(), i=0); while(#r<N*2, if(!bitand(m, 1<<(i++)), listput(~r, i); listput(~r, i*2); m=bitor(m, 1<<(i*2)))); Vec(r); \\ Ruud H.G. van Tol, May 09 2024
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,nice
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|