OFFSET
1,2
COMMENTS
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.
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
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Dec 26 2014
STATUS
approved