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

A000069 Odious numbers: numbers with an odd number of 1's in their binary expansion.

Original entry on oeis.org

1, 2, 4, 7, 8, 11, 13, 14, 16, 19, 21, 22, 25, 26, 28, 31, 32, 35, 37, 38, 41, 42, 44, 47, 49, 50, 52, 55, 56, 59, 61, 62, 64, 67, 69, 70, 73, 74, 76, 79, 81, 82, 84, 87, 88, 91, 93, 94, 97, 98, 100, 103, 104, 107, 109, 110, 112, 115, 117, 118, 121, 122, 124, 127, 128
Offset: 1

Views

Author

Keywords

Comments

This sequence and A001969 give the unique solution to the problem of splitting the nonnegative integers into two classes in such a way that sums of pairs of distinct elements from either class occur with the same multiplicities [Lambek and Moser]. Cf. A000028, A000379.
In French: les nombres impies.
Has asymptotic density 1/2, since exactly 2 of the 4 numbers 4k, 4k+1, 4k+2, 4k+3 have an even sum of bits, while the other 2 have an odd sum. - Jeffrey Shallit, Jun 04 2002
Nim-values for game of mock turtles played with n coins.
A115384(n) = number of odious numbers <= n; A000120(a(n)) = A132680(n). - Reinhard Zumkeller, Aug 26 2007
Indices of 1's in the Thue-Morse sequence A010060. - Tanya Khovanova, Dec 29 2008
For any positive integer m, the partition of the set of the first 2^m positive integers into evil ones E and odious ones O is a fair division for any polynomial sequence p(k) of degree less than m, that is, Sum_{k in E} p(k) = Sum_{k in O} p(k) holds for any polynomial p with deg(p) < m. - Pietro Majer, Mar 15 2009
For n>1 let b(n) = a(n-1). Then b(b(n)) = 2b(n). - Benoit Cloitre, Oct 07 2010
Lexicographically earliest sequence of distinct nonnegative integers with no term being the binary exclusive OR of any terms. The equivalent sequence for addition or for subtraction is A005408 (the odd numbers) and for multiplication is A026424. - Peter Munn, Jan 14 2018
Numbers of the form m XOR (2*m+1) for some m >= 0. - Rémy Sigrist, Apr 14 2022

Examples

			For k=2, x=0 and x=0.2 we respectively have 1^2 + 2^2 + 4^2 + 7^2 = 0^2 + 3^2 + 5^2 + 6^2 = 70;
(1.2)^2 + (2.2)^2 + (4.2)^2 + (7.2)^2 = (0.2)^2 + (3.2)^2 + (5.2)^2 + (6.2)^2 = 75.76;
for k=3, x=1.8, we have (2.8)^3 + (3.8)^3 + (5.8)^3 + (8.8)^3 + (9.8)^3 + (12.8)^3 + (14.8)^3 + (15.8)^3 = (1.8)^3 + (4.8)^3 + (6.8)^3 + (7.8)^3 + (10.8)^3 + (11.8)^3 + (13.8)^3 + (16.8)^3 = 11177.856. - _Vladimir Shevelev_, Jan 16 2012
		

