A254115 Permutation of natural numbers: a(n) = A254104(A048673(n)).
1, 2, 3, 4, 5, 6, 7, 8, 13, 10, 11, 12, 9, 14, 21, 16, 15, 26, 23, 20, 43, 22, 19, 24, 63, 18, 33, 28, 31, 42, 47, 32, 55, 30, 127, 52, 27, 46, 87, 40, 17, 86, 39, 44, 107, 38, 29, 48, 75, 126, 91, 36, 95, 66, 191, 56, 53, 62, 45, 84, 35, 94, 1023, 64, 255, 110, 25, 60, 183, 254, 79, 104, 37, 54, 171, 92, 125, 174, 59, 80, 4095, 34, 61, 172, 77, 78
Offset: 1
Keywords
Links
Crossrefs
Programs
-
Python
from sympy import factorint, nextprime from operator import mul def a048673(n): f = factorint(n) return 1 if n==1 else (1 + reduce(mul, [nextprime(i)**f[i] for i in f]))/2 def a254104(n): if n==0: return 0 if n%3==0: return 1 + 2*a254104(2*n/3 - 1) elif n%3==1: return 1 + 2*a254104(2*(n - 1)/3) else: return 2*a254104((n - 2)/3 + 1) def a(n): return a254104(a048673(n)) # Indranil Ghosh, Jun 06 2017
Comments