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-10 of 13 results. Next

A185269 The subsequence of primes, in order of occurrence, in A005351.

Original entry on oeis.org

7, 5, 31, 29, 19, 17, 23, 107, 109, 97, 103, 101, 127, 113, 73, 79, 67, 71, 89, 83, 431, 419, 421, 443, 433, 439, 397, 389, 409, 401, 491, 487, 509, 499, 503, 457, 463, 461, 449, 479, 467, 293, 313, 317, 307, 311, 271, 269, 257, 263, 283, 281, 277, 367, 353, 359, 379
Offset: 1

Views

Author

Jonathan Vos Post, Feb 19 2011

Keywords

Comments

A005351(n) is a representation of n obtained by converting n to the base(-2) representation, interpreting this as a binary, base(+2), number, and converting back to decimal.

Crossrefs

Programs

  • Mathematica
    f[n_] := Module[{t = 2 (4^Floor[Log[4, Abs[n] + 1] + 2] - 1)/3}, BitXor[n + t, t]]; Select[Array[f, 300], PrimeQ] (* Robert G. Wilson v, Feb 21 2011 *)

A016789 a(n) = 3*n + 2.

Original entry on oeis.org

2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, 53, 56, 59, 62, 65, 68, 71, 74, 77, 80, 83, 86, 89, 92, 95, 98, 101, 104, 107, 110, 113, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 176, 179
Offset: 0

Views

Author

Keywords

Comments

Except for 1, n such that Sum_{k=1..n} (k mod 3)*binomial(n,k) is a power of 2. - Benoit Cloitre, Oct 17 2002
The sequence 0,0,2,0,0,5,0,0,8,... has a(n) = n*(1 + cos(2*Pi*n/3 + Pi/3) - sqrt(3)*sin(2*Pi*n + Pi/3))/3 and o.g.f. x^2(2+x^3)/(1-x^3)^2. - Paul Barry, Jan 28 2004 [Artur Jasinski, Dec 11 2007, remarks that this should read (3*n + 2)*(1 + cos(2*Pi*(3*n + 2)/3 + Pi/3) - sqrt(3)*sin(2*Pi*(3*n + 2)/3 + Pi/3))/3.]
Except for 2, exponents e such that x^e + x + 1 is reducible. - N. J. A. Sloane, Jul 19 2005
The trajectory of these numbers under iteration of sum of cubes of digits eventually turns out to be 371 or 407 (47 is the first of the second kind). - Avik Roy (avik_3.1416(AT)yahoo.co.in), Jan 19 2009
Union of A165334 and A165335. - Reinhard Zumkeller, Sep 17 2009
a(n) is the set of numbers congruent to {2,5,8} mod 9. - Gary Detlefs, Mar 07 2010
It appears that a(n) is the set of all values of y such that y^3 = k*n + 2 for integer k. - Gary Detlefs, Mar 08 2010
These numbers do not occur in A000217 (triangular numbers). - Arkadiusz Wesolowski, Jan 08 2012
A089911(2*a(n)) = 9. - Reinhard Zumkeller, Jul 05 2013
Also indices of even Bell numbers (A000110). - Enrique Pérez Herrero, Sep 10 2013
Central terms of the triangle A108872. - Reinhard Zumkeller, Oct 01 2014
A092942(a(n)) = 1 for n > 0. - Reinhard Zumkeller, Dec 13 2014
a(n-1), n >= 1, is also the complex dimension of the manifold E(S), the set of all second-order irreducible Fuchsian differential equations defined on P^1 = C U {oo}, having singular points at most in S = {a_1, ..., a_n, a_{n+1} = oo}, a subset of P^1. See the Iwasaki et al. reference, Proposition 2.1.3., p. 149. - Wolfdieter Lang, Apr 22 2016
Except for 2, exponents for which 1 + x^(n-1) + x^n is reducible. - Ron Knott, Sep 16 2016
The reciprocal sum of 8 distinct items from this sequence can be made equal to 1, with these terms: 2, 5, 8, 14, 20, 35, 41, 1640. - Jinyuan Wang, Nov 16 2018
There are no positive integers x, y, z such that 1/a(x) = 1/a(y) + 1/a(z). - Jinyuan Wang, Dec 31 2018
As a set of positive integers, it is the set sum S + S where S is the set of numbers in A016777. - Michael Somos, May 27 2019
Interleaving of A016933 and A016969. - Leo Tavares, Nov 16 2021
Prepended with {1}, these are the denominators of the elements of the 3x+1 semigroup, the numerators being A005408 prepended with {2}. See Applegate and Lagarias link for more information. - Paolo Xausa, Nov 20 2021
This is also the maximum number of moves starting with n + 1 dots in the game of Sprouts. - Douglas Boffey, Aug 01 2022 [See the Wikipedia link. - Wolfdieter Lang, Sep 29 2022]
a(n-2) is the maximum sum of the span (or L(2,1)-labeling number) of a graph of order n and its complement. The extremal graphs are stars and their complements. For example, K_{1,2} has span 3, and K_2 has span 2. Thus a(3-1) = 5. - Allan Bickle, Apr 20 2023

