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

 Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 60th year, we have over 367,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”). Other ways to Give
 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A251561 A permutation of the natural numbers: interchange p and 2p for every prime p. 3
 1, 4, 6, 2, 10, 3, 14, 8, 9, 5, 22, 12, 26, 7, 15, 16, 34, 18, 38, 20, 21, 11, 46, 24, 25, 13, 27, 28, 58, 30, 62, 32, 33, 17, 35, 36, 74, 19, 39, 40, 82, 42, 86, 44, 45, 23, 94, 48, 49, 50, 51, 52, 106, 54, 55, 56, 57, 29, 118, 60, 122, 31, 63, 64, 65, 66 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS a(A001751(n)) != A001751(n). - Reinhard Zumkeller, Dec 27 2014 LINKS Michael De Vlieger, Table of n, a(n) for n = 1..10000 A. B. Frizell, Certain non-enumerable sets of infinite permutations. Bull. Amer. Math. Soc. 21 (1915), no. 10, 495-499. Index entries for sequences that are permutations of the natural numbers MATHEMATICA a251561[n_] := Block[{f}, f[x_] := Which[PrimeQ[x], 2 x, PrimeQ[x/2], x/2, True, x]; Array[f, n]]; a251561[66] (* Michael De Vlieger, Dec 26 2014 *) PROG (Python) from sympy import isprime def A251561(n): ....if n == 2: ........return 4 ....q, r = divmod(n, 2) ....if r : ........if isprime(n): ............return 2*n ........return n ....if isprime(q): ........return q ....return n # Chai Wah Wu, Dec 26 2014 (Haskell) a251561 1 = 1 a251561 n | q == 1 = 2 * p | p == 2 && a010051' q == 1 = q | otherwise = n where q = div n p; p = a020639 n -- Reinhard Zumkeller, Dec 27 2014 CROSSREFS Cf. A064614, A253046. Cf. A020639, A010051, A001751. Sequence in context: A095196 A074828 A282028 * A159193 A118967 A366952 Adjacent sequences: A251558 A251559 A251560 * A251562 A251563 A251564 KEYWORD nonn AUTHOR N. J. A. Sloane, Dec 26 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.

Last modified December 10 12:58 EST 2023. Contains 367710 sequences. (Running on oeis4.)