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.

Showing 1-6 of 6 results.

A089398 a(n) = n-th column sum of binary digits of k*2^(k-1), where summation is over k>=1, without carrying between columns.

Original entry on oeis.org

1, 0, 2, 1, 1, 1, 3, 2, 2, 0, 3, 2, 2, 2, 4, 3, 3, 1, 2, 2, 2, 2, 4, 3, 3, 1, 4, 3, 3, 3, 5, 4, 4, 2, 3, 1, 2, 2, 4, 3, 3, 1, 4, 3, 3, 3, 5, 4, 4, 2, 3, 3, 3, 3, 5, 4, 4, 2, 5, 4, 4, 4, 6, 5, 5, 3, 4, 2, 1, 2, 4, 3, 3, 1, 4, 3, 3, 3, 5, 4, 4, 2, 3, 3, 3, 3, 5, 4, 4, 2, 5, 4, 4, 4, 6, 5, 5, 3, 4, 2, 3, 3, 5, 4, 4
Offset: 1

Views

Author

Paul D. Hanna, Oct 30 2003

Keywords

Comments

sum(k=1,n, a(k)*2^(k-1)) = 2^A089399(n)+1 for n>2, with a(1)=a(2)=1.
Row sums of triangular arrays in A103588 and in A103589. - Philippe Deléham, Apr 04 2005
a(k) = 0 for k = 2, 10, 2058, 2058 + 2^2059, ..., that is, for k = A034797(n) - 1, n>=2. - Philippe Deléham, Nov 16 2007

Examples

			Binary expansions of k*2^(k-1), with bits in ascending order by powers of 2, are:
1
001
0011
000001
0000101
00000011
000000111
00000000001
000000001001
0000000000101
00000000001101
000000000000011
0000000000001011
.................
Giving column sums:
10211132203222433...
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{lg = Floor[Log[2, n]] + 1}, Sum[ Join[ Reverse[ IntegerDigits[n - i + 1, 2]], {0}][[i]], {i, lg}]]; Table[ f[n], {n, 105}] (* Robert G. Wilson v, Mar 26 2005 *)

Formula

a(2^n)=n-1 (for n>0), a(2^n-1)=n (for n>0), a(2^n+1)=n-1 (for n>1), a(2^n-k)=n-A089400(k) (for n>k>0), a(2^n+k)=n-A089401(k) (for n>k>0), where sequences have limits: A089400={0, 2, 2, 2, 1, 4, 2, 2, 1, 3, 3, ...} and A089401={1, 1, 3, 2, 4, 5, 6, 5, 7, 8, 11, 9, ...},

A103542 Binary equivalents of A102370.

Original entry on oeis.org

0, 11, 110, 101, 100, 1111, 1010, 1001, 1000, 1011, 1110, 1101, 11100, 10111, 10010, 10001, 10000, 10011, 10110, 10101, 10100, 11111, 11010, 11001, 11000, 11011, 11110, 111101, 101100, 100111, 100010, 100001, 100000, 100011, 100110, 100101
Offset: 0

Views

Author

N. J. A. Sloane, Mar 23 2005

Keywords

Comments

The number of 1's in the n-th term appears to match A089400. - Benoit Cloitre, Mar 24 2005

Programs

  • Mathematica
    f[n_] := Block[{k = 1, s = 0, l = Max[2, Floor[Log[2, n + 1] + 2]]}, While[k < l, If[ Mod[n + k, 2^k] == 0, s = s + 2^k]; k++ ]; s]; Table[ FromDigits[ IntegerDigits[f[n] + n, 2]], {n, 0, 35}] (* Robert G. Wilson v, Mar 23 2005 *)
  • Python
    def a(n): return '0' if n<1 else bin(sum([(n + k)&(2**k) for k in range(len(bin(n)[2:]) + 1)]))[2:] # Indranil Ghosh, May 03 2017

Extensions

More terms from Robert G. Wilson v and Benoit Cloitre, Mar 23 2005

A089401 a(n) = m - A089398(2^m + n) for m>=n.

Original entry on oeis.org

