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.
%I A324287 #29 May 05 2023 12:35:11 %S A324287 0,1,2,1,3,1,3,5,4,1,4,7,5,7,7,5,5,1,5,9,7,10,11,8,7,9,9,7,13,8,3,10, %T A324287 6,1,6,11,9,13,15,11,10,13,14,11,21,13,5,17,9,11,11,9,19,12,5,18,19, %U A324287 11,3,13,7,18,15,4,7,1,7,13,11,16,19,14,13,17,19,15,29,18,7,24,13,16,17,14,30,19,8,29,31,18,5,22,12,31,26,7 %N A324287 a(n) = A002487(A005187(n)). %C A324287 The motivation for this kind of sequence was a question: what kind of simply defined non-injective functions f exist such that this sequence can be defined as their function, e.g., as a(n) = g(f(n)), where g is a nontrivial integer-valued function? The same question can also be asked about A324288, A324337 and A324338. Note that A005187, A283477 and A006068 used in their definitions are all injections. Of course, A324377(n) = A000265(A005187(n)) fills the bill as A002487(n) = A002487(A000265(n)), but are there any less obvious solutions? - _Antti Karttunen_, Feb 28 2019 %H A324287 Antti Karttunen, <a href="/A324287/b324287.txt">Table of n, a(n) for n = 0..16385</a> %H A324287 Antti Karttunen, <a href="/A324287/a324287.txt">Data supplement: n, a(n) computed for n = 0..65537</a> %H A324287 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %H A324287 <a href="/index/St#Stern">Index entries for sequences related to Stern's sequences</a> %F A324287 a(n) = A002487(A005187(n)). %F A324287 a(n) = A324286(A283477(n)). %F A324287 a(n) = A002487(A324377(n)). %o A324287 (PARI) %o A324287 A002487(n) = { my(s=sign(n), a=1, b=0); n = abs(n); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (s*b); }; \\ Modified from the one given in A002487, sign not actually needed here. %o A324287 A005187(n) = { my(s=n); while(n>>=1, s+=n); s; }; %o A324287 A324287(n) = A002487(A005187(n)); %o A324287 (Python) %o A324287 from functools import reduce %o A324287 def A324287(n): return sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin((n<<1)-n.bit_count())[-1:2:-1],(1,0))) if n else 0 # _Chai Wah Wu_, May 05 2023 %Y A324287 Cf. A000265, A002487, A005187, A006068, A283477, A324286, A324288, A324293, A324337, A324338, A324377. %K A324287 nonn %O A324287 0,3 %A A324287 _Antti Karttunen_, Feb 20 2019