OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Patrick De Geest, Home Primes
EXAMPLE
15 = 3*5 -> 11.101 -> 11101 = 29, so a(15) = 29.
MATHEMATICA
f[n_] := FromDigits[ Flatten[ IntegerDigits[ Flatten[ Table[ #1, {#2}] & @@@ FactorInteger@n], 2]], 2]; Array[f, 64] (* Robert G. Wilson v, Jun 02 2010 *)
PROG
(Haskell)
-- import Data.List (unfoldr)
a048985 = foldr (\d v -> 2 * v + d) 0 . concatMap
(unfoldr (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 2))
. reverse . a027746_row
-- Reinhard Zumkeller, Jul 16 2012
(Python)
from sympy import factorint
def a(n):
if n == 1: return 1
return int("".join(bin(p)[2:]*e for p, e in factorint(n).items()), 2)
print([a(n) for n in range(1, 65)]) # Michael S. Branicky, Oct 07 2022
CROSSREFS
KEYWORD
AUTHOR
EXTENSIONS
More terms from Sam Alexander (pink2001x(AT)hotmail.com) and Michel ten Voorde
STATUS
approved