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.

Previous Showing 41-49 of 49 results.

A115218 Triangle read by rows: zeroth row is 0; to get row n >= 1, append next 2^n numbers to end of previous row.

Original entry on oeis.org

0, 0, 1, 2, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
Offset: 0

Views

Author

N. J. A. Sloane, based on a suggestion from Harrie Grondijs, Mar 04 2006

Keywords

Examples

			Triangle begins:
0
0 1 2
0 1 2 3 4 5 6
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
...
		

Crossrefs

Cf. A126646 (length of n-th row).

Programs

  • Maple
    seq($0..2^n-2, n=0..5); # Robert Israel, Jan 02 2018
  • Mathematica
    Range[0,#-1]&/@Accumulate[2^Range[0,5]]//Flatten (* Harvey P. Dale, Jan 20 2021 *)

Formula

From Robert Israel, Jan 02 2018: (Start)
G.f.: x^2/(1-x)^2 - (1-x)^(-1)*Sum_{n>=2} (2^n-1)*x^(2^(n+1)-n-2).
a(n) = k if n = 2^m - m + k - 1, 0 <= k <= 2^m-2.
G.f. as triangle: (1-y)^(-2)*Sum_{n>=1} x^n*(y + (1-2^n)*y^(2^n-1)+(2^n-2)*y^(2^n)). (End)

A258800 The number of zeroless decimal numbers whose digital sum is n.

Original entry on oeis.org

0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 511, 1021, 2040, 4076, 8144, 16272, 32512, 64960, 129792, 259328, 518145, 1035269, 2068498, 4132920, 8257696, 16499120, 32965728, 65866496, 131603200, 262947072, 525375999, 1049716729, 2097364960, 4190597000, 8372936304, 16729373488, 33425781248
Offset: 0

Views

Author

Robert G. Wilson v, Jun 10 2015

Keywords

Comments

If you were to include decimal numbers that contain any number of zeros, then a(n) would be infinity. If on the other hand, you limit the number of zeros to some number, then a(n) is finite.

Examples

			a(0) = 0 since there exists no decimal number lacking a zero whose digital sum is zero.
a(1) = 1 since there exists only one zeroless decimal number whose digital sum is one and that number is 1.
a(2) = 2 since there exist only two zeroless decimal numbers whose digital sum is two and they are 2 & 11.
a(3) = 4 since there exist only four zeroless decimal numbers whose digital sum is three and they are 3, 21, 12 & 111.
a(4) = 8 since there exist only eight zeroless decimal numbers whose digital sum is four and they are 4, 31, 13, 22, 211, 121, 112 & 1111.
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[ Series[-1 + 1/(1 - x (1 + x + x^2) (1 + x^3 + x^6)), {x, 0, 36}], x]

Formula

a(n) = A104144(n+8) for n>0.
G.f.: -(x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9)/(-1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9) = -1 + 1/(1-x(1 + x + x^2)(1 + x^3 + x^6)).

A290844 Square array read by antidiagonals downwards: A(n, k) = (Sum_{i=1..n} i^k) - (n+1)^k for n >= 1, k >= 1.

Original entry on oeis.org

-1, -3, 0, -7, -4, 2, -15, -18, -2, 5, -31, -64, -28, 5, 9, -63, -210, -158, -25, 19, 14, -127, -664, -748, -271, 9, 42, 20, -255, -2058, -3302, -1825, -317, 98, 76, 27, -511, -6304, -14068, -10735, -3351, -126, 272, 123, 35, -1023, -19170, -58718, -59425, -26141, -4606, 580, 567, 185, 44
Offset: 1

Views

Author

Felix Fröhlich, Aug 12 2017

Keywords

Comments

Paul Erdős conjectured that A(n, k) = 0 only for (n, k) = (2, 1).

Examples

			Array starts
  -1,  -3,   -7,   -15,   -31,    -63,     -127,      -255
   0,  -4,  -18,   -64,  -210,   -664,    -2058,     -6304
   2,  -2,  -28,  -158,  -748,  -3302,   -14068,    -58718
   5,   5,  -25,  -271, -1825, -10735,   -59425,   -318271
   9,  19,    9,  -317, -3351, -26141,  -183111,  -1216637
  14,  42,   98,  -126, -4606, -50478,  -446782,  -3622206
  20,  76,  272,   580, -3760, -77324,  -896848,  -8869820
  27, 123,  567,  2211,  2727, -84477, -1485513, -18362109
  35, 185, 1025,  5333, 20825, -21595, -1919575, -32268667
  44, 264, 1694, 10692, 59774, 206844, -1406746, -46627548
		

Crossrefs

Cf. A000096 (column 1), A126646 (row 1), A191686 (main diagonal).

Programs

  • PARI
    x(n, k) = sum(i=1, n, i^k)
    y(n, k) = (n+1)^k
    a(n, k) = x(n, k) - y(n, k)
    array(rows, cols) = for(s=1, rows, for(t=1, cols, print1(a(s, t), ", ")); print(""))
    array(10, 8) \\ print initial 10 rows and 8 columns of array

A299074 Expansion of 1/((1-x)*(1-2*x)*(1-6*x)*(1-24*x)).

Original entry on oeis.org

1, 33, 853, 20853, 502789, 12080901, 290025541, 6961116741, 167069824837, 4009693935429, 96232763288389, 2309586971953989, 55430091245099845, 1330322213391637317, 31927733262454774597, 766265599145247529797, 18390374384563938483013, 441368985260002510461765
Offset: 0

Views

Author

Seiichi Manyama, Feb 02 2018

Keywords

Crossrefs

Programs

  • PARI
    N=66; x='x+O('x^N); Vec(1/prod(k=1, 4, (1-k!*x)))
    
  • PARI
    Vec(1/((1 - x)*(1 - 2*x)*(1 - 6*x)*(1 - 24*x)) + O(x^20)) \\ Colin Barker, Feb 02 2018

