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.

A082850 Let S(0) = {}, S(n) = {S(n-1), S(n-1), n}; sequence gives S(infinity).

This page as a plain text file.
%I A082850 #48 Mar 04 2025 08:12:15
%S A082850 1,1,2,1,1,2,3,1,1,2,1,1,2,3,4,1,1,2,1,1,2,3,1,1,2,1,1,2,3,4,5,1,1,2,
%T A082850 1,1,2,3,1,1,2,1,1,2,3,4,1,1,2,1,1,2,3,1,1,2,1,1,2,3,4,5,6,1,1,2,1,1,
%U A082850 2,3,1,1,2,1,1,2,3,4,1,1,2,1,1,2,3,1,1,2,1,1,2,3,4,5,1,1,2,1,1,2,3,1,1,2,1
%N A082850 Let S(0) = {}, S(n) = {S(n-1), S(n-1), n}; sequence gives S(infinity).
%C A082850 Sequence counts up to successive values of A001511; i.e., apply the morphism k -> 1,2,...,k to A001511. If all 1's are removed from the sequence, the resulting sequence b has b(n) = a(n)+1. A101925 lists the positions of 1's in this sequence.
%C A082850 The geometric mean of this sequence approaches the Somos constant (A112302). - _Jwalin Bhatt_, Jan 30 2025
%H A082850 Alois P. Heinz, <a href="/A082850/b082850.txt">Table of n, a(n) for n = 1..65535</a>
%F A082850 a(2^m - 1) = m.
%F A082850 If n = 2^m - 1 + k with 0 < k < 2^m, then a(n) = a(k). - _Franklin T. Adams-Watters_, Aug 16 2006
%F A082850 a(n) = log_2(A182105(n)) + 1. - _Laurent Orseau_, Jun 18 2019
%F A082850 a(n) = 1 + A215020(n). - _Joerg Arndt_, Mar 04 2025
%e A082850 S(1) = {1}, S(2) = {1,1,2}, S(3) = {1,1,2,1,1,2,3}, etc.
%t A082850 Fold[Flatten[{#1, #1, #2}] &, {}, Range[5]] (* _Birkas Gyorgy_, Apr 13 2011 *)
%t A082850 Flatten[Table[Length@Last@Split@IntegerDigits[2 n, 2], {n, 20}] /. {n_ ->Range[n]}] (* _Birkas Gyorgy_, Apr 13 2011 *)
%o A082850 (Python)
%o A082850 S = []; [S.extend(S + [n]) for n in range(1, 8)]
%o A082850 print(S) # _Michael S. Branicky_, Jul 02 2022
%o A082850 (Python)
%o A082850 from itertools import count, islice
%o A082850 def A082850_gen(): # generator of terms
%o A082850     S = []
%o A082850     for n in count(1):
%o A082850         yield from (m:=S+[n])
%o A082850         S += m #
%o A082850 A082850_list = list(islice(A082850_gen(),20)) # _Chai Wah Wu_, Mar 06 2023
%Y A082850 Cf. A082851 (partial sums).
%Y A082850 Cf. A001511, A101925, A112302.
%Y A082850 Cf. A215020.
%K A082850 nonn,hear
%O A082850 1,3
%A A082850 _Benoit Cloitre_, Apr 14 2003