1, 1, 3, 2, 4, 5, 6, 5, 7, 8, 11, 9, 11, 12, 13, 12, 14, 15, 18, 18, 19, 20, 21, 20, 22, 23, 26, 24, 26, 27, 28, 27, 29, 30, 33, 33, 36, 36, 37, 36, 38, 39, 42, 40, 42, 43, 44, 43, 45, 46, 49, 49, 50, 51, 52, 51, 53, 54, 57, 55, 57, 58, 59, 58, 60, 61, 64, 64, 67, 69, 69, 68, 70
Offset: 1

Views

Author

Paul D. Hanna, Oct 30 2003

Keywords

Comments

A089398(n) = n-th column sum of binary digits of k*2^(k-1), where summation is over all k>=1, without carrying from columns sums that may exceed 2.
Row sums of triangular arrays in A103582 and in A103583. - Philippe Deléham, Apr 04 2005

Examples

			a(6)=5 since 7 - A089398(2^7 + 6) = 7 - 2 = 5.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{lg = Floor[Log[2, n]] + 1}, Sum[ Join[ Reverse[ IntegerDigits[n - i + 1, 2]], {0}][[i]], {i, lg}]]; Table[n - f[2^n + n] + 2, {n, 0, 72}] (* Robert G. Wilson v, Mar 29 2005 *)
  • PARI
    a(n)=n/2+1/2*sum(k=1,n,(-1)^floor((n-k)/2^(k-1))) \\ Benoit Cloitre
    
  • PARI
    {a(n)=if(n<=0,0,m=floor(log(n)/log(2)); if(n-2^m<=m,n-m+a(n-2^m),2^m-1+a(n-2^m)))} \\ Paul D. Hanna, Mar 28 2005

Formula

a(n) = n/2+1/2*sum(k=1, n, (-1)^floor((n-k)/2^(k-1))). - Benoit Cloitre, Mar 28 2005
Let a(0)=0; when n - 2^[log_2(n)] <= [log_2(n)] then a(n) = a(n - 2^[log_2(n)]) + n - [log_2(n)], else a(n) = a(n - 2^[log_2(n)]) + 2^[log_2(n)] - 1. Thus a(2^m) = 2^m - m for all m>=0; for 0<=k<=m: a(2^m + k) = a(k) + 2^m + k - m; for mPaul D. Hanna, Mar 28 2005

Extensions

More terms from Benoit Cloitre and Robert G. Wilson v, Mar 28 2005

A103615 Number of zeros in A103542(n) (binary equivalent of A102370(n)).

Original entry on oeis.org

1, 0, 1, 1, 2, 0, 2, 2, 3, 1, 1, 1, 2, 1, 3, 3, 4, 2, 2, 2, 3, 0, 2, 2, 3, 1, 1, 1, 3, 2, 4, 4, 5, 3, 3, 3, 4, 1, 3, 3, 4, 2, 2, 2, 2, 1, 3, 3, 4, 2, 2, 2, 3, 0, 2, 2, 3, 1, 1, 2, 4, 3, 5, 5, 6, 4, 4, 4, 5, 2, 4, 4, 5, 3, 3, 3, 3, 2, 4, 4, 5, 3, 3, 3, 4, 1, 3, 3, 4, 2, 2, 1, 3, 2, 4, 4, 5, 3, 3, 3, 4, 1, 3, 3, 4
Offset: 0

Views

Author

Philippe Deléham, Mar 31 2005

Keywords

Examples

			The sequence has a natural decomposition into blocks (see the paper): 1; 0; 1, 1, 2; 0, 2, 2, 3, 1, 1, 1; 2, 1, 3, 3, 4, 2, 2, 2, 3, 0, 2, 2, 3, 1, 1; 1, 3, ...
		

Crossrefs

Programs

  • Maple
    A023416 := proc(n) local digs : digs := convert(n,base,2) : if nops(digs) = 0 then 1: else add(1-j,j=digs) : fi : end: ili := readline("b102370.txt") : while ili <> 0 do na := sscanf(ili,"%d %d") : na := A023416(op(2,na)) ; printf("%d, ",na) ; ili := readline("b102370.txt") : od: # R. J. Mathar, Aug 10 2007

Formula

a(n) = A023416(A102370(n)). - R. J. Mathar, Aug 10 2007