Formula

O.g.f.: 1/((1 - x)*(1 - 2*x)(1 - 6*x)*(1 - 24*x)).
From Colin Barker, Feb 02 2018: (Start)
a(n) = (-11 + 115*2^n - 759*6^n + 1920*24^n) / 1265.
a(n) = 33*a(n-1) - 236*a(n-2) + 492*a(n-3) - 288*a(n-4) for n>3. (End)

A323608 The position function the fractalization of which yields A323607.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 5, 4, 6, 5, 8, 6, 9, 7, 12, 8, 12, 9, 15, 10, 15, 11, 19, 12, 18, 13, 22, 14, 21, 15, 27, 16, 24, 17, 29, 18, 27, 19, 34, 20, 30, 21, 36, 22, 33, 23, 42, 24, 36, 25, 43, 26, 39, 27, 49, 28, 42, 29, 50, 30, 45, 31, 58, 32, 48, 33, 57, 34, 51, 35, 64, 36, 54, 37, 64, 38, 57, 39, 73
Offset: 1

Views

Author

Luc Rousseau, Jan 19 2019

Keywords

Comments

For a definition of the fractalization process, see comments in A194959. The sequence A323607, triangular array where row n is the list of the numbers from 1 to n sorted in Sharkovsky order, is clearly the result of a fractalization. Let {a(n)} (this sequence) be its position function.

Examples

			In A323607 in triangular form,
- row 5 is:  3  5  4  2  1
- row 6 is:  3  5  6  4  2  1
Row 6 is row 5 in which 6 has been inserted in position 3, so a(6) = 3.
		

Crossrefs

Cf. A194959 (introducing fractalization).
Cf. A323607 (fractalization of this sequence).
Cf. A000325.

