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 86 results. Next

A081241 Position in B of reversal of n-th term of B, where B is the logic-binary sequence, A007931.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Mar 11 2003

Keywords

Comments

A self-inverse permutation of the natural numbers; a(n) = n if and only if A007931(n) is a palindrome.
The natural numbers written backwards digit-wise in bijective base-2 numeration, and interpreted forwards. - Harald Korneliussen, Apr 11 2019

Examples

			A007931 = (1,2,11,12,21,22,111,112,121,122,211,...); and (reversal of term #8) = term #11.
		

Crossrefs

Cf. A007931.

A059941 Take the n-th number which is just a sequence of 1's and 2's (A007931): if the first k digits in order are the same as the last k digits in order then put 1 in the k-th from right digit of a(n), otherwise put a zero.

Original entry on oeis.org

1, 1, 11, 10, 10, 11, 111, 100, 101, 100, 100, 101, 100, 111, 1111, 1000, 1001, 1000, 1001, 1010, 1001, 1000, 1000, 1001, 1010, 1001, 1000, 1001, 1000, 1111, 11111, 10000, 10001, 10000, 10011, 10000, 10001, 10000, 10001, 10010, 10101, 10000
Offset: 1

Views

Author

Henry Bottomley, Feb 14 2001

Keywords

Examples

			a(35)=10011 since the 35th number with 1's and 2's is 11211, the first digit and last digit are the same (1), the first two and the last two are the same (11), the first three and last three are not (112 and 211), the first four and last four are not (1121 and 1211) and the first five and last five are (11211).
		

Crossrefs

A059942 is this sequence translated from binary to decimal. Cf. A007931, A059943.

Programs

  • Haskell
    import Data.List (inits, tails)
    a059941 n = a059941_list !! (n-1)
    a059941_list = map (foldr (\d v -> v * 10 + d) 0) $ f a030341_tabf where
       f (xs:xss)
         | 0 `elem` xs = f xss
         | otherwise = map fromEnum (zipWith (==)
                       (tail $ inits xs) (reverse $ init $ tails xs)) : f xss
    -- Reinhard Zumkeller, Apr 03 2014
  • Mathematica
    a[n_] := (id = Drop[ IntegerDigits[n+1, 2], 1] + 1; an = {}; Do[ PrependTo[an, If[Take[id, k] == Take[id, -k], 1, 0]], {k, 1, Length[id]}]; FromDigits[an]); Table[a[n], {n, 1, 42}](* Jean-François Alcover, Nov 21 2011 *)

A214207 Replace the terms of A213975 with their ranks in A007931.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 9, 11, 12, 17, 19, 20, 24, 25, 35, 36, 40, 41, 49, 51, 72, 73, 81, 83, 99, 100, 104, 145, 147, 163, 164, 168, 200, 201, 209, 292, 296, 328, 329, 337, 401, 403, 419, 420, 585, 593, 657, 659, 675, 676, 804, 808, 840, 841, 1171, 1187, 1188, 1316, 1320, 1352, 1353, 1609, 1617, 1681, 1683, 2344, 2376, 2377, 2633, 2641, 2705, 2707, 3219, 3235
Offset: 1

Views

Author

N. J. A. Sloane, Jul 09 2012

Keywords

Comments

Created with the hope of obtaining a better understanding of A213975. It would be interesting if this sequence or A214208 had an alternative definition.

Examples

			A213975(10)=1121, which is A007931(17), so a(10)=17.
		

Crossrefs

A214318 Replace the word A214317(n) with its position in A007931.

Original entry on oeis.org

1, 4, 9, 19, 40, 81, 164, 329, 659, 1320, 2641, 5283, 10568, 21137, 42276, 84553, 169107, 338216, 676433, 1352868, 2705737, 5411475, 10822952, 21645905, 43291811, 86583624, 173167249, 346334500, 692669001, 1385338003, 2770676008, 5541352017, 11082704035
Offset: 1

Views

Author

N. J. A. Sloane, Jul 12 2012

Keywords

Examples

			A214317(5) = 12112 is the 40th term of A007931, so a(5)=40.
		

Crossrefs

Programs

  • Maple
    S:= proc(n) option remember;
          `if`(n<2, [2-n], [S(n-1)[], S(n-2)[]])
        end:
    a:= proc(n) option remember; local k;
          for k while nops(S(k))Alois P. Heinz, Jul 19 2012
  • Mathematica
    nesting = 6; A003849 = Flatten[Nest[{#, #[[1]]}&, {0, 1}, nesting]]; A182028[n_] := FromDigits[Take[A003849, n+1], 2]; a[n_] := A182028[n-1] + 2^n - 1; Table[a[n], {n, 1, Length[A003849]}] (* Jean-François Alcover, Feb 13 2016 *)

Formula

a(n) = A182028(n-1)+2^n-1.
a(n) = 2*a(n-1) + A003842(n-1) for n>1, a(1) = 1. - Alois P. Heinz, Jul 19 2012

Extensions

More terms from Alois P. Heinz, Jul 19 2012

A365278 In the binary expansion of n replace each run of k consecutive 1's by the decimal digits of A007931(k) to get the ternary expansion of a(n).

Original entry on oeis.org

0, 1, 3, 2, 9, 10, 6, 4, 27, 28, 30, 11, 18, 19, 12, 5, 81, 82, 84, 29, 90, 91, 33, 31, 54, 55, 57, 20, 36, 37, 15, 7, 243, 244, 246, 83, 252, 253, 87, 85, 270, 271, 273, 92, 99, 100, 93, 32, 162, 163, 165, 56, 171, 172, 60, 58, 108, 109, 111, 38, 45, 46, 21
Offset: 0

Views

Author

Rémy Sigrist, Aug 30 2023

Keywords

Comments

This sequence is a permutation of the nonnegative integers with inverse A365279.
For any pair (b, c) of bases >= 2, we can devise a similar sequence, say F_{b, c}:
- for any d >= 2, let Z_d be the set of zeroless numbers in base d,
- in the base b expansion of n replace each run of consecutive nonzero digits (say corresponding to Z_b(k) for some k > 0) by the base c digits of Z_c(k) to get the base c expansion of F_{b, c}(n),
- F_{b, c} is a permutation of the nonnegative integers with inverse F_{c, b},
- F_{c, d} o F_{b, c} = F_{b, d} and F_{b, b} is the identity,
- in particular the present sequence corresponds to F_{2, 3} and its inverse to F_{3, 2}.

Examples

			The binary expansion of 415 is "110011111", A007931(2) = 2 and A007931(5) = 21, so the ternary expansion of a(415) is "20021", and a(415) = 169.
		

Crossrefs

Programs

  • Mathematica
    A007931[n_]:=Rest[IntegerDigits[n+1,2]]+1;
    A365278[n_]:=FromDigits[Flatten[Map[If[First[#]==1,A007931[Length[#]],#]&,Split[IntegerDigits[n,2]]]],3];
    Array[A365278,100,0] (* Paolo Xausa, Oct 17 2023 *)
  • PARI
    See Links section.

Formula

a(2*n) = 3*a(n).
a(2^k - 1) = A032924(k) for any k > 0.
A077267(a(n)) = A023416(n).

A363145 Number of subsets S of {A007931(1), A007931(2), ..., A007931(n)} with the property that no element of S is a substring of any other.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 21, 30, 38, 48, 63, 91, 145, 222, 390, 558, 712, 892, 1142, 1456, 1936, 2464, 3270, 4792, 7690, 11854, 18757, 28733, 47355, 73632, 130315, 186998, 239552, 300347, 388902, 492078, 643230, 816210, 1057438, 1354293, 1804608, 2338124, 3111812
Offset: 0

Views

Author

Peter Kagey, May 19 2023

Keywords

Comments

These subsets form an independence system, also called an abstract simplicial complex.

Examples

			For n = 5 the a(5) = 12 independent sets of {A007931(1), A007931(2), ..., A007931(5)} = {1, 2, 11, 12, 21} are:
   1) {};
   2) {1};
   3) {2};
   4) {2, 1};
   5) {11};
   6) {11, 2};
   7) {12};
   8) {12, 11};
   9) {21};
  10) {21, 11};
  11) {21, 12}; and
  12) {21, 12, 11}.
