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 21-30 of 39 results. Next

A256263 Triangle read by rows: T(j,k) = 2*k-1 if k is a power of 2, otherwise, between positions that are powers of 2 we have the initial terms of A016969, with j>=0, 1<=k<=A011782(j) and T(0,1) = 0.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 5, 7, 1, 3, 5, 7, 5, 11, 17, 15, 1, 3, 5, 7, 5, 11, 17, 15, 5, 11, 17, 23, 29, 35, 41, 31, 1, 3, 5, 7, 5, 11, 17, 15, 5, 11, 17, 23, 29, 35, 41, 31, 5, 11, 17, 23, 29, 35, 41, 47, 53, 59, 65, 71, 77, 83, 89, 63, 1, 3, 5, 7, 5, 11, 17, 15, 5, 11, 17, 23, 29, 35, 41, 31, 5, 11, 17, 23, 29, 35, 41, 47, 53, 59, 65, 71, 77, 83, 89
Offset: 0

Views

Author

Omar E. Pol, Mar 30 2015

Keywords

Comments

Partial sums give A256264.
First differs from A160552 at a(27).
Appears to be a canonical sequence partially related to the cellular automata of A139250, A147562, A162795, A169707, A255366, A256250. See also A256264 and A256260.

Examples

			Written as an irregular triangle in which the row lengths are the terms of A011782, the sequence begins:
0;
1;
1,3;
1,3,5,7;
1,3,5,7,5,11,17,15;
1,3,5,7,5,11,17,15,5,11,17,23,29,35,41,31;
1,3,5,7,5,11,17,15,5,11,17,23,29,35,41,31,5,11,17,23,29,35,41,47,53,59,65,71,77,83,89,63;
...
Right border gives A000225.
Apart from the initial 0 the row sums give A000302.
Rows converge to A256258.
.
Illustration of initial terms in the fourth quadrant of the square grid:
---------------------------------------------------------------------------
n   a(n)                 Compact diagram
---------------------------------------------------------------------------
0    0     _
1    1    |_|_ _
2    1      |_| |
3    3      |_ _|_ _ _ _
4    1          |_| | | |
5    3          |_ _| | |
6    5          |_ _ _| |
7    7          |_ _ _ _|_ _ _ _ _ _ _ _
8    1                  |_| | | |_ _  | |
9    3                  |_ _| | |_  | | |
10   5                  |_ _ _| | | | | |
11   7                  |_ _ _ _| | | | |
12   5                  | | |_ _ _| | | |
13  11                  | |_ _ _ _ _| | |
14  17                  |_ _ _ _ _ _ _| |
15  15                  |_ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
16   1                                  |_| | | |_ _  | |_ _ _ _ _ _  | |
17   3                                  |_ _| | |_  | | |_ _ _ _ _  | | |
18   5                                  |_ _ _| | | | | |_ _ _ _  | | | |
19   7                                  |_ _ _ _| | | | |_ _ _  | | | | |
20   5                                  | | |_ _ _| | | |_ _  | | | | | |
21  11                                  | |_ _ _ _ _| | |_  | | | | | | |
22  17                                  |_ _ _ _ _ _ _| | | | | | | | | |
23  15                                  |_ _ _ _ _ _ _ _| | | | | | | | |
24   5                                  | | | | | | |_ _ _| | | | | | | |
25  11                                  | | | | | |_ _ _ _ _| | | | | | |
26  17                                  | | | | |_ _ _ _ _ _ _| | | | | |
27  23                                  | | | |_ _ _ _ _ _ _ _ _| | | | |
28  29                                  | | |_ _ _ _ _ _ _ _ _ _ _| | | |
29  35                                  | |_ _ _ _ _ _ _ _ _ _ _ _ _| | |
30  41                                  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _| |
31  31                                  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
.
a(n) is also the number of cells in the n-th region of the diagram.
A256264(n) gives the total number of cells after n-th stage.
		

Crossrefs