Programs

  • Mathematica
    lt[x_, y_] := Module[
      {c, d, xx, yy, u, v},
      {c, d} = IntegerExponent[#, 2] & /@ {x, y};
      xx = x/2^c;
      yy = y/2^d;
      u = If[xx == 1, \[Infinity], c];
      v = If[yy == 1, \[Infinity], d];
      If[u != v, u < v, If[u == \[Infinity], c > d, xx < yy]]]
    row[n_] := Sort[Range[n], lt]
    a[n_] := First[FirstPosition[row[n], n]]
    Table[a[n], {n, 1, 80}]

Formula

Empirical observations: (Start)
For all odd numbers x >= 3,
a(x) = (1/2)*x - 1/2,
a(2x) = (3/4)*(2x) - 3/2,
a(4x) = (7/8)*(4x) - 5/2,
a(8x) = (15/16)*(8x) - 7/2,
etc.
For all c, a(2^c) = A000325(c) = 2^c-c.
Summarized by:
a((2^c)*(2k+1)) = A126646(c)*k + A000295(c) + A000007(k) = (2^(c+1)-1)*k + (2^c-1-c) + [k==0].
(End)
From Luc Rousseau, Apr 01 2019: (Start)
It appears that for all k > 0,
a(4k + 0) = 3k - 2 + a(k),
a(4k + 1) = 2k,
a(4k + 2) = 3k,
a(4k + 3) = 2k + 1.
(End)

A361198 Consider a perfect infinite binary tree with nodes labeled with distinct positive integers where n appears at level A082850(n) and each level is filled from left to right; a(n) is the sibling of n in this tree.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 04 2023

Keywords

Comments

This sequence is a self-inverse permutation of the positive integers with no fixed point.
We can build a similar tree from any sequence of positive integers where each value appears infinitely many times. The choice of A082850 is interesting as each parent node appears immediately after its second child; also, for each pair of nodes of the same level, say p and p', and each pair of nodes, c and c', where c has ancestor p and c' has ancestor p', and the relative position of p with respect to c is the same as for p' with respect to c', we have p - c = p' - c'.
Empirically: to compute a(n): replace the least significant nonzero digit in the skew-binary expansion of n, say d, by 3-d. - Rémy Sigrist, Mar 02 2025

Examples

			The perfect infinite binary tree starts as follows:
                                 31
                  ---------------------------------
                 15                              30
          -----------------               -----------------
          7              14              22              29
      ---------       ---------       ---------       ---------
      3       6      10      13      18      21      25      28
    -----   -----   -----   -----   -----   -----   -----   -----
    1   2   4   5   8   9  11  12  16  17  19  20  23  24  26  27
.
So a(1) = 2 and a(2) = 1, a(4) = 5 and a(5) = 4, etc.,
   a(3) = 6 and a(6) = 3, a(10) = 13 and a(13) = 10, etc.,
   a(7) = 14 and a(14) = 7, a(22) = 29 and a(29) = 22,
   a(15) = 30 and a(30) = 15.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (n0 = n); for (h = 2, oo, if (n < 2^h-1, while (1, my (w=2^h-- - 1); if (n == w, return (n0 - n + 2*w), n == 2*w, return (n0 - n + w), n > w, n -= w)))) }

Formula

a(A101925(2*n)) = A101925(2*n + 1).
a(A101925(2*n + 1)) = A101925(2*n).
A082850(a(n)) = A082850(n).
a(2^k - 1) = 2^(k+1) - 2 for any k > 0.
abs(a(n) - n) = 2^A082850(n) - 1 (belongs to A126646).
Apparently, a(n) < n iff A308187(n+1) = 1.

A363242 Numbers whose primorial-base representation contains only odd digits.

Original entry on oeis.org

1, 3, 9, 21, 39, 51, 99, 111, 159, 171, 249, 261, 309, 321, 369, 381, 669, 681, 729, 741, 789, 801, 1089, 1101, 1149, 1161, 1209, 1221, 1509, 1521, 1569, 1581, 1629, 1641, 1929, 1941, 1989, 2001, 2049, 2061, 2559, 2571, 2619, 2631, 2679, 2691, 2979, 2991, 3039
Offset: 1

Views

Author

Amiram Eldar, May 23 2023

Keywords

Comments

All the terms above 1 are odd multiples of 3.
The partial sums of the primorials (A143293) are terms, since the primorial-base representation of A143293(n) is n+1 1's.

