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

A115872 Square array where row n gives all solutions k > 0 to the cross-domain congruence n*k = A048720(A065621(n),k), zero sequence (A000004) if no such solutions exist.

Original entry on oeis.org

1, 2, 1, 3, 2, 3, 4, 3, 6, 1, 5, 4, 7, 2, 7, 6, 5, 12, 3, 14, 3, 7, 6, 14, 4, 15, 6, 7, 8, 7, 15, 5, 28, 7, 14, 1, 9, 8, 24, 6, 30, 12, 15, 2, 15, 10, 9, 28, 7, 31, 14, 28, 3, 30, 7, 11, 10, 30, 8, 56, 15, 30, 4, 31, 14, 3, 12, 11, 31, 9, 60, 24, 31, 5, 60, 15, 6, 3, 13, 12, 48, 10, 62, 28, 56, 6, 62, 28, 12, 6, 5, 14, 13, 51, 11, 63, 30, 60, 7, 63, 30, 15, 7, 10, 7
Offset: 1

Views

Author

Antti Karttunen, Feb 07 2006

Keywords

Comments

Here * stands for ordinary multiplication and X means carryless (GF(2)[X]) multiplication (A048720).
Square array is read by descending antidiagonals, as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), etc.
Rows at positions 2^k are 1, 2, 3, ..., (A000027). Row 2n is equal to row n.
Numbers on each row give a subset of positions of zeros at the corresponding row of A284270. - Antti Karttunen, May 08 2019

Examples

			Fifteen initial terms of rows 1 - 19 are listed below:
   1:  1,  2,  3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15, ...
   2:  1,  2,  3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15, ...
   3:  3,  6,  7,  12,  14,  15,  24,  28,  30,  31,  48,  51,  56,  60,  62, ...
   4:  1,  2,  3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15, ...
   5:  7, 14, 15,  28,  30,  31,  56,  60,  62,  63, 112, 120, 124, 126, 127, ...
   6:  3,  6,  7,  12,  14,  15,  24,  28,  30,  31,  48,  51,  56,  60,  62, ...
   7:  7, 14, 15,  28,  30,  31,  56,  60,  62,  63, 112, 120, 124, 126, 127, ...
   8:  1,  2,  3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15, ...
   9: 15, 30, 31,  60,  62,  63, 120, 124, 126, 127, 240, 248, 252, 254, 255, ...
  10:  7, 14, 15,  28,  30,  31,  56,  60,  62,  63, 112, 120, 124, 126, 127, ...
  11:  3,  6, 12,  15,  24,  27,  30,  31,  48,  51,  54,  60,  62,  63,  96, ...
  12:  3,  6,  7,  12,  14,  15,  24,  28,  30,  31,  48,  51,  56,  60,  62, ...
  13:  5, 10, 15,  20,  21,  30,  31,  40,  42,  45,  47,  60,  61,  62,  63, ...
  14:  7, 14, 15,  28,  30,  31,  56,  60,  62,  63, 112, 120, 124, 126, 127, ...
  15: 15, 30, 31,  60,  62,  63, 120, 124, 126, 127, 240, 248, 252, 254, 255, ...
  16:  1,  2,  3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15, ...
  17: 31, 62, 63, 124, 126, 127, 248, 252, 254, 255, 496, 504, 508, 510, 511, ...
  18: 15, 30, 31,  60,  62,  63, 120, 124, 126, 127, 240, 248, 252, 254, 255, ...
  19:  7, 14, 28,  31,  56,  62,  63, 112, 119, 124, 126, 127, 224, 238, 248, ...
		

Crossrefs

Transpose: A114388. First column: A115873.
Cf. also arrays A277320, A277810, A277820, A284270.
A few odd-positioned rows: row 1: A000027, Row 3: A048717, Row 5: A115770 (? Checked for all values less than 2^20), Row 7: A115770, Row 9: A115801, Row 11: A115803, Row 13: A115772, Row 15: A115801 (? Checked for all values less than 2^20), Row 17: A115809, Row 19: A115874, Row 49: A114384, Row 57: A114386.

Programs

  • Mathematica
    X[a_, b_] := Module[{A, B, C, x},
         A = Reverse@IntegerDigits[a, 2];
         B = Reverse@IntegerDigits[b, 2];
         C = Expand[
            Sum[A[[i]]*x^(i-1), {i, 1, Length[A]}]*
            Sum[B[[i]]*x^(i-1), {i, 1, Length[B]}]];
         PolynomialMod[C, 2] /. x -> 2];
    T[n_, k_] := Module[{x = BitXor[n-1, 2n-1], k0 = k},
         For[i = 1, True, i++, If[n*i == X[x, i],
         If[k0 == 1, Return[i], k0--]]]];
    Table[T[n-k+1, k], {n, 1, 14}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Jan 04 2022 *)
  • PARI
    up_to = 120;
    A048720(b,c) = fromdigits(Vec(Pol(binary(b))*Pol(binary(c)))%2, 2);
    A065621(n) = bitxor(n-1,n+n-1);
    A115872sq(n, k) = { my(x = A065621(n)); for(i=1,oo,if((n*i)==A048720(x,i),if(1==k,return(i),k--))); };
    A115872list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, i++; if(i > up_to, return(v)); v[i] = A115872sq(col,(a-(col-1))))); (v); };
    v115872 = A115872list(up_to);
    A115872(n) = v115872[n]; \\ (Slow) - Antti Karttunen, May 08 2019

Extensions

Example section added and the data section extended up to n=105 by Antti Karttunen, May 08 2019

A166926 A000004 preceded by 1, 2, 4.

Original entry on oeis.org

1, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Klaus Brockhaus, Oct 23 2009

Keywords

Comments

Inverse binomial transform of A058331.

Crossrefs

Cf. A000004 (zero sequence), A058331 (2*n^2+1), A130706 (1, 2, 0, 0, 0, 0, ...), A130779 (1, 1, 2, 0, 0, 0, 0, ...).

