login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual appeal: Please make a donation to keep the OEIS running! Over 6000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A156552 Unary-encoded compressed factorization of natural numbers. 67
0, 1, 2, 3, 4, 5, 8, 7, 6, 9, 16, 11, 32, 17, 10, 15, 64, 13, 128, 19, 18, 33, 256, 23, 12, 65, 14, 35, 512, 21, 1024, 31, 34, 129, 20, 27, 2048, 257, 66, 39, 4096, 37, 8192, 67, 22, 513, 16384, 47, 24, 25, 130, 131, 32768, 29, 36, 71, 258, 1025, 65536, 43, 131072, 2049, 38, 63, 68, 69, 262144 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

The primes become the powers of 2 (2 -> 1, 3 -> 2, 5 -> 4, 7 -> 8); the composite numbers are formed by taking the values for the factors in the increasing order, multiplying them by the consecutive powers of 2, and summing. See the Example section.

From Antti Karttunen, Jun 27 2014: (Start)

The odd bisection (containing even terms) halved gives A244153.

The even bisection (containing odd terms), when one is subtracted from each and halved, gives this sequence back.

(End)

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..1024

A puzzle by Sergey Orlov (in Russian)

Index entries for sequences related to binary expansion of n

Index entries for sequences that are permutations of the natural numbers

FORMULA

From Antti Karttunen, Jun 26 2014: (Start)

a(1) = 0, a(n) = A000079(A001222(n)+A061395(n)-2) + a(A052126(n)).

a(1) = 0, a(2n) = 1+2*a(n), a(2n+1) = 2*a(A064989(2n+1)). [Compare to the entanglement-recurrence A243071].

For n >= 0, a(2n+1) = 2*A244153(n+1). [Follows from the latter clause of the above formula].

a(n) = A005941(n) - 1.

As a composition of related permutations:

a(n) = A003188(A243354(n)).

a(n) = A054429(A243071(n)).

For all n >= 1, A005940(1+a(n)) = n and for all n >= 0, a(A005940(n+1)) = n. [The offset-0 version of A005940 works as an inverse for this permutation].

This permutations also maps between the partition-lists A112798 and A125106:

A056239(n) = A161511(a(n)). [The sums of parts of each partition (the total sizes)].

A003963(n) = A243499(a(n)). [And also the products of those parts].

(End)

From Antti Karttunen, Oct 09 2016: (Start)

A161511(a(n)) = A056239(n).

A029837(1+a(n)) = A252464(n). [Binary width of terms.]

A080791(a(n)) = A252735(n). [Number of nonleading 0-bits.]

A000120(a(n)) = A001222(n). [Binary weight.]

For all n >= 2, A001511(a(n)) = A055396(n).

For all n >= 2, A000120(a(n))-1 = A252736(n). [Binary weight minus one.]

A252750(a(n)) = A252748(n).

a(A250246(n)) = A252754(n).

a(A005117(n)) = A277010(n). [Maps squarefree numbers to a permutation of A003714, fibbinary numbers.]

A085357(a(n)) = A008966(n). [Ditto for their characteristic functions.]

For all n >= 0:

a(A276076(n)) = A277012(n).

a(A276086(n)) = A277022(n).

a(A260443(n)) = A277020(n).

(End)

EXAMPLE

For 84 = 2*2*3*7 -> 1*1 + 1*2 + 2*4 + 8*8 =  75.

For 105 = 3*5*7 -> 2*1 + 4*2 + 8*4 = 42.

For 137 = p_33 -> 2^32 = 4294967296.

For 420 = 2*2*3*5*7 -> 1*1 + 1*2 + 2*4 + 4*8 + 8*16 = 171.

For 147 = 3*7*7 = p_2 * p_4 * p_4 -> 2*1 + 8*2 + 8*4 = 50.

MATHEMATICA

Table[Floor@ Total@ Flatten@ MapIndexed[#1 2^(#2 - 1) &, Flatten[ Table[2^(PrimePi@ #1 - 1), {#2}] & @@@ FactorInteger@ n]], {n, 67}] (* Michael De Vlieger, Sep 08 2016 *)

PROG

(Perl)

# Program corrected per instructions from Leonid Broukhis. - Antti Karttunen, Jun 26 2014

# However, it gives correct answers only up to n=136, before corruption by a wrap-around effect.

# Note that the correct answer for n=137 is A156552(137) = 4294967296.

$max = $ARGV[0];

$pow = 0;

foreach $i (2..$max) {

@a = split(/ /, `factor $i`);

shift @a;

$shift = 0;

$cur = 0;

while ($n = int shift @a) {

$prime{$n} = 1 << $pow++ if !defined($prime{$n});

$cur |= $prime{$n} << $shift++;

}

print "$cur, ";

}

print "\n";

(Scheme, with memoization-macro definec from Antti Karttunen's IntSeq-library, two different implementations)

(definec (A156552 n) (cond ((= n 1) 0) (else (+ (A000079 (+ -2 (A001222 n) (A061395 n))) (A156552 (A052126 n))))))

(definec (A156552 n) (cond ((= 1 n) (- n 1)) ((even? n) (+ 1 (* 2 (A156552 (/ n 2))))) (else (* 2 (A156552 (A064989 n))))))

;; Antti Karttunen, Jun 26 2014

CROSSREFS

One less than A005941.

Inverse permutation: A005940 with starting offset 0 instead of 1.

Cf. A000079, A000120, A001222, A052126, A054429, A061395, A064216, A064989, A003188, A243071, A243065-A243066, A244153, A243354, A112798, A125106, A056239, A161511.

Other related permutations: A253551, A253792, A253564, A253791, A277195.

Sequence in context: A269388 A252754 A246677 * A269383 A249813 A246683

Adjacent sequences:  A156549 A156550 A156551 * A156553 A156554 A156555

KEYWORD

easy,base,nonn

AUTHOR

Leonid Broukhis, Feb 09 2009

EXTENSIONS

More terms from Antti Karttunen, Jun 28 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 | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified December 17 04:09 EST 2017. Contains 296096 sequences.