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-7 of 7 results.

A144912 Unreduced numerators of digital mean, dm_num(b, n), with rows n in {2, 3, 4, ...} and columns b in {2, 3, 4, ..., n}.

Original entry on oeis.org

0, 2, -2, -1, 0, -4, 1, 2, -2, -6, 1, 0, 0, -4, -8, 3, 2, 2, -2, -6, -10, -2, 4, -2, 0, -4, -8, -12, 0, -4, 0, 2, -2, -6, -10, -14, 0, -2, 2, -4, 0, -4, -8, -12, -16, 2, 0, 4, -2, 2, -2, -6, -10, -14, -18, 0, -2, 0, 0, -6, 0, -4, -8, -12, -16, -20
Offset: 2

Views

Author

Reikku Kulon, Sep 25 2008, Oct 03 2008

Keywords

Comments

The unreduced numerator of dm(b, n) is Sum_{i=1..d} (2*d_i - (b-1)), where d is the number of digits in the base b representation of n and d_i the individual digits. The corresponding denominator is 2 * d, giving a value in (-(b - 1) / 2, (b - 1) / 2] for n > 0.
dm_num(b, n) = d(b - 1) iff all the digits in n are b - 1.
dm_num(b, n) = -2(b - 2) for b = n, because n in base n is 10, giving dm_num(n, n) = 2 - n + 1 + 0 - n + 1 = 4 - 2 * n = -2(n - 2).
dm_num(b, n) = 0 for odd b and n having all digits equal to (b - 1) / 2, as well as for many other (b, n).
Defining m = ceiling((n + 1) / 2):
dm_num(b, n) = dm_num(b - 1, n) - 4 for b in [m + 1, n].
dm_num(m, n) = 0 for even n and 2 for odd n.
dm_num(m - 1, n) = 6 - n for even n > 4 and 9 - n for odd n > 5, producing a sequence of first differences {+2, -4, +2, -4, ...}.
Triangular patterns become clearly visible for large n, defined by additive periodicities along rational slopes. Zeros along the triangle borders correspond to ones in the Redheffer matrix until odd values become dominant. The line along m is the border between the two largest triangles. This pattern is masked by aliasing effects for small bases, notably including base 10, due to the thinness of the triangles which dominate at small b. Odd values may represent "artifacts" caused by "interference".

Examples

			Triangle begins:
   0;
   2, -2;
  -1,  0, -4;
   1,  2, -2, -6;
   1,  0,  0, -4, -8;
   3,  2,  2, -2, -6, -10;
   ...
		

Crossrefs

Programs

  • Mathematica
    dmnum[b_,n_]:=2Total[IntegerDigits[n,b]]-(b-1)Floor[Log[b,n*b]]; (* after Jinyuan Wang *)
    Table[dmnum[b,n],{n,2,10},{b,2,n}] (* Paolo Xausa, Sep 26 2023 *)
  • PARI
    dm(b, n) = 2*sumdigits(n, b) - (b-1)*logint(n*b, b); \\ Jinyuan Wang, Jul 21 2020

A228086 a(n) is the least k which satisfies n = k + bitcount(k), or 0 if no such k exists. Here bitcount(k) (or wt(k), A000120) gives the number of 1's in binary representation of nonnegative integer k.

Original entry on oeis.org

0, 0, 1, 2, 0, 3, 0, 5, 6, 8, 7, 9, 10, 0, 11, 0, 13, 14, 0, 15, 18, 0, 19, 0, 21, 22, 24, 23, 25, 26, 0, 27, 0, 29, 30, 33, 31, 0, 35, 0, 37, 38, 40, 39, 41, 42, 0, 43, 0, 45, 46, 0, 47, 50, 0, 51, 0, 53, 54, 56, 55, 57, 58, 0, 59, 64, 61, 62, 66, 63, 67, 0
Offset: 0

Views

Author

Antti Karttunen, Aug 09 2013

Keywords

Comments

A083058(n)+1 gives a lower bound for nonzero terms, n-1 an upper bound.

Crossrefs

Cf. A228087, A228085, A335599. A010061 gives the positions of zeros after a(0). The union of A010061 and A228088 gives the positions where a(n) = A228087(n).
Cf. also A213723, A227643.

