login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A356419 Inverse of A067576 considered as a permutation of the positive integers. 3
1, 2, 3, 4, 5, 8, 6, 7, 12, 17, 9, 23, 13, 18, 10, 11, 30, 38, 24, 47, 31, 39, 14, 57, 48, 58, 19, 69, 25, 32, 15, 16, 68, 80, 81, 93, 94, 108, 40, 107, 123, 139, 49, 156, 59, 70, 20, 122, 174, 193, 82, 213, 95, 109, 26, 234, 124, 140, 33, 157, 41, 50, 21, 22, 138, 155, 256 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
Let w(n) = A000120(n) be the Hamming weight of n, p(n) = A068076(n), then a(n) = binomial(w(n)+p(n)+1, 2) - p(n).
EXAMPLE
A067576(12) = 9, so a(9) = 12.
PROG
(PARI) a(n)=my(w=hammingweight(n), p=sum(i=1, n-1, hammingweight(i)==w)); binomial(w+p+1, 2) - p
(Python)
from math import comb
def A356419(n):
c, k = 0, 0
for i, j in enumerate(bin(n)[-1:1:-1]):
if j == '1':
k += 1
c += comb(i, k)
return comb(n.bit_count()+c+1, 2)-c # Chai Wah Wu, Mar 02 2023
CROSSREFS
Sequence in context: A191710 A194061 A272616 * A364775 A085176 A354125
KEYWORD
nonn,look,easy
AUTHOR
Jianing Song, Aug 06 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 1 22:42 EDT 2024. Contains 372178 sequences. (Running on oeis4.)