Programs

  • PARI
    {concat([1,2,4],vector(102))}

Formula

a(0) = 1, a(1) = 2, a(2) = 4, a(n) = 0 for n > 2.
G.f.: (1+2*x+4*x^2).
a(n) = 2^n mod 8. - Ridouane Oudra, Apr 08 2025

A167858 A000004 preceded by 3, 14, 36, 36, 12.

Original entry on oeis.org

3, 14, 36, 36, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Klaus Brockhaus, Nov 13 2009

Keywords

Comments

Inverse binomial transform of A166941/2.

Crossrefs

Cf. A000004 (zero sequence), A166941 (product plus sum of four consecutive nonnegative numbers), A166926 (1, 2, 4, 0, 0, 0, 0, ...), A130706 (1, 2, 0, 0, 0, 0, ...), A130779 (1, 1, 2, 0, 0, 0, 0, ...).

Programs

  • PARI
    {concat([3, 14, 36, 36, 12], vector(98))}

Formula

a(0) = 3, a(1) = 14, a(2) = 36, a(3) = 36, a(4) = 12, a(n) = 0 for n > 4.
G.f.: 3+14*x+36*x^2+36*x^3+12*x^4.

A167876 A000004 preceded by 1, 3, 4, 2.

Original entry on oeis.org

1, 3, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Klaus Brockhaus, Nov 14 2009

Keywords

Comments

Inverse binomial transform of A167875.

Crossrefs

Cf. A000004 (zero sequence), A167875 (one third of product plus sum of three consecutive nonnegative integers), A166926 (1, 2, 4, 0, 0, 0, 0, ...), A130706 (1, 2, 0, 0, 0, 0, ...), A130779 (1, 1, 2, 0, 0, 0, 0, ...), A167858 (3, 14, 36, 36, 12, 0, 0, 0, ...).

Programs

  • PARI
    {concat([1, 3, 4, 2], vector(99))}

Formula

a(0) = 1, a(1) = 3, a(2) = 4, a(3) = 2, a(n) = 0 for n > 3.
G.f.: (1+x)*(1+2*x+2*x^2).

A169585 A000004 preceded by 1, 3.

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, Dec 02 2009

Keywords

Comments

Inverse binomial transform of A016777; second inverse binomial transform of A053220; third inverse binomial transform of A027471 without first term; fourth inverse binomial transform of A081039.

Crossrefs

Cf. A000004 (zero sequence), A016777 (3*n+1), A053220 ((3*n-1)*2^(n-2)), A027471 ((n-1)*3^(n-2)), A081039 ((3*n+4)*4^(n-1), a(0)=1, a(1)=7), A130706 (1, 2, 0, 0, 0, ...), A166926 (1, 2, 4, 0, 0, 0, ...), A130779 (1, 1, 2, 0, 0, 0, ...).

Programs

  • PARI
    {concat([1, 3], vector(103))}

Formula

a(0) = 1, a(1) = 3, a(n) = 0 for n > 1.
G.f.: 1+3*x.
a(n) = 3^n mod 9. - Ridouane Oudra, Apr 09 2025

A167891 A000004 preceded by 1, 4, 2.

Original entry on oeis.org

1, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Klaus Brockhaus, Nov 14 2009

Keywords

Comments

Inverse binomial transform of A028387.

Crossrefs

Cf. A000004 (zero sequence), A028387 (n+(n+1)^2), A166926 (1, 2, 4, 0, 0, 0, 0, ...), A130706 (1, 2, 0, 0, 0, 0, ...), A130779 (1, 1, 2, 0, 0, 0, 0, ...), A167858 (3, 14, 36, 36, 12, 0, 0, 0, ...), A167876 (1, 3, 4, 2, 0, 0, 0, ...).

Programs

  • PARI
    {concat([1, 4, 2], vector(100))}

Formula

a(0) = 1, a(1) = 4, a(2) = 2, a(n) = 0 for n > 2.
G.f.: 1+4*x+2*x^2.

A000012 The simplest sequence of positive numbers: the all 1's sequence.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 16 1994

Keywords

Comments