Examples

			3 is a term since its primorial-base presentation, 11, has only odd digits.
21 is a term since its primorial-base presentation, 311, has only odd digits.
		

Crossrefs

Subsequence: A143293.
Similar sequences: A003462 \ {0} (ternary), A014261 (decimal), A032911 (base 4), A032912 (base 5), A033032 (base 6), A033033 (base 7), A033034 (base 8), A033035 (base 9), A033036 (base 11), A033037 (base 12), A033038 (base 13), A033039 (base 14), A033040 (base 15), A033041 (base 16), A126646 (binary), A351894 (factorial base).

Programs

  • Mathematica
    With[{max = 5}, bases = Prime@ Range[max, 1, -1]; nmax = Times @@ bases - 1; prmBaseDigits[n_] := IntegerDigits[n, MixedRadix[bases]]; Select[Range[1, nmax, 2], AllTrue[prmBaseDigits[#], OddQ] &]]
  • PARI
    is(n) = {my(p = 2); if(n < 1, return(0)); while(n > 0, if((n%p)%2 == 0, return(0)); n \= p; p = nextprime(p+1)); return(1);}

A382629 Triangle T(n,k), n >= 0, 0 <= k <= n, read by rows, where T(n,k) = (n-k)*T(n-1,k-1) + 2*(k+1)*T(n-1,k) + A102365(n,k) with T(n,k) = 0 if k < 0 or k > n.

Original entry on oeis.org

1, 3, 0, 7, 4, 0, 15, 35, 5, 0, 31, 203, 115, 6, 0, 63, 994, 1428, 315, 7, 0, 127, 4470, 13421, 7450, 783, 8, 0, 255, 19185, 108156, 121314, 32865, 1839, 9, 0, 511, 80161, 793704, 1593902, 870191, 130665, 4171, 10, 0, 1023, 329648, 5483093, 18269658, 17591035, 5383906, 485166, 9251, 11, 0
Offset: 0

Views

Author

Seiichi Manyama, Apr 01 2025

Keywords

Examples

			Triangle begins:
    1;
    3,     0;
    7,     4,      0;
   15,    35,      5,       0;
   31,   203,    115,       6,      0;
   63,   994,   1428,     315,      7,      0;
  127,  4470,  13421,    7450,    783,      8,    0;
  255, 19185, 108156,  121314,  32865,   1839,    9,  0;
  511, 80161, 793704, 1593902, 870191, 130665, 4171, 10, 0;
  ...
		

Crossrefs

Row sums give A180875.
Column k=0 gives A126646.

Programs

  • PARI
    a102365(n, k) = if(k==0, 1, if(nn, 0, (n-k)*T(n-1, k-1)+2*(k+1)*T(n-1, k)+a102365(n, k));

Formula

(2/3)^n * Sum_{k=0..n} T(n,k)/2^k = A098830(n).

A338971 Linear representation of the complete labeled binary trees of all integer heights, where the nodes at level i, 0 <= i <= n, of a binary tree with height n are labeled with the number n-i.

Original entry on oeis.org

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

Views

Author

Marc van Dongen, Dec 18 2020

Keywords

Examples

			First few terms where each line represents a complete binary tree:
  n=0:  0
  n=1:  1 0 0
  n=2:  2 1 1 0 0 0 0
  n=3:  3 2 2 1 1 1 1 0 0 0 0 0 0 0 0
  n=4:  4 3 3 ...
Using this representation, the first row r(0) is given by [0]; row(n+1) is given by adding 1 to each member of r(n) and appending 2^(n+1) 0's: r(0) = [0], r(n+1) = [ i + 1 | i <- r(n) ] ++ [ 0 | i <- [1..2^(n+1)] ].
		

Crossrefs

Cf. A290255, A126646 (row lengths).

Programs

  • Haskell
    concat [ tree n | n <- [0..] ]
      where tree 0 = [0]
            tree n = [ i+1 | i <- tree (n-1) ] ++ [ 0 | i <- [1..2^n] ]
Previous Showing 41-49 of 49 results.