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.

A031266 a(n)=(# 1's)-(# 2's) in first n terms of A031253.

This page as a plain text file.
%I A031266 #6 Apr 16 2024 11:48:45
%S A031266 1,1,2,2,3,2,3,3,2,3,2,2,2,2,2,1,1,1,1,2,2,2,3,3,3,4,4,3,4,4,4,5,6,7,
%T A031266 8,9,9,10,9,9,10,9,8,9,8,8,9,9,10,11,11,11,12,12,12,13,13,12,13,13,13,
%U A031266 12,12,13,12,12,12,11,12,12,11,12,11,10,11,11
%N A031266 a(n)=(# 1's)-(# 2's) in first n terms of A031253.
%t A031266 Accumulate[Which[#==1,1,#==2,-1,True,0]&/@(Table[IntegerDigits[2n-1,5],{n,60}]//Flatten)] (* _Harvey P. Dale_, Apr 16 2024 *)
%K A031266 nonn
%O A031266 1,3
%A A031266 _Clark Kimberling_