Programs

  • Mathematica
    a[n_] := Module[{k}, For[k = n - Floor[Log[2, n]] - 1, k < n, k++, If[n == k + DigitCount[k, 2, 1], Return[k]]]; 0];
    a /@ Range[0, 1000]; (* Jean-François Alcover, Nov 28 2020 *)
  • Scheme
    (define (A228086 n) (if (zero? n) n (let loop ((k (+ (A083058 n) 1))) (cond ((> k n) 0) ((= n (A092391 k)) k) (else (loop (+ 1 k)))))))

A228087 a(n) = largest k which satisfies n = k + bitcount(k), or 0 if no such k exists. Here bitcount(k) (A000120) gives the number of 1's in binary representation of nonnegative integer k.

Original entry on oeis.org

0, 0, 1, 2, 0, 4, 0, 5, 6, 8, 7, 9, 10, 0, 12, 0, 13, 16, 0, 17, 18, 0, 20, 0, 21, 22, 24, 23, 25, 26, 0, 28, 0, 32, 30, 33, 34, 0, 36, 0, 37, 38, 40, 39, 41, 42, 0, 44, 0, 45, 48, 0, 49, 50, 0, 52, 0, 53, 54, 56, 55, 57, 58, 0, 60, 64, 61, 65, 66, 63, 68, 0
Offset: 0

Views

Author

Antti Karttunen, Aug 09 2013

Keywords

Comments

A083058(n)+1 gives a lower bound for nonzero terms, n-1 an upper bound.

Crossrefs

Cf. A228086, A228085. A010061 gives the positions of zeros after a(0). The union of A010061 and A228088 gives the positions where a(n) = A228086(n).
Cf. also A213724, A227643.

Programs

  • Scheme
    (define (A228087 n) (let loop ((k n)) (cond ((<= k (A083058 n)) 0) ((= n (A092391 k)) k) (else (loop (- k 1))))))

A147693 Irregular triangle read by rows: T(n, k) = n mod prime(k), n >= 2, 1 <= k <= PrimePi(n), where PrimePi(n) = A000720(n).

Original entry on oeis.org

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

Views

Author

Reikku Kulon, Nov 10 2008

Keywords

Comments

Equivalently, we define table, P, with columns numbered by the primes (2, 3, 5, ...) instead of 1, 2, 3, ... so that P(n, p) = n mod p.
P begins with P(2, 2).
A complex pattern emerges if values in the triangle are taken modulo 2.
Rows are unique. Row n has length A000720(n). - Jason Kimberley, Nov 2012

Examples

			Triangle P begins:
       2 3 5 7
     +---------
   2 | 0
   3 | 1 0
   4 | 0 1
   5 | 1 2 0
   6 | 0 0 1
   7 | 1 1 2 0
   8 | 0 2 3 1
   9 | 1 0 4 2
  10 | 0 1 0 3
  ...
Each row can be produced from the previous row by adding one to each number and resetting to zero any which would equal their column number. A row number n is prime, initiating a new column numbered n, iff P(n, p) is nonzero for all prime p < n; P(n, n) is then 0.
		

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, Exercise 3.7.22 on page 125.

Crossrefs

Programs

  • Magma
    A147693 :=
    func< n | [n mod p:p in PrimesUpTo(n)] >;
    [A147693(n):n in[2..19]]; // Jason Kimberley, Nov 28 2012
  • Mathematica
    row[n_]:=Table[Mod[n,Prime[i]], {i, PrimePi[n]}]; Array[row, 20, 2]//Flatten (* Stefano Spezia, Jul 17 2025 *)

Formula

a(A046992(n-1)+i) = T(n,i) = n mod A000040(i), where 1 <= i <= A000720(n). - Jason Kimberley, Nov 21 2012

Extensions

Edited by Peter Munn, May 25 2025

A182220 Largest number k such that there exists an extensional acyclic digraph on n labeled nodes with k sources.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 58, 59, 60, 61
Offset: 1

Views

Author

Nathaniel Johnston, Apr 19 2012

Keywords

Comments

Also the length of row n of A182162.
This seems to be simply the natural numbers, with the terms in A000325 repeated.
It appears a(n+1) is the number of distinct possible heights of binary trees with n nodes. The minimum height of an n node binary tree is A000523(n), the maximum height is n-1 and all intermediate heights are possible. This conjecture is therefore equivalent to the conjectured formulas. - Yuchun Ji, Mar 22 2021
Conjecture: Partial sums of A347523, thus a(n) is the number of nonpowers of 2 <= n-1, or with offset 0: a(n) is the number of nonpowers of 2 <= n. - Omar E. Pol, Sep 30 2021

