cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A356419 Inverse of A067576 considered as a permutation of the positive integers.

This page as a plain text file.
%I A356419 #20 Mar 02 2023 11:55:08
%S A356419 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,
%T A356419 19,69,25,32,15,16,68,80,81,93,94,108,40,107,123,139,49,156,59,70,20,
%U A356419 122,174,193,82,213,95,109,26,234,124,140,33,157,41,50,21,22,138,155,256
%N A356419 Inverse of A067576 considered as a permutation of the positive integers.
%H A356419 Jianing Song, <a href="/A356419/b356419.txt">Table of n, a(n) for n = 1..10000</a>
%H A356419 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A356419 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).
%e A356419 A067576(12) = 9, so a(9) = 12.
%o A356419 (PARI) a(n)=my(w=hammingweight(n), p=sum(i=1, n-1, hammingweight(i)==w)); binomial(w+p+1, 2) - p
%o A356419 (Python)
%o A356419 from math import comb
%o A356419 def A356419(n):
%o A356419     c, k = 0, 0
%o A356419     for i,j in enumerate(bin(n)[-1:1:-1]):
%o A356419         if j == '1':
%o A356419             k += 1
%o A356419             c += comb(i,k)
%o A356419     return comb(n.bit_count()+c+1,2)-c # _Chai Wah Wu_, Mar 02 2023
%Y A356419 Cf. A067576, A000120, A068076, A263017, A067587.
%K A356419 nonn,look,easy
%O A356419 1,2
%A A356419 _Jianing Song_, Aug 06 2022