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.

A295087 Distinct values in A002487 in the order of appearance.

This page as a plain text file.
%I A295087 #26 May 19 2023 07:01:49
%S A295087 0,1,2,3,4,5,7,8,6,9,11,10,13,12,14,15,18,17,19,21,16,23,22,26,29,25,
%T A295087 24,27,30,34,31,20,28,33,37,32,35,41,40,47,43,44,36,39,49,46,50,55,45,
%U A295087 38,52,51,60,53,57,48,42,56,67,63,69,76,65,61,68,58,71,64
%N A295087 Distinct values in A002487 in the order of appearance.
%C A295087 This sequence is a permutation of the nonnegative integers, with inverse A295088.
%H A295087 Rémy Sigrist, <a href="/A295087/b295087.txt">Table of n, a(n) for n = 1..10000</a>
%H A295087 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%H A295087 <a href="/index/St#Stern">Index entries for sequences related to Stern's sequences</a>
%F A295087 a(n) = A002487(A091945(n)).
%e A295087 The first terms of this sequence, alongside the first terms of A002487, are:
%e A295087 n   a(n)    fusc(k) k
%e A295087 --  ----    ------- --
%e A295087 1   0       0       0
%e A295087 2   1       1       1
%e A295087 .   .       1       2
%e A295087 3   2       2       3
%e A295087 .   .       1       4
%e A295087 4   3       3       5
%e A295087 .   .       2       6
%e A295087 .   .       3       7
%e A295087 .   .       1       8
%e A295087 5   4       4       9
%e A295087 .   .       3       10
%e A295087 6   5       5       11
%e A295087 .   .       2       12
%e A295087 .   .       5       13
%e A295087 .   .       3       14
%e A295087 .   .       4       15
%e A295087 .   .       1       16
%e A295087 .   .       5       17
%e A295087 .   .       4       18
%e A295087 7   7       7       19
%e A295087 .   .       3       20
%e A295087 8   8       8       21
%e A295087 .   .       5       22
%e A295087 .   .       7       23
%o A295087 (PARI) fusc(n)=local(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); b \\ after _Charles R Greathouse IV_ at A002487
%o A295087 s=0; for (n=0, 621, v=fusc(n); if(!bittest(s,v), print1(v", "); s+=2^v))
%o A295087 (Python)
%o A295087 from functools import reduce
%o A295087 from itertools import count, islice
%o A295087 def A295087_gen(): # generator of terms
%o A295087     s = {0}
%o A295087     yield 0
%o A295087     for n in count(1):
%o A295087         if (m:=sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n)[-1:2:-1],(1,0)))) not in s:
%o A295087             yield m
%o A295087             s.add(m)
%o A295087 A295087_list = list(islice(A295087_gen(),20)) # _Chai Wah Wu_, May 18 2023
%Y A295087 Cf. A002487, A091945, A295088.
%K A295087 nonn
%O A295087 1,3
%A A295087 _Rémy Sigrist_, Nov 14 2017
%E A295087 Formula adapted after change in A091945 by _Rémy Sigrist_, Dec 07 2022