Number of ways of writing n as a product of primes.
Number of ways of writing n as a sum of distinct powers of 2.
Continued fraction for golden ratio A001622.
Partial sums of A000007 (characteristic function of 0). - Jeremy Gardiner, Sep 08 2002
An example of an infinite sequence of positive integers whose distinct pairwise concatenations are all primes! - Don Reble, Apr 17 2005
Binomial transform of A000007; inverse binomial transform of A000079. - Philippe Deléham, Jul 07 2005
A063524(a(n)) = 1. - Reinhard Zumkeller, Oct 11 2008
For n >= 0, let M(n) be the matrix with first row = (n n+1) and 2nd row = (n+1 n+2). Then a(n) = absolute value of det(M(n)). - K.V.Iyer, Apr 11 2009
The partial sums give the natural numbers (A000027). - Daniel Forgues, May 08 2009
From Enrique Pérez Herrero, Sep 04 2009: (Start)
a(n) is also tau_1(n) where tau_2(n) is A000005.
a(n) is a completely multiplicative arithmetical function.
a(n) is both squarefree and a perfect square. See A005117 and A000290. (End)
Also smallest divisor of n. - Juri-Stepan Gerasimov, Sep 07 2009
Also decimal expansion of 1/9. - Enrique Pérez Herrero, Sep 18 2009; corrected by Klaus Brockhaus, Apr 02 2010
a(n) is also the number of complete graphs on n nodes. - Pablo Chavez (pchavez(AT)cmu.edu), Sep 15 2009
Totally multiplicative sequence with a(p) = 1 for prime p. Totally multiplicative sequence with a(p) = a(p-1) for prime p. - Jaroslav Krizek, Oct 18 2009
n-th prime minus phi(prime(n)); number of divisors of n-th prime minus number of perfect partitions of n-th prime; the number of perfect partitions of n-th prime number; the number of perfect partitions of n-th noncomposite number. - Juri-Stepan Gerasimov, Oct 26 2009
For all n>0, the sequence of limit values for a(n) = n!*Sum_{k>=n} k/(k+1)!. Also, a(n) = n^0. - Harlan J. Brothers, Nov 01 2009
a(n) is also the number of 0-regular graphs on n vertices. - Jason Kimberley, Nov 07 2009
Differences between consecutive n. - Juri-Stepan Gerasimov, Dec 05 2009
From Matthew Vandermast, Oct 31 2010: (Start)
1) When sequence is read as a regular triangular array, T(n,k) is the coefficient of the k-th power in the expansion of (x^(n+1)-1)/(x-1).
2) Sequence can also be read as a uninomial array with rows of length 1, analogous to arrays of binomial, trinomial, etc., coefficients. In a q-nomial array, T(n,k) is the coefficient of the k-th power in the expansion of ((x^q -1)/(x-1))^n, and row n has a sum of q^n and a length of (q-1)*n + 1. (End)
The number of maximal self-avoiding walks from the NW to SW corners of a 2 X n grid.
When considered as a rectangular array, A000012 is a member of the chain of accumulation arrays that includes the multiplication table A003991 of the positive integers. The chain is ... < A185906 < A000007 < A000012 < A003991 < A098358 < A185904 < A185905 < ... (See A144112 for the definition of accumulation array.) - Clark Kimberling, Feb 06 2011
a(n) = A007310(n+1) (Modd 3) := A193680(A007310(n+1)), n>=0. For general Modd n (not to be confused with mod n) see a comment on A203571. The nonnegative members of the three residue classes Modd 3, called [0], [1], and [2], are shown in the array A088520, if there the third row is taken as class [0] after inclusion of 0. - Wolfdieter Lang, Feb 09 2012
Let M = Pascal's triangle without 1's (A014410) and V = a variant of the Bernoulli numbers A027641 but starting [1/2, 1/6, 0, -1/30, ...]. Then M*V = [1, 1, 1, 1, ...]. - Gary W. Adamson, Mar 05 2012
As a lower triangular array, T is an example of the fundamental generalized factorial matrices of A133314. Multiplying each n-th diagonal by t^n gives M(t) = I/(I-t*S) = I + t*S + (t*S)^2 + ... where S is the shift operator A129184, and T = M(1). The inverse of M(t) is obtained by multiplying the first subdiagonal of T by -t and the other subdiagonals by zero, so A167374 is the inverse of T. Multiplying by t^n/n! gives exp(t*S) with inverse exp(-t*S). - Tom Copeland, Nov 10 2012
The original definition of the meter was one ten-millionth of the distance from the Earth's equator to the North Pole. According to that historical definition, the length of one degree of latitude, that is, 60 nautical miles, would be exactly 111111.111... meters. - Jean-François Alcover, Jun 02 2013
Deficiency of 2^n. - Omar E. Pol, Jan 30 2014
Consider n >= 1 nonintersecting spheres each with surface area S. Define point p on sphere S_i to be a "public point" if and only if there exists a point q on sphere S_j, j != i, such that line segment pq INTERSECT S_i = {p} and pq INTERSECT S_j = {q}; otherwise, p is a "private point". The total surface area composed of exactly all private points on all n spheres is a(n)*S = S. ("The Private Planets Problem" in Zeitz.) - Rick L. Shepherd, May 29 2014
For n>0, digital roots of centered 9-gonal numbers (A060544). - Colin Barker, Jan 30 2015
Product of nonzero digits in base-2 representation of n. - Franklin T. Adams-Watters, May 16 2016
Alternating row sums of triangle A104684. - Wolfdieter Lang, Sep 11 2016
A fixed point of the run length transform. - Chai Wah Wu, Oct 21 2016
Length of period of continued fraction for sqrt(A002522) or sqrt(A002496). - A.H.M. Smeets, Oct 10 2017
a(n) is also the determinant of the (n+1) X (n+1) matrix M defined by M(i,j) = binomial(i,j) for 0 <= i,j <= n, since M is a lower triangular matrix with main diagonal all 1's. - Jianing Song, Jul 17 2018
a(n) is also the determinant of the symmetric n X n matrix M defined by M(i,j) = min(i,j) for 1 <= i,j <= n (see Xavier Merlin reference). - Bernard Schott, Dec 05 2018
a(n) is also the determinant of the symmetric n X n matrix M defined by M(i,j) = tau(gcd(i,j)) for 1 <= i,j <= n (see De Koninck & Mercier reference). - Bernard Schott, Dec 08 2020

Examples

			1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + ...)))) = A001622.
1/9 = 0.11111111111111...
From _Wolfdieter Lang_, Feb 09 2012: (Start)
Modd 7 for nonnegative odd numbers not divisible by 3:
A007310: 1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35, 37, ...
Modd 3:  1, 1, 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
(End)
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 186.
  • J.-M. De Koninck & A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 692 pp. 90 and 297, Ellipses, Paris, 2004.
  • Xavier Merlin, Méthodix Algèbre, Exercice 1-a), page 153, Ellipses, Paris, 1995.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 277, 284.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.
  • Paul Zeitz, The Art and Craft of Mathematical Problem Solving, The Great Courses, The Teaching Company, 2010 (DVDs and Course Guidebook, Lecture 6: "Pictures, Recasting, and Points of View", pp. 32-34).

Crossrefs

Programs

  • Haskell
    a000012 = const 1
    a000012_list = repeat 1 -- Reinhard Zumkeller, May 07 2012
    
  • Magma
    [1 : n in [0..100]];
    
  • Maple
    seq(1, i=0..150);
  • Mathematica
    Array[1 &, 50] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 26 2006 *)
  • Maxima
    makelist(1, n, 1, 30); /* Martin Ettl, Nov 07 2012 */
    
  • PARI
    {a(n) = 1};
    
  • Python
    print([1 for n in range(90)]) # Michael S. Branicky, Apr 04 2022