Examples

			G.f. = 2 + 5*x + 8*x^2 + 11*x^3 + 14*x^4 + 17*x^5 + 20*x^6 + ... - _Michael Somos_, May 27 2019
		

References

  • K. Iwasaki, H. Kimura, S. Shimomura and M. Yoshida, From Gauss to Painlevé, Vieweg, 1991. p. 149.
  • Konrad Knopp, Theory and Application of Infinite Series, Dover, p. 269

Crossrefs

First differences of A005449.
Cf. A087370.
Cf. similar sequences with closed form (2*k-1)*n+k listed in A269044.

Programs

Formula

G.f.: (2+x)/(1-x)^2.
a(n) = 3 + a(n-1).
a(n) = 1 + A016777(n).
a(n) = A124388(n)/9.
a(n) = A125199(n+1,1). - Reinhard Zumkeller, Nov 24 2006
Sum_{n>=1} (-1)^n/a(n) = (1/3)*(Pi/sqrt(3) - log(2)). - Benoit Cloitre, Apr 05 2002
1/2 - 1/5 + 1/8 - 1/11 + ... = (1/3)*(Pi/sqrt(3) - log 2). [Jolley] - Gary W. Adamson, Dec 16 2006
Sum_{n>=0} 1/(a(2*n)*a(2*n+1)) = (Pi/sqrt(3) - log 2)/9 = 0.12451569... (see A196548). [Jolley p. 48 eq (263)]
a(n) = 2*a(n-1) - a(n-2); a(0)=2, a(1)=5. - Philippe Deléham, Nov 03 2008
a(n) = 6*n - a(n-1) + 1 with a(0)=2. - Vincenzo Librandi, Aug 25 2010
Conjecture: a(n) = n XOR A005351(n+1) XOR A005352(n+1). - Gilian Breysens, Jul 21 2017
E.g.f.: (2 + 3*x)*exp(x). - G. C. Greubel, Nov 02 2018
a(n) = A005449(n+1) - A005449(n). - Jinyuan Wang, Feb 03 2019
a(n) = -A016777(-1-n) for all n in Z. - Michael Somos, May 27 2019
a(n) = A007310(n+1) + (1 - n mod 2). - Walt Rorie-Baety, Sep 13 2021
a(n) = A000096(n+1) - A000217(n-1). See Capped Triangular Frames illustration. - Leo Tavares, Oct 05 2021

A039724 a(n) is the negabinary expansion of n, that is, the expansion of n in base -2.

Original entry on oeis.org

0, 1, 110, 111, 100, 101, 11010, 11011, 11000, 11001, 11110, 11111, 11100, 11101, 10010, 10011, 10000, 10001, 10110, 10111, 10100, 10101, 1101010, 1101011, 1101000, 1101001, 1101110, 1101111, 1101100, 1101101, 1100010, 1100011, 1100000, 1100001, 1100110, 1100111, 1100100
Offset: 0

