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 11-20 of 42 results. Next

A030130 Binary expansion contains a single 0.

Original entry on oeis.org

0, 2, 5, 6, 11, 13, 14, 23, 27, 29, 30, 47, 55, 59, 61, 62, 95, 111, 119, 123, 125, 126, 191, 223, 239, 247, 251, 253, 254, 383, 447, 479, 495, 503, 507, 509, 510, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1022, 1535, 1791, 1919, 1983, 2015, 2031, 2039
Offset: 1

Views

Author

Toby Donaldson (tjdonald(AT)uwaterloo.ca)

Keywords

Comments

From Reinhard Zumkeller, Aug 29 2009: (Start)
A023416(a(n)) = 1;
apart from the initial term the sequence can be seen as a triangle read by rows, see A164874;
A055010 and A086224 are subsequences, see also A000918 and A036563. (End)
Zero and numbers of form 2^m-2^k-1, 2 <= m, 0 <= k <= m-2. - Zak Seidov, Aug 06 2010

Examples

			23 is OK because it is '10111' in base 2.
		

Crossrefs

Programs

  • C
    long int element (long int i) { return (pow(2,g(i))-1-pow(2,(pow(2*g(i)-1,2)-1-8*i)/8));} long int g(long int m) {if (m==0) return(1); return ((sqrt(8*m-7)+3)/2);}
    
  • Haskell
    a030130 n = a030130_list !! (n-1)
    a030130_list = filter ((== 1) . a023416) [0..]
    -- Reinhard Zumkeller, Mar 31 2015, Dec 07 2012
    
  • Magma
    [0] cat [k:k in [0..2050]| Multiplicity(Intseq(k,2),0) eq 1]; // Marius A. Burtea, Feb 06 2020
    
  • Mathematica
    Sort[Flatten[{{0}, Table[2^n - 2^m - 1, {n, 2, 50}, {m, 0, n - 2}]}]] (* Zak Seidov, Aug 06 2010 *)
    Select[Range[0,2100],DigitCount[#,2,0]==1&] (* Harvey P. Dale, Dec 19 2021 *)
  • PARI
    print1("0, ");for(k=1,2039,my(v=digits(k,2));if(vecsum(v)==#v-1,print1(k,", "))) \\ Hugo Pfoertner, Feb 06 2020
    
  • Python
    from math import isqrt, comb
    def A030130(n): return (1<<(a:=(isqrt(n-1<<3)+1>>1)+1))-(1<Chai Wah Wu, Dec 19 2024

Formula

a(n) = 2^(g(n))-1-2^(((2*g(n)-1)^2-1-8*n)/8) with g(n)=int((sqrt(8*n-7)+3)/2) for all n>0 and g(0)=1. - Ulrich Schimke (ulrschimke(AT)aol.com)
a(n+1) = A140977(a(n)) for any n > 1. - Rémy Sigrist, Feb 06 2020
Sum_{n>=2} 1/a(n) = A160502. - Amiram Eldar, Oct 06 2020
a(n) = (A190620(n-1)-1)/2. - Chai Wah Wu, Dec 19 2024

Extensions

More terms from Erich Friedman
Offset fixed by Reinhard Zumkeller, Aug 24 2009

A052940 a(0) = 1; a(n) = 3*2^n - 1, for n > 0.

Original entry on oeis.org

1, 5, 11, 23, 47, 95, 191, 383, 767, 1535, 3071, 6143, 12287, 24575, 49151, 98303, 196607, 393215, 786431, 1572863, 3145727, 6291455, 12582911, 25165823, 50331647, 100663295, 201326591, 402653183, 805306367, 1610612735, 3221225471, 6442450943, 12884901887
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

A simple regular expression.
Numbers k > 1 such that a(k-1)^2 + a(k) is square, e.g., 5^2 + 11 = 6^2; 11^2 + 23 = 12^2. - Vincenzo Librandi, Aug 06 2010
Numerator of the sum of terms at the n-th level of the Calkin-Wilf tree. - Carl Najafi, Jul 10 2011

Crossrefs

Apart from initial terms, same as A055010 and A083329.
Subsequence of A036991.

Programs

  • GAP
    Concatenation([1], List([1..30], n-> 3*2^n -1)); # G. C. Greubel, Oct 18 2019
    
  • Magma
    [1] cat [3*2^n - 1: n in [1..30]]; // Vincenzo Librandi, Dec 01 2015
    
  • Maple
    spec:= [S,{S=Prod(Sequence(Union(Z,Z)),Union(Sequence(Z),Z,Z))},unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
    seq(`if`(n=0,1,3*2^n -1), n=0..30); # G. C. Greubel, Oct 18 2019
  • Mathematica
    Join[{1},Table[3*2^n-1,{n,30}]] (* or *) Join[{1},LinearRecurrence[{3,-2},{5,11},30]] (* Harvey P. Dale, Mar 07 2015 *)
  • PARI
    a(n)=if(n,3*2^n-1,1) \\ Charles R Greathouse IV, Oct 07 2015
    
  • PARI
    Vec((1+2*x-2*x^2)/(-1+2*x)/(-1+x) + O(x^30)) \\ Altug Alkan, Dec 01 2015
    
  • Python
    print([1] + [(3<Gennady Eremin, Aug 29 2023
  • Sage
    [1]+[3*2^n -1 for n in (1..30)] # G. C. Greubel, Oct 18 2019
    

Formula

G.f.: (1+2*x-2*x^2)/((1-x)*(1-2*x)).
a(n) = 3*a(n-1) - 2*a(n-2) for n > 2.
Binomial transform of 3 - 0^n - (-1)^n = (1, 4, 2, 4, 2, 4, 2, ...). - Paul Barry, Jun 30 2003
a(n) = A107909(A023548(n+1)) for n > 1. - Reinhard Zumkeller, May 28 2005
Row sums of triangle A134060. - Gary W. Adamson, Oct 05 2007
Equals row sums of triangle A140182. - Gary W. Adamson, May 11 2008
Equals M*Q, where M is a modified Pascal triangle (1,2) with first term "1" instead of 2; as an infinite lower triangular matrix. Q is the vector (1, 2, 2, 2, ...). - Gary W. Adamson, Nov 30 2015
From Gennady Eremin, Aug 29 2023: (Start)
a(n+1) = 2*a(n) + 1 for n > 0.
a(n) = (A000225(n+1) + A000225(n+2))/2 for n > 0. (End)

Extensions

More terms from James Sellers, Jun 08 2000
a(30)-a(32) from Vincenzo Librandi, Dec 01 2015

A118654 Square array T(n,k) read by antidiagonals: T(n,k) = 2^n*Fibonacci(k) - Fibonacci(k-2).

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 3, 2, 1, 1, 7, 4, 3, 2, 1, 15, 8, 7, 5, 3, 1, 31, 16, 15, 11, 8, 5, 1, 63, 32, 31, 23, 18, 13, 8, 1, 127, 64, 63, 47, 38, 29, 21, 13, 1, 255, 128, 127, 95, 78, 61, 47, 34, 21, 1, 511, 256, 255, 191, 158, 125, 99, 76, 55, 34
Offset: 0

Views

Author

Ross La Haye, May 17 2006

Keywords

Comments

Inverse binomial transform (by columns) of A090888.

Examples

			T(2,3) = 7 because 2^2(Fibonacci(3)) - Fibonacci(3-2) = 4*2 - 1 = 7.
{1};
{1,  0};
{1,  1,  1};
{1,  3,  2,  1};
{1,  7,  4,  3,  2};
{1, 15,  8,  7,  5,  3};
{1, 31, 16, 15, 11,  8,  5};
{1, 63, 32, 31, 23, 18, 13,  8};
		

Crossrefs

Rows: T(0,k) = A000045(k-1), for k > 0; T(1,k) = A000045(k+1); T(2,k) = A000032(k+1); T(3,k) = A022097(k); T(4,k) = A022105(k); T(5,k) = A022401(k).
Columns: T(n,1) = A000225(n); T(n,2) = A000079(n); T(n,3) = A000225(n+1); T(n,4) = A055010(n+1); T(n,5) = A051633(n); a(T,6) = A036563(n+3).

Formula

T(n,k) = 2^n*Fibonacci(k) - Fibonacci(k-2).
T(n,k) = (2^n-2)*Fibonacci(k) + Fibonacci(k+1).
T(n,0) = 1; T(n,1) = 2^n - 1; T(n,k) = T(n,k-1) + T(n,k-2), for k > 1.
T(0,k) = Fibonacci(k-1); T(1,k) = Fibonacci(k+1); T(n,k) = 3T(n-1,k) - 2T(n-2,k), for n > 1.
T(n,k) = 2T(n-1,k) + Fibonacci(k-2), for n > 0.
T(n,k) = A109754(2^n-2, k+1) = A101220(2^n-2, 0, k+1), for n > 0.
O.g.f. (by rows) = (1+(-2+2^n)x)/(1-x-x^2).
Sum_{k=0..n} T(n-k,k) = A119587(n+1). - Ross La Haye, May 31 2006

A048278 Positive numbers n such that the numbers binomial(n,k) are squarefree for all k = 0..n.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 23
Offset: 1

Views

Author

Keywords

Comments

It has been shown by Granville and Ramaré that the sequence is complete.
These are all the positive integers m that, when m is represented in binary, contain no composites represented in binary as substrings. - Leroy Quet, Oct 30 2008
This is a number-theoretic sequence, so it automatically assumes that n is positive. To quote Granville and Ramaré, "From Theorem 2 it is evident that there are only finitely many rows of Pascal's Triangle in which all of the entries are squarefree. In section 2 we show that this only occurs in rows 1, 2, 3, 5, 7, 11 and 23 (a result proved by Erdős long ago)." - N. J. A. Sloane, Mar 06 2014
See also comment in A249441. - Vladimir Shevelev, Oct 29 2014
This sequence is equivalent to: Positive integers n such that Fibonacci(n+1) divides n!. This comment depends on the finiteness of A019532. - Altug Alkan, Mar 31 2016

Examples

			n=11: C[11,k] = 1, 11, 55, 165, 330, 462, ... are all squarefree (or 1).
		

Crossrefs

Programs

  • Maple
    select(n -> andmap(t -> numtheory:-issqrfree(binomial(n,t)),[$1..floor(n/2)]),[$1..100]); # Robert Israel, Oct 29 2014
  • Mathematica
    Do[m = Prime[n]; k = 2; While[k < m/2 + .5 && Union[ Transpose[ FactorInteger[ Binomial[m, k]]] [[2]]] [[ -1]] < 2, k++ ]; If[k >= m/2 + .5, Print[ Prime[n]]], {n, 1, PrimePi[10^6]} ]
    Select[Range[10^3], Function[n, AllTrue[Binomial[n, Range@ n], SquareFreeQ]]] (* Michael De Vlieger, Apr 01 2016, Version 10 *)
  • PARI
    is(n)=for(k=0,n\2,if(!issquarefree(binomial(n,k)),return(0))); 1 \\ Charles R Greathouse IV, Mar 06 2014

Formula

Integers n>0 in set difference between union (A000225, A055010) and A249452. - Vladimir Shevelev, Oct 30 2014
a(n) = A018253(n+1) - 1. - Altug Alkan, Apr 26 2016

Extensions

Edited by Ralf Stephan, Aug 03 2004

A365808 Numbers k such that A163511(k) is a square.

Original entry on oeis.org

0, 2, 5, 8, 11, 17, 20, 23, 32, 35, 41, 44, 47, 65, 68, 71, 80, 83, 89, 92, 95, 128, 131, 137, 140, 143, 161, 164, 167, 176, 179, 185, 188, 191, 257, 260, 263, 272, 275, 281, 284, 287, 320, 323, 329, 332, 335, 353, 356, 359, 368, 371, 377, 380, 383, 512, 515, 521, 524, 527, 545, 548, 551, 560, 563, 569, 572, 575
Offset: 1

Views

Author

Antti Karttunen, Oct 01 2023

Keywords

Comments

The sequence is defined inductively as:
(a) it contains 0 and 2,
and
(b) for any nonzero term a(n), (2*a(n)) + 1 and 4*a(n) are also included as terms.
Because the inductive definition guarantees that all terms after 0 are of the form 3k+2 (A016789), and because for any n >= 0, n^2 == 0 or 1 (mod 3), (i.e., squares are in A032766), it follows that there are no squares in this sequence after the initial 0.

Crossrefs

Cf. A000290, A010052, A032766, A163511, A365807 (characteristic function).
Positions of even terms in A365805.
Sequence A243071(n^2), n >= 1, sorted into ascending order.
Subsequences: A004171, A055010, A365809 (odd terms).
Subsequence of A016789 (after the initial 0).

Programs

  • PARI
    A163511(n) = if(!n, 1, my(p=2, t=1); while(n>1, if(!(n%2), (t*=p), p=nextprime(1+p)); n >>= 1); (t*p));
    isA365808v2(n) = issquare(A163511(n));
    
  • PARI
    isA365808(n) = if(n<=2, !(n%2), if(n%2, isA365808((n-1)/2), if(n%4, 0, isA365808(n/4))));
    
  • Python
    from itertools import count, islice
    def A365808_gen(): # generator of terms
        return map(lambda n:(3*(n+1)>>2)-1,filter(lambda n:n==1 or (n&3==3 and not '00' in bin(n)),count(1)))
    A365808_list = list(islice(A365808_gen(),20)) # Chai Wah Wu, Feb 12 2025

A164874 Triangle read by rows: T(1,1)=2; T(n,k)=2*T(n-1,k)+1, 1<=k

Original entry on oeis.org

2, 5, 6, 11, 13, 14, 23, 27, 29, 30, 47, 55, 59, 61, 62, 95, 111, 119, 123, 125, 126, 191, 223, 239, 247, 251, 253, 254, 383, 447, 479, 495, 503, 507, 509, 510, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1022, 1535, 1791, 1919, 1983, 2015, 2031, 2039, 2043, 2045, 2046
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 29 2009

Keywords

Comments

All terms contain exactly 1 zero in binary representation.

Examples

			Initial rows:
   1:                             2
   2:                        5        6
   3:                  11        13        14
   4:             23        27       29        30
   5:        47        55        59        61        62
   6:    95       111       119      123       125       126
also in binary representation:
                                 10
                            101       110
                      1011      1101      1110
                 10111     11011     11101     11110
           101111    110111    111011    111101    111110
      1011111   1101111   1110111   1111011   1111101   1111110 .
		

Crossrefs

Programs

  • Haskell
    a164874 n k = a164874_tabl !! (n-1) !! (k-1)
    a164874_row n = a164874_tabl !! (n-1)
    a164874_tabl = map reverse $ iterate f [2] where
       f xs@(x:_) = (2 * x + 2) : map ((+ 1) . (* 2)) xs
    -- Reinhard Zumkeller, Mar 31 2015
    
  • Mathematica
    A164874row[n_] := 2^(n + 1) - 1 - BitShiftRight[2^n, Range[n]];
    Array[A164874row, 10] (* Paolo Xausa, Jun 13 2025 *)
  • Python
    from math import isqrt
    def A164874(n): return (1<<(a:=(isqrt(n<<3)+1>>1)+1))-(1<<(a*(a-1)>>1)-n)-1 # Chai Wah Wu, May 21 2025

Formula

T(n,k) = 2^(n+1) - 2^(n-k) - 1, 1 <= k <= n.
T(n,k) = A030130(n*(n-1)/2 + k + 1);
A023416(T(n,k)) = 1, 1<=k<=n;
A059673(n) = sum of n-th row;
T(n,1) = A055010(n);
T(n,2) = A086224(n-2) for n > 1;
T(n,n-1) = A036563(n+1) for n > 1;
T(n,n) = A000918(n+1).

A066884 Square array read by upward antidiagonals where the n-th row contains the positive integers with n binary 1's.

Original entry on oeis.org

1, 3, 2, 7, 5, 4, 15, 11, 6, 8, 31, 23, 13, 9, 16, 63, 47, 27, 14, 10, 32, 127, 95, 55, 29, 19, 12, 64, 255, 191, 111, 59, 30, 21, 17, 128, 511, 383, 223, 119, 61, 39, 22, 18, 256, 1023, 767, 447, 239, 123, 62, 43, 25, 20, 512, 2047, 1535, 895, 479, 247, 125, 79, 45, 26, 24, 1024
Offset: 1

Views

Author

Jared Benjamin Ricks (jaredricks(AT)yahoo.com), Jan 21 2002

Keywords

Comments

This is a permutation of the positive integers; the inverse permutation is A067587.

Examples

			Column: 1   2   3   4   5   6
-----------------------------
Row 1:| 1   2   4   8  16  32
Row 2:| 3   5   6   9  10  12
Row 3:| 7  11  13  14  19  21
Row 4:|15  23  27  29  30  39
Row 5:|31  47  55  59  61  62
Row 6:|63  95 111 119 123 125
		

Crossrefs

Selected rows: A000079 (1), A018900 (2), A014311 (3), A014312 (4), A014313 (5), A023688 (6), A023689 (7), A023690 (8), A023691 (9), A038461 (10), A038462 (11), A038463 (12). For decimal analogs, see A011557 and A038444-A038452.
Selected columns: A000225 (1), A055010 (2).
Selected diagonals: A036563 (main), A000918 (1st upper), A153894 (2nd upper). [Franklin T. Adams-Watters, Apr 22 2009]
Cf. A067576 (the same array read by downward antidiagonals).
Antidiagonal sums give A361074.

Programs

  • Mathematica
    a = {}; Do[ a = Append[a, Last[ Take[ Take[ Select[ Range[2^12], Count[ IntegerDigits[ #, 2], 1] == j - i + 1 & ], j], i]]], {j, 1, 11}, {i, 1, j}]; a

Extensions

Corrected and extended by Henry Bottomley, Jan 27 2002

A097743 Numbers of the form 3*2^(p - 1) - 1 where p is prime.

Original entry on oeis.org

5, 11, 47, 191, 3071, 12287, 196607, 786431, 12582911, 805306367, 3221225471, 206158430207, 3298534883327, 13194139533311, 211106232532991, 13510798882111487, 864691128455135231, 3458764513820540927
Offset: 1

Views

Author

Parthasarathy Nambi, Sep 21 2004

Keywords

Examples

			p=2, 2^(2-1) + (2^2 - 1) = 5;
p=3, 2^(3-1) + (2^3 - 1) = 11.
		

Crossrefs

Programs

  • Mathematica
    Table[3*2^(Prime[n] - 1) - 1, {n, 18}] (* Robert G. Wilson v, Sep 24 2004 *)
  • PARI
    a(n) = 3*2^(prime(n) - 1) - 1; \\ Michel Marcus, Nov 30 2017

Formula

a(n) = A001348(n) + A061286(n). - Iain Fox, Dec 08 2017

Extensions

Edited and extended by Robert G. Wilson v, Sep 24 2004

A037096 Periodic vertical binary vectors computed for powers of 3: a(n) = Sum_{k=0 .. (2^n)-1} (floor((3^k)/(2^n)) mod 2) * 2^k.

Original entry on oeis.org

1, 2, 0, 204, 30840, 3743473440, 400814250895866480, 192435610587299441243182587501623263200, 2911899996313975217187797869354128351340558818020188112521784134070351919360
Offset: 0

Views

Author

Antti Karttunen, Jan 29 1999

Keywords

Comments

This sequence can be also computed with a recurrence that does not explicitly refer to 3^n. See the C program.
Conjecture: For n >= 3, each term a(n), when considered as a GF(2)[X] polynomial, is divisible by the GF(2)[X] polynomial (x + 1) ^ A055010(n-1). If this holds, then for n >= 3, a(n) = A048720(A136386(n), A048723(3,A055010(n-1))).

Examples

			When powers of 3 are written in binary (see A004656), under each other as:
  000000000001 (1)
  000000000011 (3)
  000000001001 (9)
  000000011011 (27)
  000001010001 (81)
  000011110011 (243)
  001011011001 (729)
  100010001011 (2187)
it can be seen that the bits in the n-th column from the right can be arranged in periods of 2^n: 1, 2, 4, 8, ... This sequence is formed from those bits: 1, is binary for 1, thus a(0) = 1. 01, reversed is 10, which is binary for 2, thus a(1) = 2, 0000 is binary for 0, thus a(2)=0, 000110011, reversed is 11001100 = A007088(204), thus a(3) = 204.
		

References

  • S. Wolfram, A New Kind of Science, Wolfram Media Inc., (2002), p. 119.

Crossrefs

Cf. A036284, A037095, A037097, A136386 for related sequences.
Cf. also A004642, A265209, A265210 (for 2^n written in base 3).

Programs

  • Maple
    a(n) := sum( 'bit_n(3^i, n)*(2^i)', 'i'=0..(2^(n))-1);
    bit_n := (x, n) -> `mod`(floor(x/(2^n)), 2);

Formula

a(n) = Sum_{k=0 .. A000225(n)} (floor(A000244(k)/(2^n)) mod 2) * 2^k.
Other identities and observations:
For n >= 2, a(n) = A000215(n-1)*A037097(n) = A048720(A037097(n), A048723(3, A000079(n-1))).

Extensions

Entry revised by Antti Karttunen, Dec 29 2007
Name changed and the example corrected by Antti Karttunen, Dec 05 2015

A077802 Sum of products of parts increased by 1 in hook partitions of n, where hook partitions are of the form h*1^(n-h).

Original entry on oeis.org

1, 2, 7, 18, 41, 88, 183, 374, 757, 1524, 3059, 6130, 12273, 24560, 49135, 98286, 196589, 393196, 786411, 1572842, 3145705, 6291432, 12582887, 25165798, 50331621, 100663268, 201326563, 402653154, 805306337, 1610612704
Offset: 0

Views

Author

Alford Arnold, Dec 02 2002

Keywords

Comments

It is not clear whether a(0) should be 1 or 0; this depends on whether the empty partition is a hook partition. By strict interpretation of the definition above, it is not; and except for n=0, there are exactly n hook partitions for each n. On the other hand, if defined as "a partition in whose Ferrers diagram every point is on the first row or column", the empty partition is a hook partition. - Franklin T. Adams-Watters, Jul 11 2009

Examples

			The hook partitions of 4 are 4, 3+1, 2+1+1, 1+1+1+1; the corresponding products when parts are increased by 1 are 5, 8, 12, 16; and their sum is a(4) = 41.
		

Crossrefs

Cf. A074141, A055010 (first differences), A042950 (second differences).
Cf. A132048.
Same as A095151 except for a(0). - Franklin T. Adams-Watters, Jul 11 2009

Programs

Formula

From Vladeta Jovovic, Dec 05 2002: (Start)
a(n) = 3*2^n - n - 3, n > 0.
G.f.: x*(2-x)/(1-2*x)/(1-x)^2.
Recurrence: a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3). (End)
Row sums of triangle A132048. Equals binomial transform of [1, 1, 4, 2, 4, 2, 4, 2, 4, ...]. - Gary W. Adamson, Aug 08 2007
a(n) = A125128(n) + A000225(n), n >= 1. - Miquel Cerda, Aug 07 2016

Extensions

More terms from John W. Layman, Dec 05 2002
Previous Showing 11-20 of 42 results. Next