In each of these twelve sets, no string is a substring of any other. In particular, {12, 11, 2} is not an independent set because 2 is a substring of 12.
		

Crossrefs

Cf. A007931.

Extensions

More terms from Pontus von Brömssen, Jul 15 2023

A000027 The positive integers. Also called the natural numbers, the whole numbers or the counting numbers, but these terms are ambiguous.

Original entry on oeis.org

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, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77
Offset: 1

Views

Author

Keywords

Comments

For some authors, the terms "natural numbers" and "counting numbers" include 0, i.e., refer to the nonnegative integers A001477; the term "whole numbers" frequently also designates the whole set of (signed) integers A001057.
a(n) is smallest positive integer which is consistent with sequence being monotonically increasing and satisfying a(a(n)) = n (cf. A007378).
Inverse Euler transform of A000219.
The rectangular array having A000027 as antidiagonals is the dispersion of the complement of the triangular numbers, A000217 (which triangularly form column 1 of this array). The array is also the transpose of A038722. - Clark Kimberling, Apr 05 2003
For nonzero x, define f(n) = floor(nx) - floor(n/x). Then f=A000027 if and only if x=tau or x=-tau. - Clark Kimberling, Jan 09 2005
Numbers of form (2^i)*k for odd k (i.e., n = A006519(n)*A000265(n)); thus n corresponds uniquely to an ordered pair (i,k) where i=A007814, k=A000265 (with A007814(2n)=A001511(n), A007814(2n+1)=0). - Lekraj Beedassy, Apr 22 2006
If the offset were changed to 0, we would have the following pattern: a(n)=binomial(n,0) + binomial(n,1) for the present sequence (number of regions in 1-space defined by n points), A000124 (number of regions in 2-space defined by n straight lines), A000125 (number of regions in 3-space defined by n planes), A000127 (number of regions in 4-space defined by n hyperplanes), A006261, A008859, A008860, A008861, A008862 and A008863, where the last six sequences are interpreted analogously and in each "... by n ..." clause an offset of 0 has been assumed, resulting in a(0)=1 for all of them, which corresponds to the case of not cutting with a hyperplane at all and therefore having one region. - Peter C. Heinig (algorithms(AT)gmx.de), Oct 19 2006
Define a number of points on a straight line to be in general arrangement when no two points coincide. Then these are the numbers of regions defined by n points in general arrangement on a straight line, when an offset of 0 is assumed. For instance, a(0)=1, since using no point at all leaves one region. The sequence satisfies the recursion a(n) = a(n-1) + 1. This has the following geometrical interpretation: Suppose there are already n-1 points in general arrangement, thus defining the maximal number of regions on a straight line obtainable by n-1 points, and now one more point is added in general arrangement. Then it will coincide with no other point and act as a dividing wall thereby creating one new region in addition to the a(n-1)=(n-1)+1=n regions already there, hence a(n)=a(n-1)+1. Cf. the comments on A000124 for an analogous interpretation. - Peter C. Heinig (algorithms(AT)gmx.de), Oct 19 2006
The sequence a(n)=n (for n=1,2,3) and a(n)=n+1 (for n=4,5,...) gives to the rank (minimal cardinality of a generating set) for the semigroup I_n\S_n, where I_n and S_n denote the symmetric inverse semigroup and symmetric group on [n]. - James East, May 03 2007
The sequence a(n)=n (for n=1,2), a(n)=n+1 (for n=3) and a(n)=n+2 (for n=4,5,...) gives the rank (minimal cardinality of a generating set) for the semigroup PT_n\T_n, where PT_n and T_n denote the partial transformation semigroup and transformation semigroup on [n]. - James East, May 03 2007
"God made the integers; all else is the work of man." This famous quotation is a translation of "Die ganzen Zahlen hat der liebe Gott gemacht, alles andere ist Menschenwerk," spoken by Leopold Kronecker in a lecture at the Berliner Naturforscher-Versammlung in 1886. Possibly the first publication of the statement is in Heinrich Weber's "Leopold Kronecker," Jahresberichte D.M.V. 2 (1893) 5-31. - Clark Kimberling, Jul 07 2007
Binomial transform of A019590, inverse binomial transform of A001792. - Philippe Deléham, Oct 24 2007
Writing A000027 as N, perhaps the simplest one-to-one correspondence between N X N and N is this: f(m,n) = ((m+n)^2 - m - 3n + 2)/2. Its inverse is given by I(k)=(g,h), where g = k - J(J-1)/2, h = J + 1 - g, J = floor((1 + sqrt(8k - 7))/2). Thus I(1)=(1,1), I(2)=(1,2), I(3)=(2,1) and so on; the mapping I fills the first-quadrant lattice by successive antidiagonals. - Clark Kimberling, Sep 11 2008
a(n) is also the mean of the first n odd integers. - Ian Kent, Dec 23 2008
Equals INVERTi transform of A001906, the even-indexed Fibonacci numbers starting (1, 3, 8, 21, 55, ...). - Gary W. Adamson, Jun 05 2009
These are also the 2-rough numbers: positive integers that have no prime factors less than 2. - Michael B. Porter, Oct 08 2009
Totally multiplicative sequence with a(p) = p for prime p. Totally multiplicative sequence with a(p) = a(p-1) + 1 for prime p. - Jaroslav Krizek, Oct 18 2009
Triangle T(k,j) of natural numbers, read by rows, with T(k,j) = binomial(k,2) + j = (k^2-k)/2 + j where 1 <= j <= k. In other words, a(n) = n = binomial(k,2) + j where k is the largest integer such that binomial(k,2) < n and j = n - binomial(k,2). For example, T(4,1)=7, T(4,2)=8, T(4,3)=9, and T(4,4)=10. Note that T(n,n)=A000217(n), the n-th triangular number. - Dennis P. Walsh, Nov 19 2009
Hofstadter-Conway-like sequence (see A004001): a(n) = a(a(n-1)) + a(n-a(n-1)) with a(1) = 1, a(2) = 2. - Jaroslav Krizek, Dec 11 2009
a(n) is also the dimension of the irreducible representations of the Lie algebra sl(2). - Leonid Bedratyuk, Jan 04 2010
Floyd's triangle read by rows. - Paul Muljadi, Jan 25 2010
Number of numbers between k and 2k where k is an integer. - Giovanni Teofilatto, Mar 26 2010
Generated from a(2n) = r*a(n), a(2n+1) = a(n) + a(n+1), r = 2; in an infinite set, row 2 of the array shown in A178568. - Gary W. Adamson, May 29 2010
1/n = continued fraction [n]. Let barover[n] = [n,n,n,...] = 1/k. Then k - 1/k = n. Example: [2,2,2,...] = (sqrt(2) - 1) = 1/k, with k = (sqrt(2) + 1). Then 2 = k - 1/k. - Gary W. Adamson, Jul 15 2010
Number of n-digit numbers the binary expansion of which contains one run of 1's. - Vladimir Shevelev, Jul 30 2010
From Clark Kimberling, Jan 29 2011: (Start)
Let T denote the "natural number array A000027":
1 2 4 7 ...
3 5 8 12 ...
6 9 13 18 ...
10 14 19 25 ...
T(n,k) = n+(n+k-2)*(n+k-1)/2. See A185787 for a list of sequences based on T, such as rows, columns, diagonals, and sub-arrays. (End)
The Stern polynomial B(n,x) evaluated at x=2. See A125184. - T. D. Noe, Feb 28 2011
The denominator in the Maclaurin series of log(2), which is 1 - 1/2 + 1/3 - 1/4 + .... - Mohammad K. Azarian, Oct 13 2011
As a function of Bernoulli numbers B_n (cf. A027641: (1, -1/2, 1/6, 0, -1/30, 0, 1/42, ...)): let V = a variant of B_n changing the (-1/2) to (1/2). Then triangle A074909 (the beheaded Pascal's triangle) * [1, 1/2, 1/6, 0, -1/30, ...] = the vector [1, 2, 3, 4, 5, ...]. - Gary W. Adamson, Mar 05 2012
Number of partitions of 2n+1 into exactly two parts. - Wesley Ivan Hurt, Jul 15 2013
Integers n dividing u(n) = 2u(n-1) - u(n-2); u(0)=0, u(1)=1 (Lucas sequence A001477). - Thomas M. Bridge, Nov 03 2013
For this sequence, the generalized continued fraction a(1)+a(1)/(a(2)+a(2)/(a(3)+a(3)/(a(4)+...))), evaluates to 1/(e-2) = A194807. - Stanislav Sykora, Jan 20 2014
Engel expansion of e-1 (A091131 = 1.71828...). - Jaroslav Krizek, Jan 23 2014
a(n) is the number of permutations of length n simultaneously avoiding 213, 231 and 321 in the classical sense which are breadth-first search reading words of increasing unary-binary trees. For more details, see the entry for permutations avoiding 231 at A245898. - Manda Riehl, Aug 05 2014
a(n) is also the number of permutations simultaneously avoiding 213, 231 and 321 in the classical sense which can be realized as labels on an increasing strict binary tree with 2n-1 nodes. See A245904 for more information on increasing strict binary trees. - Manda Riehl, Aug 07 2014
a(n) = least k such that 2*Pi - Sum_{h=1..k} 1/(h^2 - h + 3/16) < 1/n. - Clark Kimberling, Sep 28 2014
a(n) = least k such that Pi^2/6 - Sum_{h=1..k} 1/h^2 < 1/n. - Clark Kimberling, Oct 02 2014
Determinants of the spiral knots S(2,k,(1)). a(k) = det(S(2,k,(1))). These knots are also the torus knots T(2,k). - Ryan Stees, Dec 15 2014
As a function, the restriction of the identity map on the nonnegative integers {0,1,2,3...}, A001477, to the positive integers {1,2,3,...}. - M. F. Hasler, Jan 18 2015
See also A131685(k) = smallest positive number m such that c(i) = m (i^1 + 1) (i^2 + 2) ... (i^k+ k) / k! takes integral values for all i>=0: For k=1, A131685(k)=1, which implies that this is a well defined integer sequence. - Alexander R. Povolotsky, Apr 24 2015
a(n) is the number of compositions of n+2 into n parts avoiding the part 2. - Milan Janjic, Jan 07 2016
Does not satisfy Benford's law [Berger-Hill, 2017] - N. J. A. Sloane, Feb 07 2017
Parametrization for the finite multisubsets of the positive integers, where, for p_j the j-th prime, n = Product_{j} p_j^(e_j) corresponds to the multiset containing e_j copies of j ('Heinz encoding' -- see A056239, A003963, A289506, A289507, A289508, A289509). - Christopher J. Smyth, Jul 31 2017
The arithmetic function v_1(n,1) as defined in A289197. - Robert Price, Aug 22 2017
For n >= 3, a(n)=n is the least area that can be obtained for an irregular octagon drawn in a square of n units side, whose sides are parallel to the axes, with 4 vertices that coincide with the 4 vertices of the square, and the 4 remaining vertices having integer coordinates. See Affaire de Logique link. - Michel Marcus, Apr 28 2018
a(n+1) is the order of rowmotion on a poset defined by a disjoint union of chains of length n. - Nick Mayers, Jun 08 2018
Number of 1's in n-th generation of 1-D Cellular Automata using Rules 50, 58, 114, 122, 178, 186, 206, 220, 238, 242, 250 or 252 in the Wolfram numbering scheme, started with a single 1. - Frank Hollstein, Mar 25 2019
(1, 2, 3, 4, 5, ...) is the fourth INVERT transform of (1, -2, 3, -4, 5, ...). - Gary W. Adamson, Jul 15 2019

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 1.
  • T. M. Apostol, Modular Functions and Dirichlet Series in Number Theory, Springer-Verlag, 1990, page 25.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 22.
  • W. Fulton and J. Harris, Representation theory: a first course, (1991), page 149. [From Leonid Bedratyuk, Jan 04 2010]
  • I. S. Gradstein and I. M. Ryshik, Tables of series, products, and integrals, Volume 1, Verlag Harri Deutsch, 1981.
  • R. E. Schwartz, You Can Count on Monsters: The First 100 numbers and Their Characters, A. K. Peters and MAA, 2010.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A001477 = nonnegative numbers.
Partial sums of A000012.
Cf. A026081 = integers in reverse alphabetical order in U.S. English, A107322 = English name for number and its reverse have the same number of letters, A119796 = zero through ten in alphabetical order of English reverse spelling, A005589, etc. Cf. A185787 (includes a list of sequences based on the natural number array A000027).
Cf. Boustrophedon transforms: A000737, A231179;
Cf. A038722 (mirrored when seen as triangle), A056011 (boustrophedon).
Cf. A048993, A048994, A000110 (see the Feb 03 2015 formula).

Programs

Formula

a(2k+1) = A005408(k), k >= 0, a(2k) = A005843(k), k >= 1.
Multiplicative with a(p^e) = p^e. - David W. Wilson, Aug 01 2001
Another g.f.: Sum_{n>0} phi(n)*x^n/(1-x^n) (Apostol).
When seen as an array: T(k, n) = n+1 + (k+n)*(k+n+1)/2. Main diagonal is 2n*(n+1)+1 (A001844), antidiagonal sums are n*(n^2+1)/2 (A006003). - Ralf Stephan, Oct 17 2004
Dirichlet generating function: zeta(s-1). - Franklin T. Adams-Watters, Sep 11 2005
G.f.: x/(1-x)^2. E.g.f.: x*exp(x). a(n)=n. a(-n)=-a(n).
Series reversion of g.f. A(x) is x*C(-x)^2 where C(x) is the g.f. of A000108. - Michael Somos, Sep 04 2006
G.f. A(x) satisfies 0 = f(A(x), A(x^2)) where f(u, v) = u^2 - v - 4*u*v. - Michael Somos, Oct 03 2006
Convolution of A000012 (the all-ones sequence) with itself. - Tanya Khovanova, Jun 22 2007
a(n) = 2*a(n-1)-a(n-2); a(1)=1, a(2)=2. a(n) = 1+a(n-1). - Philippe Deléham, Nov 03 2008
a(n) = A000720(A000040(n)). - Juri-Stepan Gerasimov, Nov 29 2009
a(n+1) = Sum_{k=0..n} A101950(n,k). - Philippe Deléham, Feb 10 2012
a(n) = Sum_{d | n} phi(d) = Sum_{d | n} A000010(d). - Jaroslav Krizek, Apr 20 2012
G.f.: x * Product_{j>=0} (1+x^(2^j))^2 = x * (1+2*x+x^2) * (1+2*x^2+x^4) * (1+2*x^4+x^8) * ... = x + 2x^2 + 3x^3 + ... . - Gary W. Adamson, Jun 26 2012
a(n) = det(binomial(i+1,j), 1 <= i,j <= n). - Mircea Merca, Apr 06 2013
E.g.f.: x*E(0), where E(k) = 1 + 1/(x - x^3/(x^2 + (k+1)/E(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 03 2013
From Wolfdieter Lang, Oct 09 2013: (Start)
a(n) = Product_{k=1..n-1} 2*sin(Pi*k/n), n > 1.
a(n) = Product_{k=1..n-1} (2*sin(Pi*k/(2*n)))^2, n > 1.
These identities are used in the calculation of products of ratios of lengths of certain lines in a regular n-gon. For the first identity see the Gradstein-Ryshik reference, p. 62, 1.392 1., bringing the first factor there to the left hand side and taking the limit x -> 0 (L'Hôpital). The second line follows from the first one. Thanks to Seppo Mustonen who led me to consider n-gon lengths products. (End)
a(n) = Sum_{j=0..k} (-1)^(j-1)*j*binomial(n,j)*binomial(n-1+k-j,k-j), k>=0. - Mircea Merca, Jan 25 2014
a(n) = A052410(n)^A052409(n). - Reinhard Zumkeller, Apr 06 2014
a(n) = Sum_{k=1..n^2+2*n} 1/(sqrt(k)+sqrt(k+1)). - Pierre CAMI, Apr 25 2014
a(n) = floor(1/sin(1/n)) = floor(cot(1/(n+1))) = ceiling(cot(1/n)). - Clark Kimberling, Oct 08 2014
a(n) = floor(1/(log(n+1)-log(n))). - Thomas Ordowski, Oct 10 2014
a(k) = det(S(2,k,1)). - Ryan Stees, Dec 15 2014
a(n) = 1/(1/(n+1) + 1/(n+1)^2 + 1/(n+1)^3 + ...). - Pierre CAMI, Jan 22 2015
a(n) = Sum_{m=0..n-1} Stirling1(n-1,m)*Bell(m+1), for n >= 1. This corresponds to Bell(m+1) = Sum_{k=0..m} Stirling2(m, k)*(k+1), for m >= 0, from the fact that Stirling2*Stirling1 = identity matrix. See A048993, A048994 and A000110. - Wolfdieter Lang, Feb 03 2015
a(n) = Sum_{k=1..2n-1}(-1)^(k+1)*k*(2n-k). In addition, surprisingly, a(n) = Sum_{k=1..2n-1}(-1)^(k+1)*k^2*(2n-k)^2. - Charlie Marion, Jan 05 2016
G.f.: x/(1-x)^2 = (x * r(x) *r(x^3) * r(x^9) * r(x^27) * ...), where r(x) = (1 + x + x^2)^2 = (1 + 2x + 3x^2 + 2x^3 + x^4). - Gary W. Adamson, Jan 11 2017
a(n) = floor(1/(Pi/2-arctan(n))). - Clark Kimberling, Mar 11 2020
a(n) = Sum_{d|n} mu(n/d)*sigma(d). - Ridouane Oudra, Oct 03 2020
a(n) = Sum_{k=1..n} phi(gcd(n,k))/phi(n/gcd(n,k)). - Richard L. Ollerton, May 09 2021
a(n) = S(n-1, 2), with the Chebyshev S-polynomials A049310. - Wolfdieter Lang, Mar 09 2023
From Peter Bala, Nov 02 2024: (Start)
For positive integer m, a(n) = (1/m)* Sum_{k = 1..2*m*n-1} (-1)^(k+1) * k * (2*m*n - k) = (1/m) * Sum_{k = 1..2*m*n-1} (-1)^(k+1) * k^2 * (2*m*n - k)^2 (the case m = 1 is given above).
a(n) = Sum_{k = 0..3*n} (-1)^(n+k+1) * k * binomial(3*n+k, 2*k). (End)

Extensions

Links edited by Daniel Forgues, Oct 07 2009.

A005385 Safe primes p: (p-1)/2 is also prime.

Original entry on oeis.org

5, 7, 11, 23, 47, 59, 83, 107, 167, 179, 227, 263, 347, 359, 383, 467, 479, 503, 563, 587, 719, 839, 863, 887, 983, 1019, 1187, 1283, 1307, 1319, 1367, 1439, 1487, 1523, 1619, 1823, 1907, 2027, 2039, 2063, 2099, 2207, 2447, 2459, 2579, 2819, 2879, 2903, 2963
Offset: 1

Views

Author

Keywords

Comments

Then (p-1)/2 is called a Sophie Germain prime: see A005384.
Or, primes of the form 2p+1 where p is prime.
Primes p such that denominator(Bernoulli(p-1) + 1/p) = 6. - Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Feb 10 2004
Primes p such that p-1 is a semiprime. - Zak Seidov, Jul 01 2005
A156659(a(n)) = 1; A156875 gives numbers of safe primes <= n. - Reinhard Zumkeller, Feb 18 2009
From Daniel Forgues, Jul 31 2009: (Start)
A safe prime p is 7 or of the form 6k-1, k >= 1, i.e., p == 5 (mod 6).
A prime p of the form 6k+1, k >= 2, i.e., p = 1 (mod 6), cannot be a safe prime since (p-1)/2 is composite and divisible by 3. (End)
If k is the product of the n-th safe prime p and its corresponding Sophie Germain prime (p-1)/2, then a(n) = 2(k-phi(k))/3 + 1, where phi is Euler's totient function. - Wesley Ivan Hurt, Oct 03 2013
From Bob Selcoe, Apr 14 2014: (Start)
When the n-th prime is divided by all primes up to the (n-1)-th prime, safe primes (p) have remainders of 1 when divided by 2 and (p-1)/2 and no other primes. That is, p(mod j)=1 iff j={2,(p-1)/2}; p>j, {p,j}=>prime. Explanation: Generally, x(mod y)=1 iff x=y'+1, where y' is the set of divisors of y, y'>1. Since safe primes (p) are of the form p(mod j)=1 iff p and j are prime, then j={j'}. That is, since j is prime, there are no divisors of j (greater than 1) other than j. Therefore, no primes other than j exist which satisfy the equation p(mod j)=1.
Except primes of the form 2^n+1 (n>=0), all non-safe primes (p') will have at least one prime (p") greater than 2 and less than (p-1)/2 such that p'(mod p")=1. Explanation: Non-safe primes (p') are of the form p'(mod k)=1 where k is composite. This means prime divisors of k exist, and p" is the set of prime divisors of k (example p'=89: k=44; p"={2,11}). The exception applies because p"={2} iff p'=2^n+1.
Refer to the rows in triangle A207409 for illustration and further explanation. (End)
Conjecture: there is a strengthening of the Bertrand postulate for n >= 24: the interval (n, 2*n) contains a safe prime. It has been tested by Peter J. C. Moses up to n = 10^7. - Vladimir Shevelev, Jul 06 2015
The six known safe primes p such that (p-1)/2 is a Fibonacci prime are in A263880. - Jonathan Sondow, Nov 04 2015
The only term in common with A005383 is 5. - Zak Seidov, Dec 31 2015
From the fourth entry onward, do these correspond to Smarandache's problem 34 (see A007931 link), specifically values which cannot be used (do not meet conditions) to confirm the conjecture? - Bill McEachen, Sep 29 2016
Primes p with the property that there is a prime q such that p+q^2 is a square. - Zak Seidov, Feb 16 2017
It is conjectured that there are infinitely many safe primes, and their estimated asymptotic density ~ 2C/(log n)^2 (where C = 0.66... is the twin prime constant A005597) converges to the actual value as far as we know. - M. F. Hasler, Jun 14 2021

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Except for the initial term, this is identical to A079148.
Subsequence of A088707.
Primes in A072055.

Programs

  • Haskell
    a005385 n = a005385_list !! (n-1)
    a005385_list = filter ((== 1) . a010051 . (`div` 2)) a000040_list
    -- Reinhard Zumkeller, Sep 18 2011
    
  • Magma
    [p: p in PrimesUpTo(3000) | IsPrime((p-1) div 2)]; // Vincenzo Librandi, Jul 06 2015
    
  • Maple
    with(numtheory); [ seq(safeprime(i),i=1..3000) ]: convert(%,set); convert(%,list); sort(%);
    A005385_list := n->select(i->isprime(iquo(i,2)),select(i->isprime(i),[$1..n])): # Peter Luschny, Nov 08 2010
  • Mathematica
    Select[Prime[Range[1000]],PrimeQ[(#-1)/2]&] (* Zak Seidov, Jan 26 2011 *)
  • PARI
    g(n) = forprime(x=2,n,y=x+x+1;if(isprime(y),print1(y","))) \\ Cino Hilliard, Sep 12 2004
    
  • PARI
    [x|x<-primes(10^3), bigomega(x-1)==2] \\ Altug Alkan, Nov 04 2015
    
  • Python
    from sympy import isprime, primerange
    def aupto(limit):
      alst = []
      for p in primerange(1, limit+1):
        if isprime((p-1)//2): alst.append(p)
      return alst
    print(aupto(2963)) # Michael S. Branicky, May 07 2021

Formula

a(n) = 2 * A005384(n) + 1.

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Feb 15 2001

A052382 Numbers without 0 in the decimal expansion, colloquial 'zeroless numbers'.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, 111, 112, 113
Offset: 1

Views

Author

Henry Bottomley, Mar 13 2000

Keywords

Comments

The entries 1 to 79 match the corresponding subsequence of A043095, but then 81, 91-98, 100, 102, etc. are only in one of the two sequences. - R. J. Mathar, Oct 13 2008
Complement of A011540; A168046(a(n)) = 1; A054054(a(n)) > 0; A007602, A038186, A038618, A052041, A052043, and A052045 are subsequences. - Reinhard Zumkeller, Apr 25 2012, Apr 07 2011, Dec 01 2009
a(n) = n written in base 9 where zeros are not allowed but nines are. The nine distinct digits used are 1, 2, 3, ..., 9 instead of 0, 1, 2, ..., 8. To obtain this sequence from the "canonical" base 9 sequence with zeros allowed, just replace any 0 with a 9 and then subtract one from the group of digits situated on the left. For example, 9^3 = 729 (10) (in base 10) = 1000 (9) (in base 9) = 889 (9-{0}) (in base 9 without zeros) because 100 (9) = [9-1]9 = 89 (9-{0}) and thus 1000 (9) = [89-1]9 = 889 (9-{0}). - Robin Garcia, Jan 15 2014
From Hieronymus Fischer, May 28 2014: (Start)
Inversion: Given a term m, the index n such that a(n) = m can be calculated by A052382_inverse(m) = m - sum_{1<=j<=k} floor(m/10^j)*9^(j-1), where k := floor(log_10(m)) [see Prog section for an implementation in Smalltalk].
Example 1: A052382_inverse(137) = 137 - (floor(137/10) + floor(137/100)*9) = 137 - (13*1 + 1*9) = 137 - 22 = 115.
Example 2: A052382_inverse(4321) = 4321 - (floor(4321/10) + floor(4321/100)*9 + floor(4321/1000)*81) = 4321 - (432*1 + 43*9 + 4*81) = 4321 - (432 + 387 + 324) = 3178. (End)
The sum of the reciprocals of these numbers from a(1)=1 to infinity, called the Kempner series, is convergent towards a limit: 23.103447... whose decimal expansion is in A082839. - Bernard Schott, Feb 23 2019
Integer n > 0 is encoded using bijective base-9 numeration, see Wikipedia link below. - Alois P. Heinz, Feb 16 2020

Examples

			For k >= 0, a(10^k) = (1, 11, 121, 1331, 14641, 162151, 1783661, 19731371, ...) = A325203(k). - _Hieronymus Fischer_, May 30 2012 and Jun 06 2012; edited by _M. F. Hasler_, Jan 13 2020
		

References

  • Paul Halmos, "Problems for Mathematicians, Young and Old", Dolciani Mathematical Expositions, 1991, p. 258.

Crossrefs

Cf. A004719, A052040, different from A067251.
Column k=9 of A214676.
Cf. A011540 (complement), A043489, A054054, A168046.
Cf. A052383 (without 1), A052404 (without 2), A052405 (without 3), A052406 (without 4), A052413 (without 5), A052414 (without 6), A052419 (without 7), A052421 (without 8), A007095 (without 9).
Zeroless numbers in some other bases <= 10: A000042 (base 2), A032924 (base 3), A023705 (base 4), A248910 (base 6), A255805 (base 8), A255808 (base 9).
Cf. A082839 (sum of reciprocals).
Cf. A038618 (subset of primes)

Programs

  • Haskell
    a052382 n = a052382_list !! (n-1)
    a052382_list = iterate f 1 where
    f x = 1 + if r < 9 then x else 10 * f x' where (x', r) = divMod x 10
    -- Reinhard Zumkeller, Mar 08 2015, Apr 07 2011
    
  • Magma
    [ n: n in [1..114] | not 0 in Intseq(n) ]; // Bruno Berselli, May 28 2011
    
  • Maple
    a:= proc(n) local d, l, m; m:= n; l:= NULL;
          while m>0 do d:= irem(m, 9, 'm');
            if d=0 then d:=9; m:= m-1 fi;
            l:= d, l
          od; parse(cat(l))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 11 2015
    is_zeroless := n -> not is(0 in convert(n, base, 10)):
    select(is_zeroless, [seq(1..113)]);  # Peter Luschny, Jun 20 2025
  • Mathematica
    A052382 = Select[Range[100], DigitCount[#, 10, 0] == 0 &] (* Alonso del Arte, Mar 10 2011 *)
  • PARI
    select( {is_A052382(n)=n&&vecmin(digits(n))}, [0..111]) \\ actually: is_A052382 = (bool) A054054. - M. F. Hasler, Jan 23 2013, edited Jan 13 2020
    
  • PARI
    a(n) = for (w=0, oo, if (n >= 9^w, n -= 9^w, return ((10^w-1)/9 + fromdigits(digits(n, 9))))) \\ Rémy Sigrist, Jul 26 2017
    
  • PARI
    apply( {A052382(n,L=logint(n,9))=fromdigits(digits(n-9^L>>3,9))+10^L\9}, [1..100])
    next_A052382(n, d=digits(n+=1))={for(i=1, #d, d[i]|| return(n-n%(d=10^(#d-i+1))+d\9)); n} \\ least a(k) > n. Used in A038618.
    ( {A052382_vec(n,M=1)=M--;vector(n, i, M=next_A052382(M))} )(99) \\ n terms >= M
    \\ See OEIS Wiki page (cf. LINKS) for more programs. - M. F. Hasler, Jan 11 2020
    
  • Python
    A052382 = [n for n in range(1,10**5) if not str(n).count('0')]
    # Chai Wah Wu, Aug 26 2014
    
  • Python
    from sympy import integer_log
    def A052382(n):
        m = integer_log(k:=(n<<3)+1,9)[0]
        return sum((1+(k-9**m)//(9**j<<3)%9)*10**j for j in range(m)) # Chai Wah Wu, Jun 27 2025
  • Smalltalk
    A052382
    "Answers the n-th term of A052382, where n is the receiver."
    ^self zerofree: 10
    A052382_inverse
    "Answers that index n which satisfy A052382(n) = m, where m is the receiver.”
    ^self zerofree_inverse: 10
    zerofree: base
    "Answers the n-th zerofree number in base base, where n is the receiver. Valid for base > 2.
    Usage: n zerofree: b [b = 10 for this sequence]
    Answer: a(n)"
    | n m s c bi ci d |
    n := self.
    c := base - 1.
    m := (base - 2) * n + 1 integerFloorLog: c.
    d := n - (((c raisedToInteger: m) - 1)//(base - 2)).
    bi := 1.
    ci := 1.
    s := 0.
    1 to: m
    do:
    [:i |
    s := (d // ci \\ c + 1) * bi + s.
    bi := base * bi.
    ci := c * ci].
    ^s
    zerofree_inverse: base
    "Answers the index n such that the n-th zerofree number in base base is = m, where m is the receiver. Valid for base > 2.
    Usage: m zerofree_inverse: b [b = 10 for this sequence]
    Answer: n"
    | m p q s |
    m := self.
    s := 0.
    p := base.
    q := 1.
    [p < m] whileTrue:
    [s := m // p * q + s.
    p := base * p.
    q := (base - 1) * q].
    ^m - s
    "by Hieronymus Fischer, May 28 2014"
    
  • sh
    seq 0 1000 | grep -v 0; # Joerg Arndt, May 29 2011
    

Formula

a(n+1) = f(a(n)) with f(x) = 1 + if x mod 10 < 9 then x else 10*f([x/10]). - Reinhard Zumkeller, Nov 15 2009
From Hieronymus Fischer, Apr 30, May 30, Jun 08 2012, Feb 17 2019: (Start)
a(n) = Sum_{j=0..m-1} (1 + b(j) mod 9)*10^j, where m = floor(log_9(8*n + 1)), b(j) = floor((8*n + 1 - 9^m)/(8*9^j)).
Also: a(n) = Sum_{j=0..m-1} (1 + A010878(b(j)))*10^j.
a(9*n + k) = 10*a(n) + k, k=1..9.
Special values:
a(k*(9^n - 1)/8) = k*(10^n - 1)/9, k=1..9.
a((17*9^n - 9)/8) = 2*10^n - 1.
a((9^n - 1)/8 - 1) = 10^(n-1) - 1, n > 1.
Inequalities:
a(n) <= (1/9)*((8*n+1)^(1/log_10(9)) - 1), equality holds for n=(9^k-1)/8, k>0.
a(n) > (1/10)*((8*n+1)^(1/log_10(9)) - 1), n > 0.
Lower and upper limits:
lim inf a(n)/10^log_9(8*n) = 1/10, for n -> infinity.
lim inf a(n)/n^(1/log_10(9)) = 8^(1/log_10(9))/10, for n -> infinity.
lim sup a(n)/10^log_9(8*n) = 1/9, for n -> infinity.
lim sup a(n)/n^(1/log_10(9)) = 8^(1/log_10(9))/9, for n -> infinity.
G.f.: g(x) = (x^(1/8)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(9/8)*(1 - 10z(j)^9 + 9z(j)^10)/((1-z(j))(1-z(j)^9)), where z(j) = x^9^j.
Also: g(x) = (1/(1-x)) Sum_{j>=0} (1 - 10(x^9^j)^9 + 9(x^9^j)^10)*x^9^j*f_j(x)/(1-x^9^j), where f_j(x) = 10^j*x^((9^j-1)/8)/(1-(x^9^j)^9). Here, the f_j obey the recurrence f_0(x) = 1/(1-x^9), f_(j+1)(x) = 10x*f_j(x^9).
Also: g(x) = (1/(1-x))*((Sum{k=0..8} h_(9,k)(x)) - 9*h_(9,9)(x)), where h_(9,k)(x) = Sum_{j>=0} 10^j*x^((9^(j+1)-1)/8)*x^(k*9^j)/(1-x^9^(j+1)).
Generic formulas for analogous sequences with numbers expressed in base p and only using the digits 1, 2, 3, ... d, where 1 < d < p:
a(n) = Sum_{j=0..m-1} (1 + b(j) mod d)*p^j, where m = floor(log_d((d-1)*n+1)), b(j) = floor(((d-1)*n+1-d^m)/((d-1)*d^j)).
Special values:
a(k*(d^n-1)/(d-1)) = k*(10^n-1)/9, k=1..d.
a(d*((2d-1)*d^(n-1)-1)/(d-1)) = ((d+9)*10^n-d)/9 = 10^n + d*(10^n-1)/9.
a((d^n-1)/(d-1)-1) = d*(10^(n-1)-1)/9, n > 1.
Inequalities:
a(n) <= (10^log_d((d-1)*n+1)-1)/9, equality holds for n = (d^k-1)/(d-1), k > 0.
a(n) > (d/10)*(10^log_d((d-1)*n+1)-1)/9, n > 0.
Lower and upper limits:
lim inf a(n)/10^log_d((d-1)*n) = d/90, for n -> infinity.
lim sup a(n)/10^log_d((d-1)*n) = 1/9, for n -> infinity.
G.f.: g(x) = (1/(1-x)) Sum_{j>=0} (1 - (d+1)(x^d^j)^d + d(x^d^j)^(d+1))*x^d^j*f_j(x)/(1-x^d^j), where f_j(x) = p^j*x^((d^j-1)/(d-1))/(1-(x^d^j)^d). Here, the f_j obey the recursion f_0(x) = 1/(1-x^d), f_(j+1)(x) = px*f_j(x^d).
(End)
A052382 = { n | A054054(n) > 0 }. - M. F. Hasler, Jan 23 2013
From Hieronymus Fischer, Feb 20 2019: (Start)
Sum_{n>=1} (-1)^(n+1)/a(n) = 0.696899720...
Sum_{n>=1} 1/a(n)^2 = 1.6269683705819...
Sum_{n>=1} 1/a(n) = 23.1034479... = A082839. This so-called Kempner series converges very slowly. For the calculation of the sum, it is helpful to use the following fraction of partial sums, which converges rapidly:
lim_{n->infinity} (Sum_{k=p(n)..p(n+1)-1} 1/a(k)) / (Sum_{k=p(n-1)..p(n)-1} 1/a(k)) = 9/10, where p(n) = (9^n-1)/8, n > 1.
(End)

Extensions

Typos in formula section corrected by Hieronymus Fischer, May 30 2012
Name clarified by Peter Luschny, Jun 20 2025

A000918 a(n) = 2^n - 2.

Original entry on oeis.org

-1, 0, 2, 6, 14, 30, 62, 126, 254, 510, 1022, 2046, 4094, 8190, 16382, 32766, 65534, 131070, 262142, 524286, 1048574, 2097150, 4194302, 8388606, 16777214, 33554430, 67108862, 134217726, 268435454, 536870910, 1073741822, 2147483646, 4294967294, 8589934590, 17179869182, 34359738366, 68719476734, 137438953470
Offset: 0

Views

Author

Keywords

Comments

For n > 1, a(n) is the expected number of tosses of a fair coin to get n-1 consecutive heads. - Pratik Poddar, Feb 04 2011
For n > 2, Sum_{k=1..a(n)} (-1)^binomial(n, k) = A064405(a(n)) + 1 = 0. - Benoit Cloitre, Oct 18 2002
For n > 0, the number of nonempty proper subsets of an n-element set. - Ross La Haye, Feb 07 2004
Numbers j such that abs( Sum_{k=0..j} (-1)^binomial(j, k)*binomial(j + k, j - k) ) = 1. - Benoit Cloitre, Jul 03 2004
For n > 2 this formula also counts edge-rooted forests in a cycle of length n. - Woong Kook (andrewk(AT)math.uri.edu), Sep 08 2004
For n >= 1, conjectured to be the number of integers from 0 to (10^n)-1 that lack 0, 1, 2, 3, 4, 5, 6 and 7 as a digit. - Alexandre Wajnberg, Apr 25 2005
Beginning with a(2) = 2, these are the partial sums of the subsequence of A000079 = 2^n beginning with A000079(1) = 2. Hence for n >= 2 a(n) is the smallest possible sum of exactly one prime, one semiprime, one triprime, ... and one product of exactly n-1 primes. A060389 (partial sums of the primorials, A002110, beginning with A002110(1)=2) is the analog when all the almost primes must also be squarefree. - Rick L. Shepherd, May 20 2005
From the second term on (n >= 1), the binary representation of these numbers is a 0 preceded by (n - 1) 1's. This pattern (0)111...1110 is the "opposite" of the binary 2^n+1: 1000...0001 (cf. A000051). - Alexandre Wajnberg, May 31 2005
The numbers 2^n - 2 (n >= 2) give the positions of 0's in A110146. Also numbers k such that k^(k + 1) = 0 mod (k + 2). - Zak Seidov, Feb 20 2006
Partial sums of A155559. - Zerinvary Lajos, Oct 03 2007
Number of surjections from an n-element set onto a two-element set, with n >= 2. - Mohamed Bouhamida, Dec 15 2007
It appears that these are the numbers n such that 3*A135013(n) = n*(n + 1), thus answering Problem 2 on the Mathematical Olympiad Foundation of Japan, Final Round Problems, Feb 11 1993 (see link Japanese Mathematical Olympiad).
Let P(A) be the power set of an n-element set A and R be a relation on P(A) such that for all x, y of P(A), xRy if x is a proper subset of y or y is a proper subset of x and x and y are disjoint. Then a(n+1) = |R|. - Ross La Haye, Mar 19 2009
The permutohedron Pi_n has 2^n - 2 facets [Pashkovich]. - Jonathan Vos Post, Dec 17 2009
First differences of A005803. - Reinhard Zumkeller, Oct 12 2011
For n >= 1, a(n + 1) is the smallest even number with bit sum n. Cf. A069532. - Jason Kimberley, Nov 01 2011
a(n) is the number of branches of a complete binary tree of n levels. - Denis Lorrain, Dec 16 2011
For n>=1, a(n) is the number of length-n words on alphabet {1,2,3} such that the gap(w)=1. For a word w the gap g(w) is the number of parts missing between the minimal and maximal elements of w. Generally for words on alphabet {1,2,...,m} with g(w)=g>0 the e.g.f. is Sum_{k=g+2..m} (m - k + 1)*binomial((k - 2),g)*(exp(x) - 1)^(k - g). a(3)=6 because we have: 113, 131, 133, 311, 313, 331. Cf. A240506. See the Heubach/Mansour reference. - Geoffrey Critzer, Apr 13 2014
For n > 0, a(n) is the minimal number of internal nodes of a red-black tree of height 2*n-2. See the Oct 02 2015 comment under A027383. - Herbert Eberle, Oct 02 2015
Conjecture: For n>0, a(n) is the least m such that A007814(A000108(m)) = n-1. - L. Edson Jeffery, Nov 27 2015
Actually this follows from the procedure for determining the multiplicity of prime p in C(n) given in A000108 by Franklin T. Adams-Watters: For p=2, the multiplicity is the number of 1 digits minus 1 in the binary representation of n+1. Obviously, the smallest k achieving "number of 1 digits" = k is 2^k-1. Therefore C(2^k-2) is divisible by 2^(k-1) for k > 0 and there is no smaller m for which 2^(k-1) divides C(m) proving the conjecture. - Peter Schorn, Feb 16 2020
For n >= 0, a(n) is the largest number you can write in bijective base-2 (a.k.a. the dyadic system, A007931) with n digits. - Harald Korneliussen, May 18 2019
The terms of this sequence are also the sum of the terms in each row of Pascal's triangle other than the ones. - Harvey P. Dale, Apr 19 2020
For n > 1, binomial(a(n),k) is odd if and only if k is even. - Charlie Marion, Dec 22 2020
For n >= 2, a(n+1) is the number of n X n arrays of 0's and 1's with every 2 X 2 square having density exactly 2. - David desJardins, Oct 27 2022
For n >= 1, a(n+1) is the number of roots of unity in the unique degree-n unramified extension of the 2-adic field Q_2. Note that for each p, the unique degree-n unramified extension of Q_p is the splitting field of x^(p^n) - x, hence containing p^n - 1 roots of unity for p > 2 and 2*(2^n - 1) for p = 2. - Jianing Song, Nov 08 2022

Examples

			a(4) = 14 because the 14 = 6 + 4 + 4 rationals (in lowest terms) for n = 3 are (see the Jun 14 2017 formula above): 1/2, 1, 3/2, 2, 5/2, 3; 1/4, 3/4, 5/4, 7/4; 1/8, 3/8, 5/8, 7/8. - _Wolfdieter Lang_, Jun 14 2017
		

References

  • H. T. Davis, Tables of the Mathematical Functions. Vols. 1 and 2, 2nd ed., 1963, Vol. 3 (with V. J. Fisher), 1962; Principia Press of Trinity Univ., San Antonio, TX, Vol. 2, p. 212.
  • Ralph P. Grimaldi, Discrete and Combinatorial Mathematics: An Applied Introduction, Fifth Edition, Addison-Wesley, 2004, p. 134. - Mohammad K. Azarian, Oct 27 2011
  • S. Heubach and T. Mansour, Combinatorics of Compositions and Words, Chapman and Hall, 2009 page 86, Exercise 3.16.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 33.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • A. H. Voigt, Theorie der Zahlenreihen und der Reihengleichungen, Goschen, Leipzig, 1911, p. 31.

Crossrefs

Row sums of triangle A026998.
Cf. A058809 (3^n-3, n>0).

Programs

  • Haskell
    a000918 = (subtract 2) . (2 ^)
    a000918_list = iterate ((subtract 2) . (* 2) . (+ 2)) (- 1)
    -- Reinhard Zumkeller, Apr 23 2013
    
  • Magma
    [2^n - 2: n in [0..40]]; // Vincenzo Librandi, Jun 23 2011
    
  • Maple
    seq(2^n-2,n=0..20) ;
  • Mathematica
    Table[2^n - 2, {n, 0, 29}] (* Alonso del Arte, Dec 01 2012 *)
  • PARI
    a(n)=2^n-2 \\ Charles R Greathouse IV, Jun 16 2011
    
  • Python
    def A000918(n): return (1<Chai Wah Wu, Jun 10 2025

Formula

a(n) = 2*A000225(n-1).
G.f.: 1/(1 - 2*x) - 2/(1 - x), e.g.f.: (e^x - 1)^2 - 1. - Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 07 2001
For n >= 1, a(n) = A008970(n + 1, 2). - Philippe Deléham, Feb 21 2004
G.f.: (3*x - 1)/((2*x - 1)*(x - 1)). - Simon Plouffe in his 1992 dissertation for the sequence without the leading -1
a(n) = 2*a(n - 1) + 2. - Alexandre Wajnberg, Apr 25 2005
a(n) = A000079(n) - 2. - Omar E. Pol, Dec 16 2008
a(n) = A058896(n)/A052548(n). - Reinhard Zumkeller, Feb 14 2009
a(n) = A164874(n - 1, n - 1) for n > 1. - Reinhard Zumkeller, Aug 29 2009
a(n) = A173787(n,1); a(n) = A028399(2*n)/A052548(n), n > 0. - Reinhard Zumkeller, Feb 28 2010
a(n + 1) = A027383(2*n - 1). - Jason Kimberley, Nov 02 2011
G.f.: U(0) - 1, where U(k) = 1 + x/(2^k + 2^k/(x - 1 - x^2*2^(k + 1)/(x*2^(k + 1) - (k + 1)/U(k + 1) ))); (continued fraction, 3rd kind, 4-step). - Sergei N. Gladkovskii, Dec 01 2012
a(n+1) is the sum of row n in triangle A051601. - Reinhard Zumkeller, Aug 05 2013
a(n+1) = A127330(n,0). - Reinhard Zumkeller, Nov 16 2013
a(n) = Sum_{k=1..n-1} binomial(n, k) for n > 0. - Dan McCandless, Nov 14 2015
From Miquel Cerda, Aug 16 2016: (Start)
a(n) = A000225(n) - 1.
a(n) = A125128(n-1) - A000325(n).
a(n) = A095151(n) - A125128(n) - 1. (End)
a(n+1) = 2*(n + Sum_{j=1..n-1} (n-j)*2^(j-1)), n >= 1. This is the number of the rationals k/2, k = 1..2*n for n >= 1 and (2*k+1)/2^j for j = 2..n, n >= 2, and 2*k+1 < n-(j-1). See the example for n = 3 below. Motivated by the proposal A287012 by Mark Rickert. - Wolfdieter Lang, Jun 14 2017

Extensions

Maple programs fixed by Vaclav Kotesovec, Dec 13 2014
Showing 1-10 of 86 results. Next