Crossrefs

Programs

  • Maple
    A001192 := proc(n) option remember: if(n=0)then return 1: fi: return add((-1)^(n-k-1)*binomial(2^k-k, n-k)*procname(k), k=0..n-1); end: A182162 := proc(n, l) local vl: vl := add((-1)^(k-l)*binomial(n, k)*binomial(k, l)*binomial(2^(n-k)-n+k, k)*k!*(n-k)!*A001192(n-k), k=l..n): return vl: end: A182220 := proc(n) local l: for l from n to 1 by -1 do if(A182162(n, l)>0)then break:fi:od: return l: end: seq(A182220(n),n=1..60);

Formula

Conjecture, for all n >= 3: a(n) = A083058(n-1) + 1 = n - 1 - A000523(n-1) = n - 1 - floor(log(2,n)). - Antti Karttunen, Aug 17 2013
Conjecture: a(1) = 0, a(n) = n - 1 - Sum_{i=1..n} sign(floor((n-1)/ 2^i)), n > 1. - Wesley Ivan Hurt, Feb 02 2014
Conjecture: a(n) = n - Sum_{k=0..n-2} A036987(k). - Paul Barry, Mar 07 2017

A147696 Triangle read by rows: numbers n and columns k such that T(n, k) is n mod k.

Original entry on oeis.org

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

Views

Author

Reikku Kulon, Nov 10 2008

Keywords

Comments

The triangle begins with (2, 2).
Each row can be produced from the previous row by adding one to each number and resetting to zero any which would equal their column number. A number p > 2 is prime iff row p contains no zeros.
A new column k begins at row n when n is a perfect square. T(n, k) is then 1, while T(n, sqrt(n) = k - 1) is 0.
Zeros correspond to ones in the Redheffer matrix. Various interesting patterns exist. For example, as noted above, T(n^2, n) = 0. Also:
T(n^2 + n, n) = T(n^2 + n, n + 1) = 0
T(n^2 + n - 2, n - 1) = 0
T(n^2 - 1, n - 1) = 0
For all k in some [0, c]:
T(n^2, 2 + k) = 0 if n is even
T(n^2, 2 + k) = 1 if n is odd
T(n^2 + n, 2 + k) = 0
Every zero is located on some parabola directed toward n = 0, having either even width and produced by an even sequence; or having an odd width and produced by an odd sequence. In either case, the relevant sequence has constant first differences 2. T(n^2, n) begins an odd parabola, while T(n^2 + n, n) begins an even parabola and parabolas of either variety extend from infinitely many other locations.

Examples

			The triangle begins:
0
1
0 1
1 2
0 0
1 1
0 2
1 0 1
0 1 2
1 2 3
0 0 0
1 1 1
0 2 2
1 0 3
0 1 0 1
1 2 1 2
0 0 2 3
1 1 3 4
0 2 0 0
1 0 1 1
0 1 2 2
1 2 3 3
0 0 0 4
		

Crossrefs

A364886 Number of n X n (-1, 1)-matrices which have only eigenvalues with strictly negative real part (which implies that the matrix has all nonzero eigenvalues).

Original entry on oeis.org

1, 2, 20, 640, 97824, 47545088
Offset: 1

Views

Author

Thomas Scheuerle, Aug 12 2023

Keywords

Comments

As this problem is symmetric with sign we can get the same numbers for strictly positive real parts.
All values for n > 1 are even, because a transposed matrix has the same spectrum of eigenvalues.
Matrices with determinant 0 are not counted.
Let M be such a matrix then the limit of ||exp(t*M)*y|| if t goes to infinity will be zero.
n = 5 is the first case where not all entries on the main diagonal are -1. 93984 matrices with 5 times -1 on the main diagonal and 5*768 with 4 times -1 on the main diagonal have only eigenvalues with strictly negative real part.
In the case n = 6, 43586048 matrices with 6 times -1 on the main diagonal, 6*656000 matrices with 5 times -1 on the main diagonal and 15*1536 matrices with 5 times -1 on the main diagonal have only eigenvalues with strictly negative real part.

Examples

			For n = 2 the matrices are:
.
    -1,  1
    -1, -1
.
    -1, -1
     1, -1.
		

Crossrefs

Showing 1-7 of 7 results.