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!)
A371032 a(n) is the integer whose decimal digits are 0's or 1's in alternating runs of lengths n, n-1, n-2, ..., 3, 2, 1. 3

%I #37 Jul 09 2024 16:20:29

%S 1,110,111001,1111000110,111110000111001,111111000001111000110,

%T 1111111000000111110000111001,111111110000000111111000001111000110,

%U 111111111000000001111111000000111110000111001,1111111111000000000111111110000000111111000001111000110

%N a(n) is the integer whose decimal digits are 0's or 1's in alternating runs of lengths n, n-1, n-2, ..., 3, 2, 1.

%F a(n) = A007088(A371033(n)). - _Michel Marcus_, Jul 09 2024

%F a(n) = (10^(n*(n+1)/2) - 1)/9 - a(n-1). - _Robert Israel_, Jul 09 2024

%e a(1) = 1 has runlength 1; a(2) = 110 has runlengths 2,1; a(3) = 111001 has runlengths 3,2,1.

%p f:= proc(n) option remember; (10^(n*(n+1)/2)-1)/9 - procname(n-1) end proc:

%p f(1):= 1:

%p map(f, [$1..30]); # _Robert Israel_, Jul 09 2024

%t Flatten[Table[Flatten[Map[ConstantArray[Mod[#, 2], n + 1 - #] &, Range[n]]], {n, 10}]] (* _Peter J. C. Moses_, Mar 08 2024 *)

%o (Python)

%o def A371032(n):

%o c = 0

%o for i in range(n):

%o c = (m:=10**(n-i))*c

%o if i&1^1:

%o c += (m-1)//9

%o return c # _Chai Wah Wu_, Mar 18 2024

%Y Cf. A000217 (binary lengths), A007088, A065447, A371033 (decimal version).

%K nonn,base,easy

%O 1,2

%A _Clark Kimberling_, Mar 09 2024

%E New name from _Michel Marcus_, Jul 09 2024

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 September 3 12:40 EDT 2024. Contains 375670 sequences. (Running on oeis4.)