Formula

a(n) = 1.
G.f.: 1/(1-x).
E.g.f.: exp(x).
G.f.: Product_{k>=0} (1 + x^(2^k)). - Zak Seidov, Apr 06 2007
Completely multiplicative with a(p^e) = 1.
Regarded as a square array by antidiagonals, g.f. 1/((1-x)(1-y)), e.g.f. Sum T(n,m) x^n/n! y^m/m! = e^{x+y}, e.g.f. Sum T(n,m) x^n y^m/m! = e^y/(1-x). Regarded as a triangular array, g.f. 1/((1-x)(1-xy)), e.g.f. Sum T(n,m) x^n y^m/m! = e^{xy}/(1-x). - Franklin T. Adams-Watters, Feb 06 2006
Dirichlet g.f.: zeta(s). - Ilya Gutkovskiy, Aug 31 2016
a(n) = Sum_{l=1..n} (-1)^(l+1)*2*cos(Pi*l/(2*n+1)) = 1 identically in n >= 1 (for n=0 one has 0 from the undefined sum). From the Jolley reference, (429) p. 80. Interpretation: consider the n segments between x=0 and the n positive zeros of the Chebyshev polynomials S(2*n, x) (see A049310). Then the sum of the lengths of every other segment starting with the one ending in the largest zero (going from the right to the left) is 1. - Wolfdieter Lang, Sep 01 2016
As a lower triangular matrix, T = M*T^(-1)*M = M*A167374*M, where M(n,k) = (-1)^n A130595(n,k). Note that M = M^(-1). Cf. A118800 and A097805. - Tom Copeland, Nov 15 2016

A010054 a(n) = 1 if n is a triangular number, otherwise 0.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is essentially the q-expansion of the Jacobi theta function theta_2(q). (In theta_2 one has to ignore the initial factor of 2*q^(1/4) and then replace q by q^(1/2). See also A005369.) - N. J. A. Sloane, Aug 03 2014
Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Ramanujan's theta function f(a, b) = Sum_{n=-inf..inf} a^(n*(n+1)/2) * b^(n*(n-1)/2).
This sequence is the concatenation of the base-b digits in the sequence b^n, for any base b >= 2. - Davis Herring (herring(AT)lanl.gov), Nov 16 2004
Number of partitions of n into distinct parts such that the greatest part equals the number of all parts, see also A047993; a(n)=A117195(n,0) for n > 0; a(n) = 1-A117195(n,1) for n > 1. - Reinhard Zumkeller, Mar 03 2006
Triangle T(n,k), 0 <= k <= n, read by rows, given by A000007 DELTA A000004 where DELTA is the operator defined in A084938. - Philippe Deléham, Jan 03 2009
Convolved with A000041 = A022567, the convolution square of A000009. - Gary W. Adamson, Jun 11 2009
A008441(n) = Sum_{k=0..n} a(k)*a(n-k). - Reinhard Zumkeller, Nov 03 2009
Polcoeff inverse with alternate signs = A006950: (1, 1, 1, 2, 3, 4, 5, 7, ...). - Gary W. Adamson, Mar 15 2010
This sequence is related to Ramanujan's two-variable theta functions because this sequence is also the characteristic function of generalized hexagonal numbers. - Omar E. Pol, Jun 08 2012
Number 3 of the 14 primitive eta-products which are holomorphic modular forms of weight 1/2 listed by D. Zagier on page 30 of "The 1-2-3 of Modular Forms". - Michael Somos, May 04 2016
Number of partitions of n into consecutive parts that contain 1 as a part, n >= 1. - Omar E. Pol, Nov 27 2020
The constant whose decimal expansion is this sequence is irrational (Mahler, 1981). The constant whose expansion in any base b >= 2 is this sequence is irrational (Bundschuh, 1984). - Amiram Eldar, Mar 23 2025

Examples

			G.f. = 1 + x + x^3 + x^6 + x^10 + x^15 + x^21 + x^28 + x^36 + x^45 + x^55 + x^66 + ...
G.f. for B(q) = q * A(q^8): q + q^9 + q^25 + q^49 + q^81 + q^121 + q^169 + q^225 + q^289 + q^361 + ...
From _Philippe Deléham_, Jan 04 2008: (Start)
As a triangle this begins:
  1;
  1, 0;
  1, 0, 0;
  1, 0, 0, 0;
  1, 0, 0, 0, 0;
  1, 0, 0, 0, 0, 0;
  ...  (End)
		

References

  • J. H. Conway and N. J. A. Sloane, Sphere Packings, Lattices and Groups, Springer-Verlag, 1999, p. 103.
  • Michael D. Hirschhorn, The Power of q, Springer, 2017. See Psi, page 9.
  • Jules Tannery and Jules Molk, Eléments de la Théorie des Fonctions Elliptiques, Vol. 2, Gauthier-Villars, Paris, 1902; Chelsea, NY, 1972, see p. 27.
  • Edmund T. Whittaker and George N. Watson, A Course of Modern Analysis, Cambridge Univ. Press, 4th ed., 1963, p. 464.

Crossrefs

Number of ways of writing n as a sum of k triangular numbers, for k=1,...: A010054, A008441, A008443, A008438, A008439, A008440, A226252, A007331, A226253, A226254, A226255, A014787, A014809.
Cf. A106507 (reciprocal series).