Programs

  • Mathematica
    Flatten@Join[{0}, NestList[Join[#, Range[Length[#] - 1]*6 - 1, {2 #[[-1]] + 1}] &, {1}, 6]] (* Ivan Neretin, Feb 14 2017 *)

Extensions

Terms a(95) to a(98) fixed by Ivan Neretin, Feb 14 2017

A160721 First differences of A160720.

Original entry on oeis.org

1, 4, 4, 12, 4, 12, 12, 28, 4, 12, 12, 28, 12, 28, 28, 60, 4, 12, 12, 28, 12, 28, 28, 60, 12, 28, 28, 60, 28, 60, 60, 124, 4, 12, 12, 28, 12, 28, 28, 60, 12, 28, 28, 60, 28, 60, 60, 124, 12, 28, 28, 60, 28, 60, 60, 124, 28, 60, 60, 124, 60, 124, 124, 252, 4, 12, 12, 28, 12, 28, 28
Offset: 1

Views

Author

Omar E. Pol, May 25 2009, May 29 2009

Keywords

Comments

This sequence is related to the Sierpinski triangle and to Gould's sequence A001316. - Omar E. Pol, Jul 23 2009
When written as a irregular triangle in which row lengths are A011782 it appears that right border gives A173033. - Omar E. Pol, Mar 20 2013

Examples

			From _Omar E. Pol_, Mar 20 2013 (Start):
Triangle begins:
1;
4;
4,12;
4,12,12,28;
4,12,12,28,12,28,28,60;
4,12,12,28,12,28,28,60,12,28,28,60,28,60,60,124;
4,12,12,28,12,28,28,60,12,28,28,60,28,60,60,124,12,28,28,60,28,60,60,124,28,60,60,124,60,124,124,252;
(End)
		

Crossrefs

Formula

a(1)=1. Observation: It appears that a(n) = 4*A038573(n-1), n>1. [From Omar E. Pol, Jul 23 2009]. This formula is correct! - N. J. A. Sloane, Jan 23 2016

Extensions

More terms from R. J. Mathar, Jul 14 2009

A053581 First differences of the Poly-Bernoulli numbers B_n^(k) with k=-2 (A027649).

Original entry on oeis.org

1, 3, 10, 32, 100, 308, 940, 2852, 8620, 25988, 78220, 235172, 706540, 2121668, 6369100, 19115492, 57362860, 172121348, 516429580, 1549419812, 4648521580, 13946089028, 41839315660, 125520044132
Offset: 0

Views

Author

Barry E. Williams, Jan 18 2000

Keywords

Comments

Also the second differences of A001047.
Equals sum of "terms added" to current row of the triangle version of A038573 to get the next row. a(3) = 32 sum of (3, 7, 7, 15) = terms appended to row 2 of the triangle in A038573. - Gary W. Adamson, Jun 04 2009

Crossrefs

Cf. A001045.
Cf. A038573. - Gary W. Adamson, Jun 04 2009

Programs

  • GAP
    List([0..30], n-> 4*3^(n-1) +(0^n -3*2^n)/6) # G. C. Greubel, May 16 2019
  • Magma
    [4*3^n/3+0^n/6-2^n/2: n in [0..30]]; // Vincenzo Librandi, Jul 17 2011
    
  • Mathematica
    CoefficientList[Series[(1-x)^2/((1-2x)(1-3x)),{x,0,30}],x]  (* Harvey P. Dale, Apr 22 2011 *)
  • PARI
    vector(30, n, n--; 4*3^(n-1) +(0^n -3*2^n)/6) \\ G. C. Greubel, May 16 2019
    
  • Sage
    [4*3^(n-1) +(0^n -3*2^n)/6 for n in (0..30)] # G. C. Greubel, May 16 2019
    

Formula

a(n) = 5*a(n-1) - 6*a(n-2) + C(2,2-n), n>1, with a(0)=1, a(1)=3, where C(2, 2-n)=1 for n=2 and =0 for n>2.
From Paul Barry, Jun 26 2003: (Start)
Binomial transform of A000975(n+1).
G.f.: (1-x)^2/((1-2*x)*(1-3*x)).
a(n) = 4*3^n/3 + 0^n/6 - 2^n/2. (End)
a(n) = Sum_{k=0..n+1} binomial(n+1, k) * Sum_{j=0..floor(k/2)} A001045(k-2*j). - Paul Barry, Apr 17 2005
E.g.f.: (1 - 3*exp(2*x) + 8*exp(3*x))/6. - G. C. Greubel, May 16 2019

A340666 A(n,k) is derived from n by replacing each 0 in its binary representation with a string of k 0's; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, 1, 2, 3, 0, 1, 4, 3, 1, 0, 1, 8, 3, 4, 3, 0, 1, 16, 3, 16, 5, 3, 0, 1, 32, 3, 64, 9, 6, 7, 0, 1, 64, 3, 256, 17, 12, 7, 1, 0, 1, 128, 3, 1024, 33, 24, 7, 8, 3, 0, 1, 256, 3, 4096, 65, 48, 7, 64, 9, 3, 0, 1, 512, 3, 16384, 129, 96, 7, 512, 33, 10, 7
Offset: 0

Views

Author

Alois P. Heinz, Jan 15 2021

Keywords

Examples

			Square array A(n,k) begins:
  0, 0,  0,   0,    0,     0,      0,       0,        0, ...
  1, 1,  1,   1,    1,     1,      1,       1,        1, ...
  1, 2,  4,   8,   16,    32,     64,     128,      256, ...
  3, 3,  3,   3,    3,     3,      3,       3,        3, ...
  1, 4, 16,  64,  256,  1024,   4096,   16384,    65536, ...
  3, 5,  9,  17,   33,    65,    129,     257,      513, ...
  3, 6, 12,  24,   48,    96,    192,     384,      768, ...
  7, 7,  7,   7,    7,     7,      7,       7,        7, ...
  1, 8, 64, 512, 4096, 32768, 262144, 2097152, 16777216, ...
  ...
		

Crossrefs

Columns k=0-2, 4 give: A038573, A001477, A084471, A084473.
Rows n=0..17, 19 give: A000004, A000012, A000079, A010701, A000302, A000051(k+1), A007283, A010727, A001018, A087289, A007582(k+1), A062709(k+2), A164346, A181565(k+1), A005009, A181404(k+3), A001025, A199493, A253208(k+1).
Main diagonal gives A340667.

Programs

  • Maple
    A:= (n, k)-> Bits[Join](subs(0=[0$k][], Bits[Split](n))):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
    # second Maple program:
    A:= proc(n, k) option remember; `if`(n<2, n,
         `if`(irem(n, 2, 'r')=1, A(r, k)*2+1, A(r, k)*2^k))
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    A[n_, k_] := FromDigits[IntegerDigits[n, 2] /. 0 -> Sequence @@ Table[0, {k}], 2];
    Table[A[n, d-n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, Feb 02 2021 *)

Formula

A000120(A(n,k)) = A000120(n) = log_2(A(n,0)+1).
A023416(A(n,k)) = k * A023416(n) for n >= 1.

A090971 Sierpiński's triangle, read by rows, starting from 1: T(n,k) = (T(n-1,k) + T(n-1,k-1)) mod 2.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
Offset: 1

Views

Author

Benoit Cloitre, Feb 28 2004

Keywords

Comments

Row sums give A038573.

Examples

			Triangle begins with:
  1;
  0, 1;
  1, 1, 1;
  0, 0, 0, 1;
  1, 0, 0, 1, 1;
  0, 1, 0, 1, 0, 1;
  1, 1, 1, 1, 1, 1, 1; ...
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_]:= T[n, k]= If[k<0 || k>n, 0, If[k==n, 1, Mod[T[n-1,k] + T[n-1, k-1], 2]]]; Table[T[n, k], {n,1,10}, {k,1,n}] (* G. C. Greubel, Feb 03 2019 *)
    Table[Boole[BitAnd[n, k] == k], {n, 1, 14}, {k, 1, n}] // Flatten (* Amiram Eldar, Aug 24 2024 *)
  • PARI
    T(n,k)=if(k<0 || k>n, 0, if(n==0, 1, (T(n-1,k)+T(n-1,k-1))%2))

Formula

From Philippe Deléham, Feb 29 2004: (Start)
Triangle A047999(n, k) for n,k > 0; A047999: Pascal's triangle mod 2.
a(n) = A062534(n-1) mod 2.
T(n-1, k-1) = A074909(n, n-k) mod 2. (End)
T(n, k) = 1 if bitand(n, k) = k, and 0 otherwise. - Amiram Eldar, Aug 24 2024

A159913 a(n) = 2^(A000120(n) + 1) - 1, where A000120(n) = number of nonzero bits in n.

Original entry on oeis.org

1, 3, 3, 7, 3, 7, 7, 15, 3, 7, 7, 15, 7, 15, 15, 31, 3, 7, 7, 15, 7, 15, 15, 31, 7, 15, 15, 31, 15, 31, 31, 63, 3, 7, 7, 15, 7, 15, 15, 31, 7, 15, 15, 31, 15, 31, 31, 63, 7, 15, 15, 31, 15, 31, 31, 63, 15, 31, 31, 63, 31, 63, 63, 127, 3, 7, 7, 15, 7, 15, 15, 31, 7, 15, 15, 31, 15, 31, 31
Offset: 0

Views

Author

M. F. Hasler, May 03 2009

Keywords

Comments

Essentially the same sequence as A117973 and A001316. The latter entry has much more information. - N. J. A. Sloane, Jun 05 2009
First differences of A159912; every other term of A038573.
Equals Sierpinski's gasket, A047999; as an infinite lower triangular matrix * [1,2,2,2,...] as a vector. - Gary W. Adamson, Oct 16 2009
a(n) is also the number of cells turned ON at n-th generation in the outward corner version of the Ulam-Warburton cellular automaton of A147562, and a(n) is also the number of Y-toothpicks added at n-th generation in the outward corner version of the Y-toothpick structure of A160120. - David Applegate and Omar E. Pol, Jan 24 2016

Examples

			From _Michael De Vlieger_, Jan 25 2016: (Start)
The number n converted to binary, "0" represented by "." for better visibility of 1's, totaling the 1's and calculating the sequence:
n    Binary   Total                         a(n)
0 -> .     ->     0, thus 2^(0+1)-1 =  2-1 =  1
1 -> 1     ->     1,   "  2^(1+1)-1 =  4-1 =  3
2 -> 1.    ->     1,   "  2^(1+1)-1 =  4-1 =  3
3 -> 11    ->     2,   "  2^(2+1)-1 =  8-1 =  7
4 -> 1..   ->     1,   "  2^(1+1)-1 =  4-1 =  3
5 -> 1.1   ->     2,   "  2^(2+1)-1 =  8-1 =  7
6 -> 11.   ->     2,   "  2^(2+1)-1 =  8-1 =  7
7 -> 111   ->     3,   "  2^(3+1)-1 = 16-1 = 15
8 -> 1...  ->     1,   "  2^(1+1)-1 =  4-1 =  3
9 -> 1..1  ->     2,   "  2^(2+1)-1 =  8-1 =  7
10-> 1.1.  ->     2,   "  2^(2+1)-1 =  8-1 =  7
(End)
		

Crossrefs

Rows of triangle in A038573 converge to this sequence. - N. J. A. Sloane, Jun 05 2009

Programs

  • Mathematica
    Table[2^(DigitCount[n, 2][[1]] + 1) - 1, {n, 0, 78}] (* or *)
    Table[2^(Total@ IntegerDigits[n, 2] + 1) - 1, {n, 0, 78}] (* Michael De Vlieger, Jan 25 2016 *)
  • PARI
    A159913(n)=2<
    				
  • Python
    def A159913(n): return (1<Chai Wah Wu, Nov 15 2022

Formula

a(n) = 2^A000120(2n+1) - 1 = A038573(2n+1) = 2*A038573(n) + 1 = A159912(n+1) - A159912(n).
a(n) = A160019(n,n). - Philippe Deléham, Nov 15 2011
a(n) = n - Sum_{k=0..n} (-1)^binomial(n, k). - Peter Luschny, Jan 14 2018

A331856 a(n) is the least value obtained by partitioning the binary representation of n into consecutive blocks, and then reversing those blocks.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 3, 7, 1, 3, 5, 7, 3, 7, 7, 15, 1, 3, 5, 7, 5, 11, 11, 15, 3, 7, 11, 15, 7, 15, 15, 31, 1, 3, 5, 7, 9, 11, 11, 15, 5, 11, 21, 23, 13, 23, 23, 31, 3, 7, 13, 15, 11, 23, 27, 31, 7, 15, 23, 31, 15, 31, 31, 63, 1, 3, 5, 7, 9, 11, 11, 15, 9, 19, 21
Offset: 0

Views

Author

Rémy Sigrist, Jan 29 2020

Keywords

Examples

			For n = 6:
- the binary representation of 6 is "110",
- we can split it in 4 ways:
      "110" -> "011" -> 3
      "1" and "10" -> "1" and "01" -> 5
      "11" and "0" -> "11" and "0" -> 6
      "1" and "1" and "0" -> "1" and "1" and "0" -> 6
- we have 3 distinct values, the least being 3,
- hence a(6) = 3.
		

Crossrefs

See A331855 for the number of distinct values, and A331857 for the greatest value.

Programs

  • PARI
    See Links section.

Formula

a(n)^A023416(n) = A038573(n) (where a^k denotes the k-th iterate of a).
a(n) <= n with equality iff n belongs to A000225.

A038585 Write n in binary, delete 0's.

Original entry on oeis.org

1, 1, 11, 1, 11, 11, 111, 1, 11, 11, 111, 11, 111, 111, 1111, 1, 11, 11, 111, 11, 111, 111, 1111, 11, 111, 111, 1111, 111, 1111, 1111, 11111, 1, 11, 11, 111, 11, 111, 111, 1111, 11, 111, 111, 1111, 111, 1111, 1111, 11111, 11, 111, 111, 1111, 111, 1111, 1111
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Formula

a(n) = (9 * n mod 2 + 1) * a(floor(n/2)) + n mod 2. - Reinhard Zumkeller, Oct 10 2012
a(n) = A002275(A000120(n)). - Chai Wah Wu, May 19 2020

Extensions

More terms from Erich Friedman

A225985 List the positive numbers, remove even digits (including zeros) from each term; sequence = remaining terms.

Original entry on oeis.org

1, 3, 5, 7, 9, 1, 11, 1, 13, 1, 15, 1, 17, 1, 19, 1, 3, 5, 7, 9, 3, 31, 3, 33, 3, 35, 3, 37, 3, 39, 1, 3, 5, 7, 9, 5, 51, 5, 53, 5, 55, 5, 57, 5, 59, 1, 3, 5, 7, 9, 7, 71, 7, 73, 7, 75, 7, 77, 7, 79, 1, 3, 5, 7, 9, 9, 91, 9, 93, 9, 95, 9, 97, 9, 99, 1, 11, 1, 13
Offset: 1

Views

Author

Dave Durgin, May 22 2013

Keywords

Examples

			The natural numbers with at least one odd digit in their decimal representation are: 1, 3, 5, 7, 9, 10, 11, 12, 13, ...
By excluding their even digits, we obtain: 1, 3, 5, 7, 9, 1, 11, 1, 13, ...
Hence: a(1)=1, a(2)=3, a(3)=5, a(4)=7, a(5)=9, a(6)=1, a(7)=11, a(8)=1, a(9)=13, .... [Example corrected by _Paul Tek_, May 24 2013]
		

Crossrefs

Cf. A038573.
Cf. A014261 (duplicates removed), A226091.

Programs

  • Haskell
    a225985 n = a225985_list !! (n-1)
    a225985_list = map read $ filter (not . null) $
        map (filter (`elem` "13579") . show) [0..] :: [Integer]
    -- Reinhard Zumkeller, May 26 2013
    
  • Mathematica
    FromDigits[DeleteCases[IntegerDigits[#],?EvenQ]]&/@Range[200]/. (0-> Nothing) (* _Harvey P. Dale, Apr 04 2017 *)
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        for n in count(1):
            removed  = "".join(d if d in "13579" else "" for d in str(n))
            if removed != "": yield int(removed)
    print(list(islice(agen(), 80))) # Michael S. Branicky, Aug 05 2022

Formula

a(A226091(n)) = A014261(n). - Reinhard Zumkeller, May 26 2013

Extensions

Definition clarified by N. J. A. Sloane, Aug 06 2022 at the suggestion of Michel Marcus

A115378 a(n) = number of positive integers k < n such that n XOR k = (n+k).

Original entry on oeis.org

0, 1, 0, 3, 1, 1, 0, 7, 3, 3, 1, 3, 1, 1, 0, 15, 7, 7, 3, 7, 3, 3, 1, 7, 3, 3, 1, 3, 1, 1, 0, 31, 15, 15, 7, 15, 7, 7, 3, 15, 7, 7, 3, 7, 3, 3, 1, 15, 7, 7, 3, 7, 3, 3, 1, 7, 3, 3, 1, 3, 1, 1, 0, 63, 31, 31, 15, 31, 15, 15, 7, 31, 15, 15, 7, 15, 7, 7, 3, 31, 15, 15, 7, 15, 7, 7, 3, 15, 7, 7, 3, 7, 3
Offset: 1

Views

Author

Paul D. Hanna, Jan 21 2006

Keywords

Comments

The number of positive integers k < n such that n XOR k = (n-k) is A038573(n).

Crossrefs

Programs

  • PARI
    a(n)=sum(k=1,n,if(bitxor(n,k)==(n+k),1,0))

Formula

a(n) = -1 + 2^(number of 0's in binary expansion of n). a(n) = 2^A080791(n) - 1 = A080100(n) - 1.
Previous Showing 21-30 of 39 results. Next