Views

Author

Robert Lozyniak (11(AT)onna.com)

Keywords

Comments

The numbers written in base -2.
a(A007583(n)) are the only terms with all 1s digits; the number of digits = 2n + 1. - Bob Selcoe, Aug 21 2016

Examples

			2 = 4 + (-2) + 0 = 110_(-2), 3 = 4 + (-2) + 1 = 111_(-2), ..., 6 = 16 + (-8) + 0 + (-2) + 0 = 11010_(-2).
		

References

  • M. Gardner, Knotted Doughnuts and Other Mathematical Entertainments. Freeman, NY, 1986, p. 101.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 2, p. 189.

Crossrefs

Nonnegative numbers in negative bases: A039723 (b=-10), this sequence (b=-2), A073785 (b=-3), A007608 (b=-4), A073786 (b=-5), A073787 (b=-6), A073788 (b=-7), A073789 (b=-8), A073790 (b=-9).
Cf. A212529 (negative numbers in base -2).

Programs

  • Haskell
    a039724 0 = 0
    a039724 n = a039724 n' * 10 + m where
       (n', m) = if r < 0 then (q + 1, r + 2) else (q, r)
                 where (q, r) = quotRem n (negate 2)
    -- Reinhard Zumkeller, Jul 07 2012
    
  • Maple
    f:= proc(n) option remember; 10*floor((n mod 4)/2) + (n mod 2) + 100*procname(round(n/4)) end proc:
    f(0):= 0:
    seq(f(i),i=0..100); # Robert Israel, Feb 24 2016
  • Mathematica
    ToNegaBases[ i_Integer, b_Integer ] := FromDigits[ Rest[ Reverse[ Mod[ NestWhileList[ (#1 - Mod[ #1, b ])/-b &, i, #1 != 0 & ], b ] ] ] ]; Table[ ToNegaBases[ n, 2 ], {n, 0, 31} ]
  • PARI
    A039724(n)=if(n,A039724(n\(-2))*10+bittest(n,0)) \\ M. F. Hasler, Oct 16 2018
  • Python
    def A039724(n):
        s, q = '', n
        while q >= 2 or q < 0:
            q, r = divmod(q, -2)
            if r < 0:
                q += 1
                r += 2
            s += str(r)
        return int(str(q)+s[::-1]) # Chai Wah Wu, Apr 09 2016
    

Formula

G.f. g(x) satisfies g(x) = (x + 10*x^2 + 11*x^3)/(1 - x^4) + 100(1 + x + x^2 + x^3)*g(x^4)/x^2. - Robert Israel, Feb 24 2016

Extensions

More terms from Eric W. Weisstein

A122803 Powers of -2: a(n) = (-2)^n.

Original entry on oeis.org

1, -2, 4, -8, 16, -32, 64, -128, 256, -512, 1024, -2048, 4096, -8192, 16384, -32768, 65536, -131072, 262144, -524288, 1048576, -2097152, 4194304, -8388608, 16777216, -33554432, 67108864, -134217728, 268435456, -536870912, 1073741824, -2147483648, 4294967296, -8589934592, 17179869184
Offset: 0

Views

Author

Keywords

Comments

The number -2 can be used as a base of numeration (see the Weisstein link). - Alonso del Arte, Mar 30 2014
Contribution from M. F. Hasler, Oct 21 2014: (Start)
This is the inverse binomial transform of A033999 = n->(-1)^n, and the binomial transform of A033999*A000244 = n->(-3)^n, see also A141413.
Prefixed with one 0, i.e., (0,1,-2,4,...) = -A033999*A131577, it is the binomial transform of (0, 1, -4, 13, -40, 121,...) = -A033999*A003462, and inverse binomial transform of (0,1,0,1,0,1,...) = A000035.
Prefixed with two 0's, i.e., (0,0,1,-2,4,-8,...), it is the binomial transform of (0,0,1,-5,18,-58,179,-543,...) (cf. A000340) and inverse binomial transform of (0,0,1,1,2,2,3,3,...) = A004526. (End)
Prefixed with three 0's, this is the inverse binomial difference of (0, 0, 0, 1, 2, 4, 6, 9, 12, 16,...) = concat(0, A002620), which has as successive differences (0, 0, 1, 1, 2, 2,...) = A004526, then (0, 1, 0, 1,...) = A000035, then (1, -1, 1, -1,...) = A033999, and then (-2)^k*A033999 with k=1,2,3,... - Paul Curtz, Oct 16 2014, edited by M. F. Hasler, Oct 21 2014
Stirling-Bernoulli transform of triangular numbers: 1, 3, 6, 10, 15, 21, 28, ... - Philippe Deléham, May 25 2015

Crossrefs

Programs

Formula

a(n) = (-2)^n = (-1)^n * 2^n.
a(n) = -2*a(n-1), n > 0; a(0) = 1. G.f.: 1/(1+2x). - Philippe Deléham, Nov 19 2008
Sum_{n >= 0} 1/a(n) = 2/3. - Jaume Oliver Lafont, Mar 01 2009
E.g.f.: 1/exp(2*x). - Arkadiusz Wesolowski, Aug 13 2012
a(n) = Sum_{k = 0..n} (-2)^(n-k)*binomial(n, k)*A030195(n+1). - R. J. Mathar, Oct 15 2012
G.f.: 1/(1+2x). A122803 = A033999 * A000079. - M. F. Hasler, Oct 21 2014
a(n) = Sum_{k = 0..n} A163626(n,k)*A000217(k+1). - Philippe Deléham, May 25 2015

A053985 Replace 2^k with (-2)^k in binary expansion of n.

Original entry on oeis.org

0, 1, -2, -1, 4, 5, 2, 3, -8, -7, -10, -9, -4, -3, -6, -5, 16, 17, 14, 15, 20, 21, 18, 19, 8, 9, 6, 7, 12, 13, 10, 11, -32, -31, -34, -33, -28, -27, -30, -29, -40, -39, -42, -41, -36, -35, -38, -37, -16, -15, -18, -17, -12, -11, -14, -13, -24, -23, -26, -25, -20, -19
Offset: 0

Views

Author

Henry Bottomley, Apr 03 2000

Keywords

Comments

Base 2 representation for n (in lexicographic order) converted from base -2 to base 10.
Maps natural numbers uniquely onto integers; within each group of positive values, maximum is in A002450; a(n)=n iff n can be written only with 1's and 0's in base 4 (A000695).
a(n) = A004514(n) - n. - Reinhard Zumkeller, Dec 27 2003
Schroeppel gives formula n = (a(n) + b) XOR b where b = binary ...101010, and notes this formula is reversible. The reverse a(n) = (n XOR b) - b is a bit twiddle to transform 1 bits to -1. Odd position 0 or 1 in n is flipped by "XOR b" to 1 or 0, then "- b" gives 0 or -1. Only odd position 1's are changed, so b can be any length sure to cover those. - Kevin Ryde, Jun 26 2020

Examples

			a(9)=-7 because 9 is written 1001 base 2 and (-2)^3 + (-2)^0 = -8 + 1 = -7.
Or by Schroeppel's formula, b = binary 1010 then a(9) = (1001 XOR 1010) - 1010 = decimal -7. - _Kevin Ryde_, Jun 26 2020
		

Crossrefs

Programs

  • Mathematica
    f[n_Integer, b_Integer] := Block[{l = IntegerDigits[n]}, Sum[l[[ -i]]*(-b)^(i - 1), {i, 1, Length[l]}]]; a = Table[ FromDigits[ IntegerDigits[n, 2]], {n, 0, 80}]; b = {}; Do[b = Append[b, f[a[[n]], 2]], {n, 1, 80}]; b
    (* Second program: *)
    Array[FromDigits[IntegerDigits[#, 2], -2] &, 62, 0] (* Michael De Vlieger, Jun 27 2020 *)
  • PARI
    a(n) = fromdigits(binary(n), -2) \\ Rémy Sigrist, Sep 01 2018
    
  • Python
    def A053985(n): return  -(b:=int('10'*(n.bit_length()+1>>1),2)) + (n^b) if n else 0 # Chai Wah Wu, Nov 18 2022

Formula

From Ralf Stephan, Jun 13 2003: (Start)
G.f.: (1/(1-x)) * Sum_{k>=0} (-2)^k*x^2^k/(1+x^2^k).
a(0) = 0, a(2*n) = -2*a(n), a(2*n+1) = -2*a(n)+1. (End)
a(n) = Sum_{k>=0} A030308(n,k)*A122803(k). - Philippe Deléham, Oct 15 2011
a(n) = (n XOR b) - b where b = binary ..101010 [Schroeppel]. Any b of this form (A020988) with bitlength(b) >= bitlength(n) suits. - Kevin Ryde, Jun 26 2020

A005352 Base -2 representation of -n reinterpreted as binary.

Original entry on oeis.org

3, 2, 13, 12, 15, 14, 9, 8, 11, 10, 53, 52, 55, 54, 49, 48, 51, 50, 61, 60, 63, 62, 57, 56, 59, 58, 37, 36, 39, 38, 33, 32, 35, 34, 45, 44, 47, 46, 41, 40, 43, 42, 213, 212, 215, 214, 209, 208, 211, 210, 221, 220, 223, 222, 217, 216, 219, 218, 197, 196, 199, 198, 193, 192, 195, 194, 205, 204, 207, 206, 201, 200
Offset: 1

Views

Author

Keywords

Examples

			a(4) = 12 because the negabinary representation of -4 is 1100, and in ordinary binary that is 12.
a(5) = 15 because the negabinary representation of -5 is 1111, and in binary that is 15.
		

References

  • M. Gardner, Knotted Doughnuts and Other Mathematical Entertainments. Freeman, NY, 1986, p. 101.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Complement of A005351 in natural numbers.
Cf. A212529.

Programs

  • Haskell
    a005352 = a005351 . negate  -- Reinhard Zumkeller, Feb 05 2014
    
  • Mathematica
    (* This function comes from the Weisstein page *)
    Negabinary[n_Integer] := Module[{t = (2/3)(4^Floor[Log[4, Abs[n] + 1] + 2] - 1)}, IntegerDigits[BitXor[n + t, t], 2]];
    Table[FromDigits[Negabinary[n], 2], {n, -1, -50, -1}]
    (* Alonso del Arte, Apr 04 2011 *)
  • PARI
    a(n) = my(t=(32*4^logint(n+1,4)-2)/3); bitxor(t-n, t); \\ Ruud H.G. van Tol, Oct 19 2023
    
  • Python
    def A005352(n):
        return ((b:=(4 << (n.bit_length() | 1)) // 3) - n)^b # Adrienne Leonardo, Feb 03 2025

Formula

a(n) = A005351(-n). - Reinhard Zumkeller, Feb 05 2014

A027615 Number of 1's when n is written in base -2.

Original entry on oeis.org

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

Views

Author

Pontus von Brömssen, Nov 14 1997

Keywords

Comments

Base -2 is also called "negabinary".
From Jianing Song, Oct 18 2018: (Start)
Define f(n) as: f(0) = 0, f(-2*n) = f(n), f(-2*n+1) = f(n) + 1, then a(n) = f(n), n >= 0. See A320642 for the other half of f.
For k > 0, the earliest occurrence of k is n = A305750(k).
Conjecture: a(n) != A053737(n) if and only if there exists even k >= 4 such that n mod 2^k >= (5*2^(k+1) + 2)/3. If this holds, then the probability of a random chosen number n to satisfy a(n) != A053737(n) is 1/6. (End)

Examples

			A039724(7) = 11011 which has four 1's, so a(7) = 4.
		

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 164.

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = a[Quotient[n - 1, -2]] + Mod[n, 2]; a[0] = 0; Array[a, 100, 0] (* Amiram Eldar, Jul 23 2023 *)
  • PARI
    a(n) = if(n==0, 0, a(n\(-2))+n%2) /* Jianing Song, Oct 18 2018 */

Formula

a(n) = 3*A072894(n+1) - 2*n - 3. Proof by Nikolaus Meyberg, following a conjecture by Ralf Stephan. - R. J. Mathar, Jan 11 2013
a(n) == n (mod 3). - Jianing Song, Oct 18 2018
a(n) = A000120(A005351(n)). - Michel Marcus, Oct 23 2018

A178729 a(n) = n XOR 3n, where XOR is bitwise XOR.

Original entry on oeis.org

0, 2, 4, 10, 8, 10, 20, 18, 16, 18, 20, 42, 40, 42, 36, 34, 32, 34, 36, 42, 40, 42, 84, 82, 80, 82, 84, 74, 72, 74, 68, 66, 64, 66, 68, 74, 72, 74, 84, 82, 80, 82, 84, 170, 168, 170, 164, 162, 160, 162, 164, 170, 168, 170, 148, 146, 144, 146, 148, 138, 136, 138, 132, 130
Offset: 0

Views

Author

Dmitry Kamenetsky, Jun 08 2010

Keywords

Crossrefs

Programs

Formula

a(n) = A005351(n) XOR A005352(n) (conjectured). Proved by Verrill link.
a(n) = 2 * A184617(n). - Alois P. Heinz, Jul 21 2017

Extensions

a(30) onwards from Robert G. Wilson v, Jun 09 2010

A057892 Negabinary numbral addition table read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 2, 6, 2, 3, 3, 3, 3, 4, 0, 12, 0, 4, 5, 5, 13, 13, 5, 5, 6, 26, 6, 2, 6, 26, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 4, 0, 4, 24, 4, 0, 4, 8, 9, 9, 1, 1, 25, 25, 1, 1, 9, 9, 10, 14, 10, 6, 26, 30, 26, 6, 10, 14, 10, 11, 11, 11, 11, 27, 27, 27, 27, 11, 11, 11, 11, 12, 8, 52, 8, 12, 24, 4, 24
Offset: 0

Views

Author

Marc LeBrun, Sep 25 2000

Keywords

Comments

Every negabinary numbral appears infinitely often (since every signed integer can be represented as a sum of two signed integers in infinitely many ways).

Examples

			a(4)=6 since a(4) corresponds to the table entry for [1]+[1]=1+1=2=4-2=[6].
a(24)=2 since a(24) corresponds to the table entry for [3]+[3]=(-1)+(-1)=-2=[2]. - _Sean A. Irvine_, Jul 11 2022
		

Crossrefs

Extensions

a(24) and a(84) corrected and title clarified by Sean A. Irvine, Jul 11 2022

A057893 Negabinary numbral multiplication table.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 4, 3, 0, 0, 4, 6, 6, 4, 0, 0, 5, 8, 1, 8, 5, 0, 0, 6, 10, 12, 12, 10, 6, 0, 0, 7, 12, 15, 16, 15, 12, 7, 0, 0, 8, 14, 2, 20, 20, 2, 14, 8, 0, 0, 9, 16, 13, 24, 105, 24, 13, 16, 9, 0, 0, 10, 18, 24, 28, 30, 30, 28, 24, 18, 10, 0, 0, 11, 20, 27, 32, 19, 4
Offset: 0

Views

Author

Marc LeBrun, Sep 25 2000

Keywords

Comments

Units are [1]=1 and [3]=-1.

Examples

			a(17)=6 since a(17) corresponds to the table entry for [3]+[2]=-1*-2=2=4-2=[6]
		

Crossrefs

Showing 1-10 of 13 results. Next