Programs

  • Clojure
    (def A010054 (mapcat #(cons 1 (replicate % 0)) (range))) ; Tony Zorman, Apr 03 2023
  • Haskell
    a010054 = a010052 . (+ 1) . (* 8)
    a010054_list = concatMap (\x -> 1 : replicate x 0) [0..]
    -- Reinhard Zumkeller, Feb 12 2012, Oct 22 2011, Apr 02 2011
    
  • Magma
    Basis( ModularForms( Gamma0(16), 1/2), 362) [2] ; /* Michael Somos, Jun 10 2014 */
    
  • Maple
    A010054 := proc(n)
        if issqr(1+8*n) then
            1;
        else
            0;
        end if;
    end proc:
    seq(A010054(n),n=0..80) ; # R. J. Mathar, Feb 22 2021
  • Mathematica
    a[ n_] := SquaresR[ 1, 8 n + 1] / 2; (* Michael Somos, Nov 15 2011 *)
    a[ n_] := If[ n < 0, 0, SeriesCoefficient[ (Series[ EllipticTheta[ 3, Log[y] / (2 I), x^2], {x, 0, n + Floor @ Sqrt[n]}] // Normal // TrigToExp) /. {y -> x}, {x, 0, n}]]; (* Michael Somos, Nov 15 2011 *)
    Table[If[IntegerQ[(Sqrt[8n+1]-1)/2],1,0],{n,0,110}] (* Harvey P. Dale, Oct 29 2012 *)
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 2, 0, q^(1/2)] / (2 q^(1/8)), {q, 0, n}]; (* Michael Somos, Jul 01 2014 *)
    Module[{tr=Accumulate[Range[20]]},If[MemberQ[tr,#],1,0]&/@Range[Max[tr]]] (* Harvey P. Dale, Mar 13 2023 *)
  • PARI
    {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^2 + A)^2 / eta(x + A), n))}; /* Michael Somos, Mar 14 2011 */
    
  • PARI
    {a(n) = issquare( 8*n + 1)}; /* Michael Somos, Apr 27 2000 */
    
  • PARI
    a(n) = ispolygonal(n, 3); \\ Michel Marcus, Jan 22 2015
    
  • Python
    from sympy import integer_nthroot
    def A010054(n): return int(integer_nthroot((n<<3)+1,2)[1]) # Chai Wah Wu, Nov 15 2022
    
  • Sage
    # uses[EulerTransform from A166861]
    b = BinaryRecurrenceSequence(-1, 0)
    a = EulerTransform(b)
    print([a(n) for n in range(88)]) # Peter Luschny, Nov 17 2022
    

Formula

Expansion of f(x, x^3) in powers of x where f(, ) is Ramanujan's general theta function.
Expansion of q^(-1) * (phi(q) - phi(q^4)) / 2 in powers of q^8. - Michael Somos, Jul 01 2014
Expansion of q^(-1/8) * eta(q^2)^2 / eta(q) in powers of q. - Michael Somos, Apr 13 2005
Euler transform of period 2 sequence [ 1, -1, ...]. - Michael Somos, Mar 24 2003
Given g.f. A(x), then B(q) = q * A(q^8) satisfies 0 = f(B(q), B(q^2), B(q^3), B(q^6)) where f(u1, u2, u3, u6) = u1*u6^3 + u2*u3^3 - u1*u2^2*u6. - Michael Somos, Apr 13 2005
a(n) = b(8*n + 1) where b()=A098108() is multiplicative with b(2^e) = 0^e, b(p^e) = (1 + (-1)^e) / 2 if p > 2. - Michael Somos, Jun 06 2005
a(n) = A005369(2*n). - Michael Somos, Apr 29 2003
G.f.: theta_2(sqrt(q)) / (2 * q^(1/8)).
G.f.: 1 / (1 - x / (1 + x / (1 + x^1 / (1 - x / (1 + x / (1 + x^2 / (1 - x / (1 + x / (1 + x^3 / ...))))))))). - Michael Somos, May 11 2012
G.f.: Product_{k>0} (1-x^(2*k))/(1-x^(2*k-1)). - Vladeta Jovovic, May 02 2002
a(0)=1; for n>0, a(n) = A002024(n+1)-A002024(n). - Benoit Cloitre, Jan 05 2004
G.f.: Sum_{j>=0} Product_{k=0..j} x^j. - Jon Perry, Mar 30 2004
a(n) = floor((1-cos(Pi*sqrt(8*n+1)))/2). - Carl R. White, Mar 18 2006
a(n) = round(sqrt(2n+1)) - round(sqrt(2n)). - Hieronymus Fischer, Aug 06 2007
a(n) = ceiling(2*sqrt(2n+1)) - floor(2*sqrt(2n)) - 1. - Hieronymus Fischer, Aug 06 2007
a(n) = f(n,0) with f(x,y) = if x > 0 then f(x-y,y+1), otherwise 0^(-x). - Reinhard Zumkeller, Sep 27 2008
a(n) = A035214(n) - 1.
From Mikael Aaltonen, Jan 22 2015: (Start)
Since the characteristic function of s-gonal numbers is given by floor(sqrt(2n/(s-2) + ((s-4)/(2s-4))^2) + (s-4)/(2s-4)) - floor(sqrt(2(n-1)/(s-2) + ((s-4)/(2s-4))^2) + (s-4)/(2s-4)), by setting s = 3 we get the following: For n > 0, a(n) = floor(sqrt(2*n+1/4)-1/2) - floor(sqrt(2*(n-1)+1/4)-1/2).
(End)
a(n) = (-1)^n * A106459(n). - Michael Somos, May 04 2016
G.f. is a period 1 Fourier series which satisfies f(-1 / (16 t)) = 2^(-1/2) (t/i)^(1/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A002448. - Michael Somos, May 05 2016
G.f.: Sum_{n >= 0} x^(n*(n+1)/2) = Product_{n >= 1} (1 - x^n)*(1 + x^n)^2 = Product_{n >= 1} (1 - x^(2*n))*(1 + x^n) = Product_{n >= 1} (1 - x^(2*n))/(1 - x^(2*n-1)). From the sum and product representations of theta_2(0, sqrt(q))/(2*q^(1/8)) function. The last product, given by Vladeta Jovovic above, is obtained from the second to last one by an Euler identity, proved via f(x) := Product_{n >= 1} (1 - x^(2*n-1))*Product_{n >= 1} (1 + x^n) = f(x^2), by moving the odd-indexed factors of the second product to the first product. This leads to f(x) = f(0) = 1. - Wolfdieter Lang, Jul 05 2016
a(0) = 1, a(n) = (1/n)*Sum_{k=1..n} A002129(k)*a(n-k) for n > 0. - Seiichi Manyama, Apr 08 2017
G.f.: Sum_{n >= 0} x^n * Product_{k >= n+1} (1 - x^(2*k)) = 1/(1 - x) * Sum_{n >= 0} x^(3*n) * Product_{k >= n+1} (1 - x^(2*k)) = 1/((1 - x)*(1 - x^3)) * Sum_{n >= 0} x^(5*n) * Product_{k >= n+1} (1 - x^(2*k)) = .... - Peter Bala, Jun 24 2025

Extensions

Additional comments from Michael Somos, Apr 27 2000

A000007 The characteristic function of {0}: a(n) = 0^n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Changing the offset to 1 gives the arithmetical function a(1) = 1, a(n) = 0 for n > 1, the identity function for Dirichlet multiplication (see Apostol). - N. J. A. Sloane
Changing the offset to 1 makes this the decimal expansion of 1. - N. J. A. Sloane, Nov 13 2014
Hankel transform (see A001906 for definition) of A000007 (powers of 0), A000012 (powers of 1), A000079 (powers of 2), A000244 (powers of 3), A000302 (powers of 4), A000351 (powers of 5), A000400 (powers of 6), A000420 (powers of 7), A001018 (powers of 8), A001019 (powers of 9), A011557 (powers of 10), A001020 (powers of 11), etc. - Philippe Deléham, Jul 07 2005
This is the identity sequence with respect to convolution. - David W. Wilson, Oct 30 2006
a(A000004(n)) = 1; a(A000027(n)) = 0. - Reinhard Zumkeller, Oct 12 2008
The alternating sum of the n-th row of Pascal's triangle gives the characteristic function of 0, a(n) = 0^n. - Daniel Forgues, May 25 2010
The number of maximal self-avoiding walks from the NW to SW corners of a 1 X n grid. - Sean A. Irvine, Nov 19 2010
Historically there has been some disagreement as to whether 0^0 = 1. Graphing x^0 seems to support that conclusion, but graphing 0^x instead suggests that 0^0 = 0. Euler and Knuth have argued in favor of 0^0 = 1. For some calculators, 0^0 triggers an error, while in Mathematica, 0^0 is Indeterminate. - Alonso del Arte, Nov 15 2011
Another consequence of changing the offset to 1 is that then this sequence can be described as the sum of Moebius mu(d) for the divisors d of n. - Alonso del Arte, Nov 28 2011
With the convention 0^0 = 1, 0^n = 0 for n > 0, the sequence a(n) = 0^|n-k|, which equals 1 when n = k and is 0 for n >= 0, has g.f. x^k. A000007 is the case k = 0. - George F. Johnson, Mar 08 2013
A fixed point of the run length transform. - Chai Wah Wu, Oct 21 2016

References

  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 30.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.

Crossrefs

Characteristic function of {g}: this sequence (g = 0), A063524 (g = 1), A185012 (g = 2), A185013 (g = 3), A185014 (g = 4), A185015 (g = 5), A185016 (g = 6), A185017 (g = 7). - Jason Kimberley, Oct 14 2011
Characteristic function of multiples of g: this sequence (g = 0), A000012 (g = 1), A059841 (g = 2), A079978 (g = 3), A121262 (g = 4), A079998 (g = 5), A079979 (g = 6), A082784 (g = 7). - Jason Kimberley, Oct 14 2011

Programs

  • Haskell
    a000007 = (0 ^)
    a000007_list = 1 : repeat 0
    -- Reinhard Zumkeller, May 07 2012, Mar 27 2012
    
  • Magma
    [1] cat [0:n in [1..100]]; // Sergei Haller, Dec 21 2006
    
  • Maple
    A000007 := proc(n) if n = 0 then 1 else 0 fi end: seq(A000007(n), n=0..20);
    spec := [A, {A=Z} ]: seq(combstruct[count](spec, size=n+1), n=0..20);
  • Mathematica
    Table[If[n == 0, 1, 0], {n, 0, 99}]
    Table[Boole[n == 0], {n, 0, 99}] (* Michael Somos, Aug 25 2012 *)
    Join[{1},LinearRecurrence[{1},{0},102]] (* Ray Chandler, Jul 30 2015 *)
    PadRight[{1},120,0] (* Harvey P. Dale, Jul 18 2024 *)
  • PARI
    {a(n) = !n};
    
  • Python
    def A000007(n): return int(n==0) # Chai Wah Wu, Feb 04 2022

Formula

Multiplicative with a(p^e) = 0. - David W. Wilson, Sep 01 2001
a(n) = floor(1/(n + 1)). - Franz Vrabec, Aug 24 2005
As a function of Bernoulli numbers (cf. A027641: (1, -1/2, 1/6, 0, -1/30, ...)), triangle A074909 (the beheaded Pascal's triangle) * B_n as a vector = [1, 0, 0, 0, 0, ...]. - Gary W. Adamson, Mar 05 2012
a(n) = Sum_{k = 0..n} exp(2*Pi*i*k/(n+1)) is the sum of the (n+1)th roots of unity. - Franz Vrabec, Nov 09 2012
a(n) = (1-(-1)^(2^n))/2. - Luce ETIENNE, May 05 2015
a(n) = 1 - A057427(n). - Alois P. Heinz, Jan 20 2016
From Ilya Gutkovskiy, Sep 02 2016: (Start)
Binomial transform of A033999.
Inverse binomial transform of A000012. (End)

A000265 Remove all factors of 2 from n; or largest odd divisor of n; or odd part of n.

Original entry on oeis.org

1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1, 17, 9, 19, 5, 21, 11, 23, 3, 25, 13, 27, 7, 29, 15, 31, 1, 33, 17, 35, 9, 37, 19, 39, 5, 41, 21, 43, 11, 45, 23, 47, 3, 49, 25, 51, 13, 53, 27, 55, 7, 57, 29, 59, 15, 61, 31, 63, 1, 65, 33, 67, 17, 69, 35, 71, 9, 73, 37, 75, 19, 77
Offset: 1

Views

Author

Keywords

Comments

When n > 0 is written as k*2^j with k odd then k = A000265(n) and j = A007814(n), so: when n is written as k*2^j - 1 with k odd then k = A000265(n+1) and j = A007814(n+1), when n > 1 is written as k*2^j + 1 with k odd then k = A000265(n-1) and j = A007814(n-1).
Also denominator of 2^n/n (numerator is A075101(n)). - Reinhard Zumkeller, Sep 01 2002
Slope of line connecting (o, a(o)) where o = (2^k)(n-1) + 1 is 2^k and (by design) starts at (1, 1). - Josh Locker (joshlocker(AT)macfora.com), Apr 17 2004
Numerator of n/2^(n-1). - Alexander Adamchuk, Feb 11 2005
From Marco Matosic, Jun 29 2005: (Start)
"The sequence can be arranged in a table:
1
1 3 1
1 5 3 7 1
1 9 5 11 3 13 7 15 1
1 17 9 19 5 21 11 23 3 25 13 27 7 29 15 31 1
Every new row is the previous row interspaced with the continuation of the odd numbers.
Except for the ones; the terms (t) in each column are t+t+/-s = t_+1. Starting from the center column of threes and working to the left the values of s are given by A000265 and working to the right by A000265." (End)
This is a fractal sequence. The odd-numbered elements give the odd natural numbers. If these elements are removed, the original sequence is recovered. - Kerry Mitchell, Dec 07 2005
2k + 1 is the k-th and largest of the subsequence of k terms separating two successive equal entries in a(n). - Lekraj Beedassy, Dec 30 2005
It's not difficult to show that the sum of the first 2^n terms is (4^n + 2)/3. - Nick Hobson, Jan 14 2005
In the table, for each row, (sum of terms between 3 and 1) - (sum of terms between 1 and 3) = A020988. - Eric Desbiaux, May 27 2009
This sequence appears in the analysis of A160469 and A156769, which resemble the numerator and denominator of the Taylor series for tan(x). - Johannes W. Meijer, May 24 2009
Indices n such that a(n) divides 2^n - 1 are listed in A068563. - Max Alekseyev, Aug 25 2013
From Alexander R. Povolotsky, Dec 17 2014: (Start)
With regard to the tabular presentation described in the comment by Marco Matosic: in his drawing, starting with the 3rd row, the first term in the row, which is equal to 1 (or, alternatively the last term in the row, which is also equal to 1), is not in the actual sequence and is added to the drawing as a fictitious term (for the sake of symmetry); an actual A000265(n) could be considered to be a(j,k) (where j >= 1 is the row number and k>=1 is the column subscript), such that a(j,1) = 1:
1
1 3
1 5 3 7
1 9 5 11 3 13 7 15
1 17 9 19 5 21 11 23 3 25 13 27 7 29 15 31
and so on ... .
The relationship between k and j for each row is 1 <= k <= 2^(j-1). In this corrected tabular representation, Marco's notion that "every new row is the previous row interspaced with the continuation of the odd numbers" remains true. (End)
Partitions natural numbers to the same equivalence classes as A064989. That is, for all i, j: a(i) = a(j) <=> A064989(i) = A064989(j). There are dozens of other such sequences (like A003602) for which this also holds: In general, all sequences for which a(2n) = a(n) and the odd bisection is injective. - Antti Karttunen, Apr 15 2017
From Paul Curtz, Feb 19 2019: (Start)
This sequence is the truncated triangle:
1, 1;
3, 1, 5;
3, 7, 1, 9;
5, 11, 3, 13, 7;
15, 1, 17, 9, 19, 5;
21, 11, 23, 3, 25, 13, 27;
7, 29, 15, 31, 1, 33, 17, 35;
...
The first column is A069834. The second column is A213671. The main diagonal is A236999. The first upper diagonal is A125650 without 0.
c(n) = ((n*(n+1)/2))/A069834 = 1, 1, 2, 2, 1, 1, 4, 4, 1, 1, 2, 2, 1, 1, 8, 8, 1, 1, ... for n > 0. n*(n+1)/2 is the rank of A069834. (End)
As well as being multiplicative, a(n) is a strong divisibility sequence, that is, gcd(a(n),a(m)) = a(gcd(n,m)) for n, m >= 1. In particular, a(n) is a divisibility sequence: if n divides m then a(n) divides a(m). - Peter Bala, Feb 27 2019
a(n) is also the map n -> A026741(n) applied at least A007814(n) times. - Federico Provvedi, Dec 14 2021

Examples

			G.f. = x + x^2 + 3*x^3 + x^4 + 5*x^5 + 3*x^6 + 7*x^7 + x^8 + 9*x^9 + 5*x^10 + 11*x^11 + ...
		

References

  • 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

Cf. A049606 (partial products), A135013 (partial sums), A099545 (mod 4), A326937 (Dirichlet inverse).
Cf. A026741 (map), A001511 (converging steps), A038550 (prime index).
Cf. A195056 (Dgf at s=3).

Programs

  • Haskell
    a000265 = until odd (`div` 2)
    -- Reinhard Zumkeller, Jan 08 2013, Apr 08 2011, Oct 14 2010
    
  • Java
    int A000265(n){
        while(n%2==0) n>>=1;
        return n;
    }
    /* Aidan Simmons, Feb 24 2019 */
    
  • Julia
    using IntegerSequences
    [OddPart(n) for n in 1:77] |> println  # Peter Luschny, Sep 25 2021
    
  • Magma
    A000265:= func< n | n/2^Valuation(n,2) >;
    [A000265(n): n in [1..120]]; // G. C. Greubel, Jul 31 2024
    
  • Maple
    A000265:=proc(n) local t1,d; t1:=1; for d from 1 by 2 to n do if n mod d = 0 then t1:=d; fi; od; t1; end: seq(A000265(n), n=1..77);
    A000265 := n -> n/2^padic[ordp](n,2): seq(A000265(n), n=1..77); # Peter Luschny, Nov 26 2010
  • Mathematica
    a[n_Integer /; n > 0] := n/2^IntegerExponent[n, 2]; Array[a, 77] (* Josh Locker *)
    a[ n_] := If[ n == 0, 0, n / 2^IntegerExponent[ n, 2]]; (* Michael Somos, Dec 17 2014 *)
  • PARI
    {a(n) = n >> valuation(n, 2)}; /* Michael Somos, Aug 09 2006, edited by M. F. Hasler, Dec 18 2014 */
    
  • Python
    from _future_ import division
    def A000265(n):
        while not n % 2:
            n //= 2
        return n # Chai Wah Wu, Mar 25 2018
    
  • Python
    def a(n):
        while not n&1: n >>= 1
        return n
    print([a(n) for n in range(1, 78)]) # Michael S. Branicky, Jun 26 2025
    
  • SageMath
    def A000265(n): return n//2^valuation(n,2)
    [A000265(n) for n in (1..121)] # G. C. Greubel, Jul 31 2024
  • Scheme
    (define (A000265 n) (let loop ((n n)) (if (odd? n) n (loop (/ n 2))))) ;; Antti Karttunen, Apr 15 2017
    

Formula

a(n) = if n is odd then n, otherwise a(n/2). - Reinhard Zumkeller, Sep 01 2002
a(n) = n/A006519(n) = 2*A025480(n-1) + 1.
Multiplicative with a(p^e) = 1 if p = 2, p^e if p > 2. - David W. Wilson, Aug 01 2001
a(n) = Sum_{d divides n and d is odd} phi(d). - Vladeta Jovovic, Dec 04 2002
G.f.: -x/(1 - x) + Sum_{k>=0} (2*x^(2^k)/(1 - 2*x^(2^(k+1)) + x^(2^(k+2)))). - Ralf Stephan, Sep 05 2003
(a(k), a(2k), a(3k), ...) = a(k)*(a(1), a(2), a(3), ...) In general, a(n*m) = a(n)*a(m). - Josh Locker (jlocker(AT)mail.rochester.edu), Oct 04 2005
a(n) = Sum_{k=0..n} A127793(n,k)*floor((k+2)/2) (conjecture). - Paul Barry, Jan 29 2007
Dirichlet g.f.: zeta(s-1)*(2^s - 2)/(2^s - 1). - Ralf Stephan, Jun 18 2007
a(A132739(n)) = A132739(a(n)) = A132740(n). - Reinhard Zumkeller, Aug 27 2007
a(n) = 2*A003602(n) - 1. - Franklin T. Adams-Watters, Jul 02 2009
a(n) = n/gcd(2^n,n). (This also shows that the true offset is 0 and a(0) = 0.) - Peter Luschny, Nov 14 2009
a(-n) = -a(n) for all n in Z. - Michael Somos, Sep 19 2011
From Reinhard Zumkeller, May 01 2012: (Start)
A182469(n, k) = A027750(a(n), k), k = 1..A001227(n).
a(n) = A182469(n, A001227(n)). (End)
a((2*n-1)*2^p) = 2*n - 1, p >= 0 and n >= 1. - Johannes W. Meijer, Feb 05 2013
G.f.: G(0)/(1 - 2*x^2 + x^4) - 1/(1 - x), where G(k) = 1 + 1/(1 - x^(2^k)*(1 - 2*x^(2^(k+1)) + x^(2^(k+2)))/(x^(2^k)*(1 - 2*x^(2^(k+1)) + x^(2^(k+2))) + (1 - 2*x^(2^(k+2)) + x^(2^(k+3)))/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Aug 06 2013
a(n) = A003961(A064989(n)). - Antti Karttunen, Apr 15 2017
Completely multiplicative with a(2) = 1 and a(p) = p for prime p > 2, i.e., the sequence b(n) = a(n) * A008683(n) for n > 0 is the Dirichlet inverse of a(n). - Werner Schulte, Jul 08 2018
From Peter Bala, Feb 27 2019: (Start)
O.g.f.: F(x) - F(x^2) - F(x^4) - F(x^8) - ..., where F(x) = x/(1 - x)^2 is the generating function for the positive integers.
O.g.f. for reciprocals: Sum_{n >= 1} x^n/a(n) = L(x) + (1/2)*L(x^2) + (1/2)*L(x^4) + (1/2)*L(x^8) + ..., where L(x) = log(1/(1 - x)).
Sum_{n >= 1} x^n/a(n) = 1/2*log(G(x)), where G(x) = 1 + 2*x + 4*x^2 + 6*x^3 + 10*x^4 + ... is the o.g.f. of A000123. (End)
O.g.f.: Sum_{n >= 1} phi(2*n-1)*x^(2*n-1)/(1 - x^(2*n-1)), where phi(n) is the Euler totient function A000010. - Peter Bala, Mar 22 2019
a(n) = A049606(n) / A049606(n-1). - Flávio V. Fernandes, Dec 08 2020
a(n) = numerator of n/2^(floor(n/2)). - Federico Provvedi, Dec 14 2021
a(n) = Sum_{d divides n} (-1)^(d+1)*phi(2*n/d). - Peter Bala, Jan 14 2024
a(n) = A030101(A030101(n)). - Darío Clavijo, Sep 19 2024

Extensions

Additional comments from Henry Bottomley, Mar 02 2000
More terms from Larry Reeves (larryr(AT)acm.org), Mar 14 2000
Name clarified by David A. Corneth, Apr 15 2017
Showing 1-10 of 350 results. Next