Extensions

More terms from R. J. Mathar, Aug 10 2007

A133445 Write numbers in ternary under each other (right justified), read diagonals in SW-NE direction, sum digits.

Original entry on oeis.org

0, 1, 3, 1, 2, 4, 2, 4, 3, 1, 2, 4, 2, 3, 5, 3, 5, 4, 2, 3, 5, 3, 4, 6, 5, 4, 3, 1, 2, 4, 2, 3, 5, 3, 5, 4, 2, 3, 5, 3, 4, 6, 4, 6, 5, 3, 4, 6, 4, 5, 7, 6, 5, 4, 2, 3, 5, 3, 4, 6, 4, 6, 5, 3, 4, 6, 4, 5, 7, 5, 7, 6, 4, 5, 7, 5, 6, 9, 5, 4, 3, 1, 2, 4, 2, 3, 5, 3, 5, 4, 2
Offset: 1

Views

Author

Ctibor O. Zizka, Dec 22 2007

Keywords

Comments

The digit sum of A102370 "sloping binary numbers" equals A089400. What about "sloping numbers" and their digit sums in other bases?

Examples

			Numbers written in ternary:
    0
    1
    2
   10
   11
   12
   20
   21
   22
  100
  101
  102
  .....
The NW-SE diagonals are:
  0
  1
  12
  10
  11
  22
  20
  121
  102
  ......
giving 0, 1, 3, 1, 2, 4, 2, 4, 3, 1, 2, 4, ...
		

Crossrefs

Cf. A102370.

Programs

  • PARI
    lista(nn) = {my(v = vector(nn), nb); for (n=1, nn, v[n] = digits(n-1, 3); nb = #v[n];); for (n=1, nn, if (#v[n] < nb, v[n] = concat(vector(nb-#v[n]), v[n]));); my(list = List()); for (n=nb, nn, my(s=0, pos=1); forstep(k=n, n-nb+1, -1, s += (v[k])[pos]; pos++;); listput(list, s);); Vec(list);} \\ Michel Marcus, Mar 16 2022

Extensions

New name using formula and more terms from Michel Marcus, Mar 16 2022

A363271 Vertical sum of n in base 10.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 6, 7, 8, 9, 10, 11, 12
Offset: 1

Views

Author

Simon Plouffe, May 24 2023

Keywords

Comments

The Sum_{n>=1} a(n)/10^n = 10/81, it is the vertical sum of each integer. The pattern is easy to see but apparently impossible for a program to find any closed form or recurrence. The sequence is generated by adding each integer with an offset of 1 at each step.
If you sum integers with each term divided by 10^n, at n = 9 there are 2 terms in the column 9 + 1 = 10 which is a(10).
Here is the actual sum:
.100000000000000000000
.020000000000000000000
.003000000000000000000
.000400000000000000000
.000050000000000000000
.000006000000000000000
.000000700000000000000
.000000080000000000000
.000000009000000000000
.000000001000000000000
.000000000110000000000
.000000000012000000000
.000000000001300000000
.000000000000140000000
.000000000000015000000
.000000000000001600000
.000000000000000170000
.000000000000000018000
.000000000000000001900
.000000000000000000200
.000000000000000000021
.000000000000000000002
...
By adding each column we get a(n), which explains why a(9) = 10.

Examples

			The original sequence is 1 2 3 4 5 6 7 8 9 10 11 12 ... but when we sum digit per digit (in base 10) the sequence is not a rational fraction.
		

Crossrefs

Cf. A021085 (10/81), A089400 (binary analog).

Programs

  • Maple
    p:=proc(v) local n, aa, nn, s, k, t;
        aa := v;
        nn := nops(aa);
        s := [seq(1 + aa[k]/10^k,
            k = 1 .. nops(aa))];
        [seq(sum(trunc(10*frac(10^t*s[k])),
            k = 1 .. nops(aa)),
            t = 0 .. nops(aa))]
    end;
    # enter a sequence like a(n) = [1, 2, 3, 4, ...] it will return a sequence r such that sum(r(n)/10^n) is equal to sum(a(n)/10^n).
Showing 1-6 of 6 results.