A278219 Filter-sequence related to base-2 run-length encoding: a(n) = A046523(A243353(n)).
1, 2, 4, 2, 4, 8, 6, 2, 4, 12, 16, 8, 6, 12, 6, 2, 4, 12, 36, 12, 16, 32, 24, 8, 6, 30, 24, 12, 6, 12, 6, 2, 4, 12, 36, 12, 36, 72, 60, 12, 16, 48, 64, 32, 24, 72, 24, 8, 6, 30, 60, 30, 24, 48, 60, 12, 6, 30, 24, 12, 6, 12, 6, 2, 4, 12, 36, 12, 36, 72, 60, 12, 36, 180, 144, 72, 60, 180, 60, 12, 16, 48, 144, 48, 64, 128, 96, 32, 24, 120, 216, 72, 24, 72
Offset: 0
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 0..65537
Crossrefs
Programs
-
Mathematica
f[n_, i_, x_] := Which[n == 0, x, EvenQ@ n, f[n/2, i + 1, x], True, f[(n - 1)/2, i, x Prime@ i]]; g[n_] := If[n == 1, 1, Times @@ MapIndexed[ Prime[First@ #2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]]]; Table[g@ f[BitXor[n, Floor[n/2]], 1, 1], {n, 0, 93}] (* Michael De Vlieger, May 09 2017 *)
-
Python
from sympy import prime, factorint import math def A(n): return n - 2**int(math.floor(math.log(n, 2))) def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n)) def a005940(n): return b(n - 1) def P(n): f = factorint(n) return sorted([f[i] for i in f]) def a046523(n): x=1 while True: if P(n) == P(x): return x else: x+=1 def a003188(n): return n^int(n/2) def a243353(n): return a005940(1 + a003188(n)) def a(n): return a046523(a243353(n)) # Indranil Ghosh, May 07 2017
-
Scheme
(define (A278219 n) (A046523 (A243353 n)))