References

  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982, see p. 433.
  • J. Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 22.
  • Vladimir S. Shevelev, On some identities connected with the partition of the positive integers with respect to the Morse sequence, Izv. Vuzov of the North-Caucasus region, Nature sciences 4 (1997), 21-23 (in Russian).
  • N. J. A. Sloane, A handbook of Integer Sequences, Academic Press, 1973 (including this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

The basic sequences concerning the binary expansion of n are A000120, A000788, A000069, A001969, A023416, A059015.
Complement of A001969 (the evil numbers). Cf. A133009.
a(n) = 2*n + 1 - A010060(n) = A001969(n) + (-1)^A010060(n).
First differences give A007413.
Note that A000079, A083420, A002042, A002089, A132679 are subsequences.
See A027697 for primes, also A230095.
Cf. A005408 (odd numbers), A006068, A026424.

Programs

  • Haskell
    a000069 n = a000069_list !! (n-1)
    a000069_list = [x | x <- [0..], odd $ a000120 x]
    -- Reinhard Zumkeller, Feb 01 2012
    
  • Magma
    [ n: n in [1..130] | IsOdd(&+Intseq(n, 2)) ]; // Klaus Brockhaus, Oct 07 2010
    
  • Maple
    s := proc(n) local i,j,k,b,sum,ans; ans := [ ]; j := 0; for i while jA000069 := n->t1[n]; # s(k) gives first k terms.
    is_A000069 := n -> type(add(i,i=convert(n,base,2)),odd):
    seq(`if`(is_A000069(i),i,NULL),i=0..40); # Peter Luschny, Feb 03 2011
  • Mathematica
    Select[Range[300], OddQ[DigitCount[ #, 2][[1]]] &] (* Stefan Steinerberger, Mar 31 2006 *)
    a[ n_] := If[ n < 1, 0, 2 n - 1 - Mod[ Total @ IntegerDigits[ n - 1, 2], 2]]; (* Michael Somos, Jun 01 2013 *)
  • PARI
    {a(n) = if( n<1, 0, 2*n - 1 - subst( Pol(binary( n-1)), x, 1) % 2)}; /* Michael Somos, Jun 01 2013 */
    
  • PARI
    {a(n) = if( n<2, n==1, if( n%2, a((n+1)/2) + n-1, -a(n/2) + 3*(n-1)))}; /* Michael Somos, Jun 01 2013 */
    
  • PARI
    a(n)=2*n-1-hammingweight(n-1)%2 \\ Charles R Greathouse IV, Mar 22 2013
    
  • Python
    [n for n in range(1, 201) if bin(n)[2:].count("1") % 2] # Indranil Ghosh, May 03 2017
    
  • Python
    def A000069(n): return ((m:=n-1)<<1)+(m.bit_count()&1^1) # Chai Wah Wu, Mar 03 2023

Formula

G.f.: 1 + Sum_{k>=0} (t*(2+2t+5t^2-t^4)/(1-t^2)^2) * Product_{j=0..k-1} (1-x^(2^j)), t=x^2^k. - Ralf Stephan, Mar 25 2004
a(n+1) = (1/2) * (4*n + 1 + (-1)^A000120(n)). - Ralf Stephan, Sep 14 2003
Numbers n such that A010060(n) = 1. - Benoit Cloitre, Nov 15 2003
a(2*n+1) + a(2*n) = A017101(n) = 8*n+3. a(2*n+1) - a(2*n) gives the Thue-Morse sequence (1, 3 version): 1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, ... A001969(n) + A000069(n) = A016813(n) = 4*n+1. - Philippe Deléham, Feb 04 2004
(-1)^a(n) = 2*A010060(n)-1. - Benoit Cloitre, Mar 08 2004
a(1) = 1; for n > 1: a(2*n) = 6*n-3 -a(n), a(2*n+1) = a(n+1) + 2*n. - Corrected by Vladimir Shevelev, Sep 25 2011
For k >= 1 and for every real (or complex) x, we have Sum_{i=1..2^k} (a(i)+x)^s = Sum_{i=1..2^k} (A001969(i)+x)^s, s=0..k.
For x=0, s <= k-1, this is known as Prouhet theorem (see J.-P. Allouche and Jeffrey Shallit, The Ubiquitous Prouhet-Thue-Morse Sequence). - Vladimir Shevelev, Jan 16 2012
a(n+1) mod 2 = 1 - A010060(n) = A010059(n). - Robert G. Wilson v, Jan 18 2012
A005590(a(n)) > 0. - Reinhard Zumkeller, Apr 11 2012
A106400(a(n)) = -1. - Reinhard Zumkeller, Apr 29 2012
a(n+1) = A006068(n) XOR (2*A006068(n) + 1). - Rémy Sigrist, Apr 14 2022

A206692 T(n,k)=Number of nXk 0..3 arrays with no element equal to another within two positions in the same row or column, and new values 0..3 introduced in row major order.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 2, 11, 11, 2, 4, 36, 44, 36, 4, 8, 116, 176, 176, 116, 8, 16, 376, 704, 916, 704, 376, 16, 32, 1216, 2816, 4704, 4704, 2816, 1216, 32, 64, 3936, 11264, 24492, 31504, 24492, 11264, 3936, 64, 128, 12736, 45056, 127008, 213788, 213788, 127008
Offset: 1

Views

Author

R. H. Hardin Feb 11 2012

Keywords

Comments

Table starts
..1....1.....1......2.......4.........8.........16..........32...........64
..1....4....11.....36.....116.......376.......1216........3936........12736
..1...11....44....176.....704......2816......11264.......45056.......180224
..2...36...176....916....4704.....24492.....127008......660888......3436488
..4..116...704...4704...31504....213788....1454810.....9933294.....67923354
..8..376..2816..24492..213788...1915580...17277556...156946368...1429962032
.16.1216.11264.127008.1454810..17277556..208563912..2543024548..31198656992
.32.3936.45056.660888.9933294.156946368.2543024548.41832855136.694325337444

Examples

			Some solutions for n=4 k=3
..0..1..2....0..1..2....0..1..2....0..1..2....0..1..2....0..1..2....0..1..2
..2..3..0....3..0..1....1..2..3....1..2..3....3..2..1....1..2..3....1..3..0
..1..2..3....1..2..3....2..0..1....2..3..1....2..0..3....2..3..0....2..0..1
..3..0..1....0..3..2....3..1..2....0..1..2....0..1..2....0..1..2....3..1..2
		

Crossrefs

Column 3 is A002089(n-2)

A053661 For n > 1: if n is present, 2n is not.

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 9, 11, 12, 13, 15, 17, 19, 20, 21, 23, 25, 27, 28, 29, 31, 32, 33, 35, 36, 37, 39, 41, 43, 44, 45, 47, 48, 49, 51, 52, 53, 55, 57, 59, 60, 61, 63, 65, 67, 68, 69, 71, 73, 75, 76, 77, 79, 80, 81, 83, 84, 85, 87, 89, 91, 92, 93, 95, 97, 99, 100, 101, 103, 105
Offset: 1

Views

Author

Jeevan Chana Rai (Karanjit.Rai(AT)btinternet.com), Feb 16 2000

Keywords

Comments

The Name line gives a property of the sequence, not a definition. The sequence can be defined simultaneously with b(n) := A171945(n) via a(n) = mex{a(i), b(i) : 0 <= i < n} (n >= 0}, b(n)=2a(n). The two sequences are complementary, hence A053661 is identical to A171944 (except for the first terms). Furthmore, A053661 is the same as A003159 except for the replacement of vile by dopey powers of 2. - Aviezri S. Fraenkel, Apr 28 2011
For n >= 2, either n = 2^k where k is odd or n = 2^k*m where m > 1 is odd and k is even (found by Kirk Bresniker and Stan Wagon). [Robert Israel, Oct 10 2010]
Subsequence of A175880; A000040, A001749, A002001, A002042, A002063, A002089, A003947, A004171 and A081294 are subsequences.

Crossrefs

Essentially identical to A171944 and the complement of A171945.

Programs

  • Haskell
    a053661 n = a053661_list !! (n-1)
    a053661_list = filter (> 0) a175880_list -- Reinhard Zumkeller, Feb 09 2011
  • Maple
    N:= 1000: # to get all terms <= N
    sort([1,seq(2^(2*i+1),i=0..(ilog2(N)-1)/2), seq(seq(2^(2*i)*(2*j+1),j=1..(N/2^(2*i)-1)/2),i=0..ilog2(N)/2)]); # Robert Israel, Jul 24 2015
  • Mathematica
    Clear[T]; nn = 105; T[n_, k_] := T[n, k] = If[n < 1 || k < 1, 0, If[n == 1 || k == 1, 1, If[k > n, T[k, n], If[n > k, T[k, Mod[n, k, 1]], -Product[T[n, i], {i, n - 1}]]]]]; DeleteCases[Table[If[T[n, n] == -1, n, ""], {n, 1, nn}], ""] (* Mats Granvik, Aug 25 2012 *)

Extensions

More terms from James Sellers, Feb 22 2000

A132679 Starting with a(1)=1 and a(2)=2: if m is a term then also 4*m and 4*m+3.

Original entry on oeis.org

1, 2, 4, 7, 8, 11, 16, 19, 28, 31, 32, 35, 44, 47, 64, 67, 76, 79, 112, 115, 124, 127, 128, 131, 140, 143, 176, 179, 188, 191, 256, 259, 268, 271, 304, 307, 316, 319, 448, 451, 460, 463, 496, 499, 508, 511, 512, 515, 524, 527, 560, 563, 572, 575, 704, 707, 716
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 26 2007

Keywords

Comments

Subsequence of A000069; A010060(a(n))=1; A000120(a(n)) mod 2 = 1;
A000079, A083420, A002042, A002089 are subsequences.

Crossrefs

Cf. A179888. [From Reinhard Zumkeller, Jul 31 2010]

Programs

  • Haskell
    import Data.Set (fromList, insert, deleteFindMin)
    a132679 n = a132679_list !! (n-1)
    a132679_list = f $ fromList [1,2] where
       f s = m : f (insert (4*m) $ insert (4*m+3) s') where
           (m,s') = deleteFindMin s
    -- Reinhard Zumkeller, Oct 29 2011
  • Mathematica
    Union[Nest[Flatten[{#,4#,4#+3}]&,{1,2},4]] (* Harvey P. Dale, Aug 02 2013 *)

A347839 An array of the positive integers congruent to 2 modulo 3 (A016789), read by antidiagonals upwards, giving the present triangle.

Original entry on oeis.org

2, 5, 8, 11, 20, 32, 14, 44, 80, 128, 17, 56, 176, 320, 512, 23, 68, 224, 704, 1280, 2048, 26, 92, 272, 896, 2816, 5120, 8192, 29, 104, 368, 1088, 3584, 11264, 20480, 32768, 35, 116, 416, 1472, 4352, 14336, 45056, 81920, 131072, 38, 140, 464, 1664, 5888, 17408, 57344, 180224, 327680, 524288
Offset: 1

Views

Author

Wolfdieter Lang, Oct 21 2021

Keywords

Comments

This array a = (a(k, n))_{k >= 1,n >= 0} is underlying array A of A347834. See the first formula. It has a simple recurrence for the rows k, given the first column a(k, 0) = A347838(k), which lists the positive integers congruent to {2, 5, 11} modulo 12.
In the array one can add the negative of the powers of 4 as row for k = 0, i.e., -A000302(n), for n >= 0.
All positive numbers congruent to 2 modulo 3 (A017617) appear once in this array. Proof from the array A of A347834 of the positive integers congruent to {1,3,5,7} modulo 8, and the present first formula: The members of column n = 0 give all the positive integers congruent to {2, 5, 11} modulo 12 once, and the members of columns n >= 1 give all the positive integers congruent to 8 modulo 12 (A017617) once. These members combined lead to the positive integers congruent to 2 modulo 3.

Examples

			The array a(k, n) begins:
k \ n  0   1   2    3    4     5      6      7       8       9       10 ...
---------------------------------------------------------------------------
1:     2   8  32  128  512  2048   8192  32768  131072  524288  2097152 ...
2:     5  20  80  320 1280  5120  20480  81920  327680 1310720  5242880 ...
3:    11  44 176  704 2816 11264  45056 180224  720896 2883584 11534336 ...
4:    14  56 224  896 3584 14336  57344 229376  917504 3670016 14680064 ...
5:    17  68 272 1088 4352 17408  69632 278528 1114112 4456448 17825792 ...
6:    23  92 368 1472 5888 23552  94208 376832 1507328 6029312 24117248 ...
7:    26 104 416 1664 6656 26624 106496 425984 1703936 6815744 27262976 ...
8:    29 116 464 1856 7424 29696 118784 475136 1900544 7602176 30408704 ...
9:    35 140 560 2240 8960 35840 143360 573440 2293760 9175040 36700160 ...
10:   38 152 608 2432 9728 38912 155648 622592 2490368 9961472 39845888 ...
...
----------------------------------------------------------------------------
The triangle t(n,k) begins:
k \ n  0   1   2    3    4     5     6      7      8      9 ...
---------------------------------------------------------------
1:     2
2:     5   8
3:    11  20  32
4:    14  44  80  128
5:    17  56 176  320  512
6:    23  68 224  704 1280  2048
7:    26  92 272  896 2816  5120  8192
8:    29 104 368 1088 3584 11264 20480  32768
9:    35 116 416 1472 4352 14336 45056  81920 131072
10:   38 140 464 1664 5888 17408 57344 180224 327680 524288
...
-----------------------------------------------------------------
		

Crossrefs

The rows k are given by -A000302 (for k=0), A004171, A003947(n+1), A002089, 2*A002042, ...
The columns n are given by 4^n*A347838 for n >= 0.

Programs

  • Maple
    A := (n, k) -> 4^n*(3*(k + iquo(k, 3)) - 1):
    for k from 1 to 10 do seq(A(n, k), n = 0..10) od;
    # Alternatively:
    gf  := n -> (4^n*((z*(z*(7*z + 3) + 3) - 1)))/((z - 1)^2*(1 + z + z^2)):
    ser := n -> series(gf(n), z, 12):
    col := (n, len) -> seq(coeff(ser(n), z, k), k = 1..len):
    seq(print(col(n, 10)), n = 0..10); # Peter Luschny, Oct 26 2021
  • Mathematica
    A[n_, k_] := 4^n (3(k + Quotient[k, 3]) - 1);
    Table[A[n-k, k], {n, 1, 10}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Nov 07 2021, from Maple code *)

Formula

Array a:
a(k, n) = (3*A(k, n) + 1)/2, with the array A from A347834, for k >= 1, and n >= 0.
a(k, n) = 4^n*A347838(k) = 4^n*(2 + 3*k + 3*floor((k + 1)/3)).
Recurrence for rows k: a(k, n) = 4*a(k, n-1), for n >= 1, with a(k, 0) = A347838(k).
O.g.f.: expansion in z gives the o.g.f.s for rows k, also for k = 0: -A000302; expansion in x gives the o.g.f.s for columns n.
G(z, x) = (-1 + 3*z + 3*z^2 + 7*z^3)/((1 - z)*(1 - z^3)*(1 - 4*x)).
Triangle t:
t(k, n) = a(k-n, n), for k >= 1, and n = 0, 1, ..., k-1.

A175880 a(1)=1, a(2)=2. If n >= 3: if n/2 is in the sequence, a(n)=0, otherwise a(n)=n.

Original entry on oeis.org

1, 2, 3, 0, 5, 0, 7, 8, 9, 0, 11, 12, 13, 0, 15, 0, 17, 0, 19, 20, 21, 0, 23, 0, 25, 0, 27, 28, 29, 0, 31, 32, 33, 0, 35, 36, 37, 0, 39, 0, 41, 0, 43, 44, 45, 0, 47, 48, 49, 0, 51, 52, 53, 0, 55, 0, 57, 0, 59, 60, 61, 0, 63, 0, 65, 0, 67, 68, 69, 0, 71, 0, 73, 0, 75, 76, 77, 0, 79, 80
Offset: 1

Views

Author

Adriano Caroli, Dec 05 2010

Keywords

Comments

If n > 0 and n is in the sequence, then a(2*n) = 0. Example: 5 is in the sequence, so a(2*5) = a(10) = 0.
Is this a(n) = n*A039982(n-1), n > 1? [R. J. Mathar, Dec 07 2010]

Crossrefs

Programs

  • Haskell
    import Data.List (delete)
    a175880 n = a175880_list !! (n-1)
    a175880_list = 1 : f [2..] [2..] where
       f (x:xs) (y:ys) | x == y    = x : (f xs $ delete (2*x) ys)
                       | otherwise = 0 : (f xs (y:ys))
    for_bFile = take 10000 a175880_list
    -- Reinhard Zumkeller, Feb 09 2011
  • Maple
    A110654 := proc(n) 2*n+1-(-1)^n ; %/4 ;end proc:
    A175880 := proc(n) if n <=2 then n; else if type(n,'even') then n-2*procname(A110654(n)) ; else n; end if; end if; end proc:
    seq(A175880(n),n=1..40) ; # R. J. Mathar, Dec 07 2010

Formula

a(n) = n - (1 + (-1)^n) * a((2*n + 1 - (-1)^n)/4), n >= 3.
a(n) = n - A010673(n+1)*a(A110654(n)).

A173209 Partial sums of A000069.

Original entry on oeis.org

1, 3, 7, 14, 22, 33, 46, 60, 76, 95, 116, 138, 163, 189, 217, 248, 280, 315, 352, 390, 431, 473, 517, 564, 613, 663, 715, 770, 826, 885, 946, 1008, 1072, 1139, 1208, 1278, 1351, 1425, 1501, 1580, 1661, 1743, 1827, 1914, 2002, 2093, 2186, 2280, 2377, 2475, 2575
Offset: 1

Views

Author

Jonathan Vos Post, Feb 12 2010

Keywords

Comments

Partial sums of odious numbers. Second differences give A007413. The subsequence of prime partial sums of odious numbers begins: 3, 7, 163, 431, 613, 2377, 3691, which is a subsequence of A027697. The subsequence of odious partial sums of odious numbers begins: 1, 7, 14, 22, 76, 138, 217, 280, 352, 431, 517, 613, 770, 885.

Examples

			a(65) = 1 + 2 + 4 + 7 + 8 + 11 + 13 + 14 + 16 + 19 + 21 + 22 + 25 + 26 + 28 + 31 + 32 + 35 + 37 + 38 + 41 + 42 + 44 + 47 + 49 + 50 + 52 + 55 + 56 + 59 + 61 + 62 + 64 + 67 + 69 + 70 + 73 + 74 + 76 + 79 + 81 + 82 + 84 + 87 + 88 + 91 + 93 + 94 + 97 + 98 + 100 + 103 + 104 + 107 + 109 + 110 + 112 + 115 + 117 + 118 + 121 + 122 + 124 + 127 + 128.
		

Crossrefs

Programs

Formula

a(n) = SUM[i=1..n] A000069(i) = SUM[i=1..n] {i such that A010060(i)=1}.
a(n) = n^2 - n/2 + O(1). - Charles R Greathouse IV, Mar 22 2013

A140721 Alternated reading of A000302 and negated A002042.

Original entry on oeis.org

1, -7, 4, -28, 16, -112, 64, -448, 256, -1792, 1024, -7168, 4096, -28672, 16384, -114688, 65536, -458752, 262144, -1835008, 1048576, -7340032, 4194304, -29360128, 16777216, -117440512, 67108864, -469762048, 268435456, -1879048192, 1073741824
Offset: 0

Views

Author

Paul Curtz, Jul 12 2008

Keywords

Comments

Sequence can also be obtained by negating the first differences of A135520: a(n)=A135520(n)-A135520(n+1).

Formula

a(2n) = A000302(n). a(2n+1) = -A002042(n) .
a(2n) = -7a(2n-1). a(2n)-a(2n-1) = A002089(n-1). a(n)+a(n+1) = -3*A135520(n).
O.g.f.: (7x-1)/((2x-1)(2x+1)). - R. J. Mathar, Jul 14 2008

Extensions

Edited by R. J. Mathar, Jul 14 2008
Showing 1-8 of 8 results.