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

A001511 The ruler function: exponent of the highest power of 2 dividing 2n. Equivalently, the 2-adic valuation of 2n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of 2's dividing 2*n.
a(n) is equivalently the exponent of the smallest power of 2 which does not divide n. - David James Sycamore, Oct 02 2023
a(n) - 1 is the number of trailing zeros in the binary expansion of n.
If you are counting in binary and the least significant bit is numbered 1, the next bit is 2, etc., a(n) is the bit that is incremented when increasing from n-1 to n. - Jud McCranie, Apr 26 2004
Number of steps to reach an integer starting with (n+1)/2 and using the map x -> x*ceiling(x) (cf. A073524).
a(n) is the number of the disk to be moved at the n-th step of the optimal solution to Towers of Hanoi problem (comment from Andreas M. Hinz).
Shows which bit to flip when creating the binary reflected Gray code (bits are numbered from the right, offset is 1). This is essentially equivalent to Hinz's comment. - Adam Kertesz, Jul 28 2001
a(n) is the Hamming distance between n and n-1 (in binary). This is equivalent to Kertesz's comments above. - Tak-Shing Chan (chan12(AT)alumni.usc.edu), Feb 25 2003
Let S(0) = {1}, S(n) = {S(n-1), S(n-1)-{x}, x+1} where x = last term of S(n-1); sequence gives S(infinity). - Benoit Cloitre, Jun 14 2003
The sum of all terms up to and including the first occurrence of m is 2^m-1. - Donald Sampson (marsquo(AT)hotmail.com), Dec 01 2003
m appears every 2^m terms starting with the 2^(m-1)th term. - Donald Sampson (marsquo(AT)hotmail.com), Dec 08 2003
Sequence read mod 4 gives A092412. - Philippe Deléham, Mar 28 2004
If q = 2n/2^A001511(n) and if b(m) is defined by b(0)=q-1 and b(m)=2*b(m-1)+1, then 2n = b(A001511(n)) + 1. - Gerald McGarvey, Dec 18 2004
Repeating pattern ABACABADABACABAE ... - Jeremy Gardiner, Jan 16 2005
Relation to C(n) = Collatz function iteration using only odd steps: a(n) is the number of right bits set in binary representation of A004767(n) (numbers of the form 4*m+3). So for m=A004767(n) it follows that there are exactly a(n) recursive steps where m
Between every two instances of any positive integer m there are exactly m distinct values (1 through m-1 and one value greater than m). - Franklin T. Adams-Watters, Sep 18 2006
Number of divisors of n of the form 2^k. - Giovanni Teofilatto, Jul 25 2007
Every prefix up to (but not including) the first occurrence of some k >= 2 is a palindrome. - Gary W. Adamson, Sep 24 2008
1 interleaved with (2 interleaved with (3 interleaved with ( ... ))). - Eric D. Burgess (ericdb(AT)gmail.com), Oct 17 2009
A054525 (Möbius transform) * A001511 = A036987 = A047999^(-1) * A001511. - Gary W. Adamson, Oct 26 2009
Equals A051731 * A036987, (inverse Möbius transform of the Fredholm-Rueppel sequence) = A047999 * A036987. - Gary W. Adamson, Oct 26 2009
Cf. A173238, showing links between generalized ruler functions and A000041. - Gary W. Adamson, Feb 14 2010
Given A000041, P(x) = A(x)/A(x^2) with P(x) = (1 + x + 2x^2 + 3x^3 + 5x^4 + 7x^5 + ...), A(x) = (1 + x + 3x^2 + 4x^3 + 10x^4 + 13x^5 + ...), A(x^2) = (1 + x^2 + 3x^4 + 4x^6 + 10x^8 + ...), where A092119 = (1, 1, 3, 4, 10, ...) = Euler transform of the ruler sequence, A001511. - Gary W. Adamson, Feb 11 2010
Subtracting 1 from every term and deleting any 0's yields the same sequence, A001511. - Ben Branman, Dec 28 2011
In the listing of the compositions of n as lists in lexicographic order, a(k) is the last part of composition(k) for all k <= 2^(n-1) and all n, see example. - Joerg Arndt, Nov 12 2012
According to Hinz, et al. (see links), this sequence was studied by Louis Gros in his 1872 pamphlet "Théorie du Baguenodier" and has therefore been called the Gros sequence.
First n terms comprise least squarefree word of length n using positive integers, where "squarefree" means that the word contains no consecutive identical subwords; e.g., 1 contains no square; 11 contains a square but 12 does not; 121 contains no square; both 1211 and 1212 have squares but 1213 does not; etc. - Clark Kimberling, Sep 05 2013
Length of 0-run starting from 2 (10, 100, 110, 1000, 1010, ...), or length of 1-run starting from 1 (1, 11, 101, 111, 1001, 1011, ...) of every second number, from right to left in binary representation. - Armands Strazds, Apr 13 2017
a(n) is also the frequency of the largest part in the integer partition having viabin number n. The viabin number of an integer partition is defined in the following way. Consider the southeast border of the Ferrers board of the integer partition and consider the binary number obtained by replacing each east step with 1 and each north step, except the last one, with 0. The corresponding decimal form is, by definition, the viabin number of the given integer partition. "Viabin" is coined from "via binary". For example, consider the integer partition [2,2,2,1]. The southeast border of its Ferrers board yields 10100, leading to the viabin number 20. - Emeric Deutsch, Jul 24 2017
As A000005(n) equals the number of even divisors of 2n and A001227(n) = A001227(2n), the formula A001511(n) = A000005(n)/A001227(n) might be read as "The number of even divisors of 2n is always divisible by the number of odd divisors of 2n" (where number of divisors means sum of zeroth powers of divisors). Conjecture: For any nonnegative integer k, the sum of the k-th powers of even divisors of n is always divisible by the sum of the k-th powers of odd divisors of n. - Ivan N. Ianakiev, Jul 06 2019
From Benoit Cloitre, Jul 14 2022: (Start)
To construct the sequence, start from 1's separated by a place 1,,1,,1,,1,,1,,1,,1,,1,,1,,1,,1,,1,,1,,1,...
Then put the 2's in every other remaining place
1,2,1,,1,2,1,,1,2,1,,1,2,1,,1,2,1,,1,2,1,,1,2,1,...
Then the 3's in every other remaining place
1,2,1,3,1,2,1,,1,2,1,3,1,2,1,,1,2,1,3,1,2,1,,1,2,1,...
Then the 4's in every other remaining place
1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,,1,2,1,3,1,2,1,4,1,2,1,...
By iterating this process, we get the ruler function 1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,5,1,2,1,3,1,2,1,4,1,2,1,... (End)
a(n) is the least positive integer k for which there does not exist i+j=n and a(i)=a(j)=k (cf. A322523). - Rémy Sigrist and Jianing Song, Aug 23 2022
a(n) is the smallest positive integer that does not occur in the coincidences of the sequence so far a(1..n-1) and its reverse. - Neal Gersh Tolunsky, Jan 18 2023
The geometric mean of this sequence approaches the Somos constant (A112302). - Jwalin Bhatt, Jan 31 2025

Examples

			For example, 2^1|2, 2^2|4, 2^1|6, 2^3|8, 2^1|10, 2^2|12, ... giving the initial terms 1, 2, 1, 3, 1, 2, ...
From _Omar E. Pol_, Jun 12 2009: (Start)
Triangle begins:
1;
2,1;
3,1,2,1;
4,1,2,1,3,1,2,1;
5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1;
6,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1;
7,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,6,1,2,1,3,...
(End)
S(0) = {} S(1) = 1 S(2) = 1, 2, 1 S(3) = 1, 2, 1, 3, 1, 2, 1 S(4) = 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1. - Yann David (yann_david(AT)hotmail.com), Mar 21 2010
From _Joerg Arndt_, Nov 12 2012: (Start)
The 16 compositions of 5 as lists in lexicographic order:
[ n]  a(n)  composition
[ 1]  [ 1]  [ 1 1 1 1 1 ]
[ 2]  [ 2]  [ 1 1 1 2 ]
[ 3]  [ 1]  [ 1 1 2 1 ]
[ 4]  [ 3]  [ 1 1 3 ]
[ 5]  [ 1]  [ 1 2 1 1 ]
[ 6]  [ 2]  [ 1 2 2 ]
[ 7]  [ 1]  [ 1 3 1 ]
[ 8]  [ 4]  [ 1 4 ]
[ 9]  [ 1]  [ 2 1 1 1 ]
[10]  [ 2]  [ 2 1 2 ]
[11]  [ 1]  [ 2 2 1 ]
[12]  [ 3]  [ 2 3 ]
[13]  [ 1]  [ 3 1 1 ]
[14]  [ 2]  [ 3 2 ]
[15]  [ 1]  [ 4 1 ]
[16]  [ 5]  [ 5 ]
a(n) is the last part in each list.
(End)
From _Omar E. Pol_, Aug 20 2013: (Start)
Also written as a triangle in which the right border gives A000027 and row lengths give A011782 and row sums give A000079 the sequence begins:
1;
2;
1,3;
1,2,1,4;
1,2,1,3,1,2,1,5;
1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,6;
1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1,7;
(End)
G.f. = x + 2*x^2 + x^3 + 3*x^4 + x^5 + 2*x^6 + x^7 + 4*x^8 + x^9 + 2*x^10 + ...
		

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003.
  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 2nd ed., 2001-2003; see Dim- and Dim+ on p. 98; Dividing Rulers, on pp. 436-437; The Ruler Game, pp. 469-470; Ruler Fours, Fives, ... Fifteens on p. 470.
  • L. Gros, Théorie du Baguenodier, Aimé Vingtrinier, Lyon, 1872.
  • R. K. Guy, Unsolved Problems in Number Theory, Springer, 1st edition, 1981. See section E22.
  • A. M. Hinz, The Tower of Hanoi, in Algebras and combinatorics (Hong Kong, 1997), 277-289, Springer, Singapore, 1999.
  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.1.3, Problem 41, p. 589.
  • Andrew Schloss, "Towers of Hanoi" composition, in The Digital Domain. Elektra/Asylum Records 9 60303-2, 1983. Works by Jaffe (Finale to "Silicon Valley Breakdown"), McNabb ("Love in the Asylum"), Schloss ("Towers of Hanoi"), Mattox ("Shaman"), Rush, Moorer ("Lions are Growing") and others.
  • 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

Column 1 of table A050600.
Sequence read mod 2 gives A035263.
Sequence is bisection of A007814, A050603, A050604, A067029, A089309.
This is Guy Steele's sequence GS(4, 2) (see A135416).
Cf. A005187 (partial sums), A085058 (bisection), A112302 (geometric mean), A171977 (2^a(n)).
Cf. A287896, A002487, A209229 (Mobius trans.), A092673 (Dirichlet inv.).
Cf. generalized ruler functions for k=3,4,5: A051064, A115362, A055457.

Programs

  • Haskell
    a001511 n = length $ takeWhile ((== 0) . (mod n)) a000079_list
    -- Reinhard Zumkeller, Sep 27 2011
    
  • Haskell
    a001511 n | odd n = 1 | otherwise = 1 + a001511 (n `div` 2)
    -- Walt Rorie-Baety, Mar 22 2013
    
  • MATLAB
    nmax=5;r=1;for n=2:nmax;r=[r n r];end % Adriano Caroli, Feb 26 2016
    
  • Magma
    [Valuation(2*n,2): n in [1..105]]; // Bruno Berselli, Nov 23 2015
    
  • Maple
    A001511 := n->2-wt(n)+wt(n-1); # where wt is defined in A000120
    # This is the binary logarithm of the denominator of (256^n-1)B_{8n}/n, in Maple parlance a := n -> log[2](denom((256^n-1)*bernoulli(8*n)/n)). - Peter Luschny, May 31 2009
    A001511 := n -> padic[ordp](2*n,2): seq(A001511(n), n=1..105);  # Peter Luschny, Nov 26 2010
    a:= n-> ilog2((Bits[Xor](2*n, 2*n-1)+1)/2): seq(a(n), n=1..50);  # Gary Detlefs, Dec 13 2018
  • Mathematica
    Array[ If[ Mod[ #, 2] == 0, FactorInteger[ # ][[1, 2]], 0] &, 105] + 1 (* or *)
    Nest[ Flatten[ # /. a_Integer -> {1, a + 1}] &, {1}, 7] (* Robert G. Wilson v, Mar 04 2005 *)
    IntegerExponent[2*n, 2] (* Alexander R. Povolotsky, Aug 19 2011 *)
    myHammingDistance[n_, m_] := Module[{g = Max[m, n], h = Min[m, n]}, b1 = IntegerDigits[g, 2]; b2 = IntegerDigits[h, 2, Length[b1]]; HammingDistance[b1, b2]] (* Vladimir Shevelev A206853 *) Table[ myHammingDistance[n, n - 1], {n, 111}] (* Robert G. Wilson v, Apr 05 2012 *)
    Table[Position[Reverse[IntegerDigits[n,2]],1,1,1],{n,110}]//Flatten (* Harvey P. Dale, Aug 18 2017 *)
  • PARI
    a(n) = sum(k=0,floor(log(n)/log(2)),floor(n/2^k)-floor((n-1)/2^k)) /* Ralf Stephan */
    
  • PARI
    a(n)=if(n%2,1,factor(n)[1,2]+1) /* Jon Perry, Jun 06 2004 */
    
  • PARI
    {a(n) = if( n, valuation(n, 2) + 1, 0)}; /* Michael Somos, Sep 30 2006 */
    
  • PARI
    {a(n)=if(n==1,1,polcoeff(x-sum(k=1, n-1, a(k)*x^k*(1-x^k)*(1-x+x*O(x^n))), n))} /* Paul D. Hanna, Jun 22 2007 */
    
  • Python
    def a(n): return bin(n)[2:][::-1].index("1") + 1 # Indranil Ghosh, May 11 2017
    
  • Python
    A001511 = lambda n: (n&-n).bit_length() # M. F. Hasler, Apr 09 2020
    
  • Python
    def A001511(n): return (~n & n-1).bit_length()+1 # Chai Wah Wu, Jul 01 2022
    
  • Sage
    [valuation(2*n,2) for n in (1..105)]  # Bruno Berselli, Nov 23 2015
    
  • Scheme
    (define (A001511 n) (let loop ((n n) (e 1)) (if (odd? n) e (loop (/ n 2) (+ 1 e))))) ;; Antti Karttunen, Oct 06 2017

Formula

a(n) = A007814(n) + 1 = A007814(2*n).
a(2*n+1) = 1; a(2*n) = 1 + a(n). - Philippe Deléham, Dec 08 2003
a(n) = 2 - A000120(n) + A000120(n-1), n >= 1. - Daniele Parisse
a(n) = 1 + log_2(abs(A003188(n) - A003188(n-1))).
Multiplicative with a(p^e) = e+1 if p = 2; 1 if p > 2. - David W. Wilson, Aug 01 2001
For any real x > 1/2: lim_{N->infinity} (1/N)*Sum_{n=1..N} x^(-a(n)) = 1/(2*x-1); also lim_{N->infinity} (1/N)*Sum_{n=1..N} 1/a(n) = log(2). - Benoit Cloitre, Nov 16 2001
s(n) = Sum_{k=1..n} a(k) is asymptotic to 2*n since s(n) = 2*n - A000120(n). - Benoit Cloitre, Aug 31 2002
For any n >= 0, for any m >= 1, a(2^m*n + 2^(m-1)) = m. - Benoit Cloitre, Nov 24 2002
a(n) = Sum_{d divides n and d is odd} mu(d)*tau(n/d). - Vladeta Jovovic, Dec 04 2002
G.f.: A(x) = Sum_{k>=0} x^(2^k)/(1-x^(2^k)). - Ralf Stephan, Dec 24 2002
a(1) = 1; for n > 1, a(n) = a(n-1) + (-1)^n*a(floor(n/2)). - Vladeta Jovovic, Apr 25 2003
A fixed point of the mapping 1->12; 2->13; 3->14; 4->15; 5->16; ... . - Philippe Deléham, Dec 13 2003
Product_{k>0} (1+x^k)^a(k) is g.f. for A000041(). - Vladeta Jovovic, Mar 26 2004
G.f. A(x) satisfies A(x) = A(x^2) + x/(1-x). - Franklin T. Adams-Watters, Feb 09 2006
a(A118413(n,k)) = A002260(n,k); = a(A118416(n,k)) = A002024(n,k); a(A014480(n)) = A003602(A014480(n)). - Reinhard Zumkeller, Apr 27 2006
Ordinal transform of A003602. - Franklin T. Adams-Watters, Aug 28 2006 (The ordinal transform of a sequence b_0, b_1, b_2, ... is the sequence a_0, a_1, a_2, ... where a_n is the number of times b_n has occurred in {b_0 ... b_n}.)
Could be extended to n <= 0 using a(-n) = a(n), a(0) = 0, a(2*n) = a(n)+1 unless n=0. - Michael Somos, Sep 30 2006
A094267(2*n) = A050603(2*n) = A050603(2*n + 1) = a(n). - Michael Somos, Sep 30 2006
Sequence = A129360 * A000005 = M*V, where M = an infinite lower triangular matrix and V = d(n) as a vector: [1, 2, 2, 3, 2, 4, ...]. - Gary W. Adamson, Apr 15 2007
Row sums of triangle A130093. - Gary W. Adamson, May 13 2007
Dirichlet g.f.: zeta(s)*2^s/(2^s-1). - Ralf Stephan, Jun 17 2007
a(n) = -Sum_{d divides n} mu(2*d)*tau(n/d). - Benoit Cloitre, Jun 21 2007
G.f.: x/(1-x) = Sum_{n>=1} a(n)*x^n*( 1 - x^n ). - Paul D. Hanna, Jun 22 2007
2*n = 2^a(n)* A000265(n). - Eric Desbiaux, May 14 2009 [corrected by Alejandro Erickson, Apr 17 2012]
Multiplicative with a(2^k) = k + 1, a(p^k) = 1 for any odd prime p. - Franklin T. Adams-Watters, Jun 09 2009
With S(n): 2^n - 1 first elements of the sequence then S(0) = {} (empty list) and if n > 0, S(n) = S(n-1), n, S(n-1). - Yann David (yann_david(AT)hotmail.com), Mar 21 2010
a(n) = log_2(A046161(n)/A046161(n-1)). - Johannes W. Meijer, Nov 04 2012
a((2*n-1)*2^p) = p+1, p >= 0 and n >= 1. - Johannes W. Meijer, Feb 05 2013
a(n+1) = 1 + Sum_{j=0..ceiling(log_2(n+1))} (j * (1 - abs(sign((n mod 2^(j + 1)) - 2^j + 1)))). - Enrico Borba, Oct 01 2015
Conjecture: a(n) = A181988(n)/A003602(n). - L. Edson Jeffery, Nov 21 2015
a(n) = log_2(A006519(n)) + 1. - Doug Bell, Jun 02 2017
Inverse Moebius transform of A209229. - Andrew Howroyd, Aug 04 2018
a(n) = 1 + (A183063(n)/A001227(n)). - Omar E. Pol, Nov 06 2018 (after Franklin T. Adams-Watters)
a(n) = log_2((Xor(2*n,2*n-1)+1)/2). - Gary Detlefs, Dec 13 2018
(2^(a(n)-1)-1)*(n mod 4) = 2*floor(((n+1) mod 4)/3). - Gary Detlefs, Dec 14 2018
a(n) = A000005(n)/A001227(n). - Ivan N. Ianakiev, Jul 05 2019
a(n) = Sum_{j=1..r} (j/2^j)*(Product_{k=1..j} (1 - (-1)^floor( (n+2^(j-1))/2^(k-1) ))), for n < a predefined 2^r. - Adriano Caroli, Sep 30 2019

Extensions

Name edited following suggestion by David James Sycamore, Oct 05 2023

A002260 Triangle read by rows: T(n,k) = k for n >= 1, k = 1..n.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
Offset: 1

Author

Angele Hamel (amh(AT)maths.soton.ac.uk)

Comments

Old name: integers 1 to k followed by integers 1 to k+1 etc. (a fractal sequence).
Start counting again and again.
This is a "doubly fractal sequence" - see the Franklin T. Adams-Watters link.
The PARI functions t1, t2 can be used to read a square array T(n,k) (n >= 1, k >= 1) by antidiagonals downwards: n -> T(t1(n), t2(n)). - Michael Somos, Aug 23 2002
Reading this sequence as the antidiagonals of a rectangular array, row n is (n,n,n,...); this is the weight array (Cf. A144112) of the array A127779 (rectangular). - Clark Kimberling, Sep 16 2008
The upper trim of an arbitrary fractal sequence s is s, but the lower trim of s, although a fractal sequence, need not be s itself. However, the lower trim of A002260 is A002260. (The upper trim of s is what remains after the first occurrence of each term is deleted; the lower trim of s is what remains after all 0's are deleted from the sequence s-1.) - Clark Kimberling, Nov 02 2009
Eigensequence of the triangle = A001710 starting (1, 3, 12, 60, 360, ...). - Gary W. Adamson, Aug 02 2010
The triangle sums, see A180662 for their definitions, link this triangle of natural numbers with twenty-three different sequences, see the crossrefs. The mirror image of this triangle is A004736. - Johannes W. Meijer, Sep 22 2010
A002260 is the self-fission of the polynomial sequence (q(n,x)), where q(n,x) = x^n + x^(n-1) + ... + x + 1. See A193842 for the definition of fission. - Clark Kimberling, Aug 07 2011
Sequence B is called a reluctant sequence of sequence A, if B is triangle array read by rows: row number k coincides with first k elements of the sequence A. Sequence A002260 is reluctant sequence of sequence 1,2,3,... (A000027). - Boris Putievskiy, Dec 12 2012
This is the maximal sequence of positive integers, such that once an integer k has occurred, the number of k's always exceeds the number of (k+1)'s for the remainder of the sequence, with the first occurrence of the integers being in order. - Franklin T. Adams-Watters, Oct 23 2013
A002260 are the k antidiagonal numerators of rationals in Cantor's proof of 1-to-1 correspondence between rationals and naturals; the denominators are k-numerator+1. - Adriano Caroli, Mar 24 2015
T(n,k) gives the distance to the largest triangular number < n. - Ctibor O. Zizka, Apr 09 2020

Examples

			First six rows:
  1
  1   2
  1   2   3
  1   2   3   4
  1   2   3   4   5
  1   2   3   4   5   6
		

References

  • Clark Kimberling, "Fractal sequences and interspersions," Ars Combinatoria 45 (1997) 157-168. (Introduces upper trimming, lower trimming, and signature sequences.)
  • M. Myers, Smarandache Crescendo Subsequences, R. H. Wilde, An Anthology in Memoriam, Bristol Banner Books, Bristol, 1998, p. 19.
  • F. Smarandache, Sequences of Numbers Involved in Unsolved Problems, Hexis, Phoenix, 2006.

Crossrefs

Cf. A140756 (alternating signs).
Triangle sums (see the comments): A000217 (Row1, Kn11); A004526 (Row2); A000096 (Kn12); A055998 (Kn13); A055999 (Kn14); A056000 (Kn15); A056115 (Kn16); A056119 (Kn17); A056121 (Kn18); A056126 (Kn19); A051942 (Kn110); A101859 (Kn111); A132754 (Kn112); A132755 (Kn113); A132756 (Kn114); A132757 (Kn115); A132758 (Kn116); A002620 (Kn21); A000290 (Kn3); A001840 (Ca2); A000326 (Ca3); A001972 (Gi2); A000384 (Gi3).
Cf. A108872.

Programs

  • Haskell
    a002260 n k = k
    a002260_row n = [1..n]
    a002260_tabl = iterate (\row -> map (+ 1) (0 : row)) [1]
    -- Reinhard Zumkeller, Aug 04 2014, Jul 03 2012
    
  • Maple
    at:=0; for n from 1 to 150 do for i from 1 to n do at:=at+1; lprint(at,i); od: od: # N. J. A. Sloane, Nov 01 2006
    seq(seq(i,i=1..k),k=1..13); # Peter Luschny, Jul 06 2009
  • Mathematica
    FoldList[{#1, #2} &, 1, Range[2, 13]] // Flatten (* Robert G. Wilson v, May 10 2011 *)
    Flatten[Table[Range[n],{n,20}]] (* Harvey P. Dale, Jun 20 2013 *)
  • Maxima
    T(n,k):=sum((i+k)*binomial(i+k-1,i)*binomial(k,n-i-k+1)*(-1)^(n-i-k+1),i,max(0,n+1-2*k),n-k+1); /* Vladimir Kruchinin, Oct 18 2013 */
    
  • PARI
    t1(n)=n-binomial(floor(1/2+sqrt(2*n)),2) /* this sequence */
    
  • PARI
    A002260(n)=n-binomial((sqrtint(8*n)+1)\2,2) \\ M. F. Hasler, Mar 10 2014
    
  • Python
    from math import isqrt, comb
    def A002260(n): return n-comb((m:=isqrt(k:=n<<1))+(k>m*(m+1)),2) # Chai Wah Wu, Nov 08 2024

Formula

a(n) = 1 + A002262(n).
n-th term is n - m*(m+1)/2 + 1, where m = floor((sqrt(8*n+1) - 1) / 2).
The above formula is for offset 0; for offset 1, use a(n) = n-m*(m+1)/2 where m = floor((-1+sqrt(8*n-7))/2). - Clark Kimberling, Jun 14 2011
a(k * (k + 1) / 2 + i) = i for k >= 0 and 0 < i <= k + 1. - Reinhard Zumkeller, Aug 14 2001
a(n) = (2*n + round(sqrt(2*n)) - round(sqrt(2*n))^2)/2. - Brian Tenneson, Oct 11 2003
a(n) = n - binomial(floor((1+sqrt(8*n))/2), 2). - Paul Barry, May 25 2004
T(n,k) = A001511(A118413(n,k)); T(n,k) = A003602(A118416(n,k)). - Reinhard Zumkeller, Apr 27 2006
a(A000217(n)) = A000217(n) - A000217(n-1), a(A000217(n-1) + 1) = 1, a(A000217(n) - 1) = A000217(n) - A000217(n-1) - 1. - Alexander R. Povolotsky, May 28 2008
a(A169581(n)) = A038566(n). - Reinhard Zumkeller, Dec 02 2009
T(n,k) = Sum_{i=1..k} i*binomial(k,i)*binomial(n-k,n-i) (regarded as triangle, see the example). - Mircea Merca, Apr 11 2012
T(n,k) = Sum_{i=max(0,n+1-2*k)..n-k+1} (i+k)*binomial(i+k-1,i)*binomial(k,n-i-k+1)*(-1)^(n-i-k+1). - Vladimir Kruchinin, Oct 18 2013
G.f.: x*y / ((1 - x) * (1 - x*y)^2) = Sum_{n,k>0} T(n,k) * x^n * y^k. - Michael Somos, Sep 17 2014
a(n) = n - S(n) where S(n) = sum of distinct terms in {a(1), a(2), ..., a(n-1)}. - David James Sycamore, Mar 10 2025

Extensions

More terms from Reinhard Zumkeller, Apr 27 2006
Incorrect program removed by Franklin T. Adams-Watters, Mar 19 2010
New name from Omar E. Pol, Jul 15 2012

A002024 k appears k times; a(n) = floor(sqrt(2n) + 1/2).

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13
Offset: 1

Keywords

Comments

Integer inverse function of the triangular numbers A000217. The function trinv(n) = floor((1+sqrt(1+8n))/2), n >= 0, gives the values 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, ..., that is, the same sequence with offset 0. - N. J. A. Sloane, Jun 21 2009
Array T(k,n) = n+k-1 read by antidiagonals.
Eigensequence of the triangle = A001563. - Gary W. Adamson, Dec 29 2008
Can apparently also be defined via a(n+1)=b(n) for n >= 2 where b(0)=b(1)=1 and b(n) = b(n-b(n-2))+1. Tested to be correct for all n <= 150000. - José María Grau Ribas, Jun 10 2011
For any n >= 0, a(n+1) is the least integer m such that A000217(m)=m(m+1)/2 is larger than n. This is useful when enumerating representations of n as difference of triangular numbers; see also A234813. - M. F. Hasler, Apr 19 2014
Number of binary digits of A023758, i.e., a(n) = ceiling(log_2(A023758(n+2))). - Andres Cicuttin, Apr 29 2016
a(n) and A002260(n) give respectively the x(n) and y(n) coordinates of the sorted sequence of points in the integer lattice such that x(n) > 0, 0 < y(n) <= x(n), and min(x(n), y(n)) < max(x(n+1), y(n+1)) for n > 0. - Andres Cicuttin, Dec 25 2016
Partial sums (A060432) are given by S(n) = (-a(n)^3 + a(n)*(1+6n))/6. - Daniel Cieslinski, Oct 23 2017
As an array, T(k,n) is the number of digits columns used in carryless multiplication between a k-digit number and an n-digit number. - Stefano Spezia, Sep 24 2022
a(n) is the maximum number of possible solutions to an n-statement Knights and Knaves Puzzle, where each statement is of the form "x of us are knights" for some 1 <= x <= n, knights can only tell the truth and knaves can only lie. - Taisha Charles and Brittany Ohlinger, Jul 29 2023

Examples

			From _Clark Kimberling_, Sep 16 2008: (Start)
As a rectangular array, a northwest corner:
  1 2 3 4 5 6
  2 3 4 5 6 7
  3 4 5 6 7 8
  4 5 6 7 8 9
This is the weight array (cf. A144112) of A107985 (formatted as a rectangular array). (End)
G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 3*x^5 + 3*x^6 + 4*x^7 + 4*x^9 + 4*x^9 + 4*x^10 + ...
		

References

  • Edward S. Barbeau, Murray S. Klamkin, and William O. J. Moser, Five Hundred Mathematical Challenges, Prob. 441, pp. 41, 194. MAA 1995.
  • R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 97.
  • K. Hardy and K. S. Williams, The Green Book of Mathematical Problems, p. 59, Solution to Prob. 14, Dover NY, 1985
  • R. Honsberger, Mathematical Morsels, pp. 133-134, MAA 1978.
  • J. F. Hurley, Litton's Problematical Recreations, pp. 152; 313-4 Prob. 22, VNR Co., NY, 1971.
  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 1, p. 43.
  • 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).
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.

Crossrefs

a(n+1) = 1+A003056(n), A022846(n)=a(n^2), a(n+1)=A002260(n)+A025581(n).
A123578 is an essentially identical sequence.

Programs

  • Haskell
    a002024 n k = a002024_tabl !! (n-1) !! (k-1)
    a002024_row n = a002024_tabl !! (n-1)
    a002024_tabl = iterate (\xs@(x:_) -> map (+ 1) (x : xs)) [1]
    a002024_list = concat a002024_tabl
    a002024' = round . sqrt . (* 2) . fromIntegral
    -- Reinhard Zumkeller, Jul 05 2015, Feb 12 2012, Mar 18 2011
    
  • Haskell
    a002024_list = [1..] >>= \n -> replicate n n
    
  • Haskell
    a002024 = (!!) $ [1..] >>= \n -> replicate n n
    -- Sascha Mücke, May 10 2016
    
  • Magma
    [Floor(Sqrt(2*n) + 1/2): n in [1..80]]; // Vincenzo Librandi, Nov 19 2014
    
  • Maple
    A002024 := n-> ceil((sqrt(1+8*n)-1)/2); seq(A002024(n), n=1..100);
  • Mathematica
    a[1] = 1; a[n_] := a[n] = a[n - a[n - 1]] + 1 (* Branko Curgus, May 12 2009 *)
    Table[n, {n, 13}, {n}] // Flatten (* Robert G. Wilson v, May 11 2010 *)
    Table[PadRight[{},n,n],{n,15}]//Flatten (* Harvey P. Dale, Jan 13 2019 *)
  • PARI
    t1(n)=floor(1/2+sqrt(2*n)) /* A002024 = this sequence */
    
  • PARI
    t2(n)=n-binomial(floor(1/2+sqrt(2*n)),2) /* A002260(n-1) */
    
  • PARI
    t3(n)=binomial(floor(3/2+sqrt(2*n)),2)-n+1 /* A004736 */
    
  • PARI
    t4(n)=n-1-binomial(floor(1/2+sqrt(2*n)),2) /* A002260(n-1)-1 */
    
  • PARI
    A002024(n)=(sqrtint(n*8)+1)\2 \\ M. F. Hasler, Apr 19 2014
    
  • PARI
    a(n)=(sqrtint(8*n-7)+1)\2
    
  • PARI
    a(n)=my(k=1);while(binomial(k+1,2)+1<=n,k++);k \\ R. J. Cano, Mar 17 2014
    
  • Python
    from math import isqrt
    def A002024(n): return (isqrt(8*n)+1)//2 # Chai Wah Wu, Feb 02 2022
  • Sage
    [floor(sqrt(2*n) +1/2) for n in (1..80)] # G. C. Greubel, Dec 10 2018
    

Formula

a(n) = floor(1/2 + sqrt(2n)). Also a(n) = ceiling((sqrt(1+8n)-1)/2). [See the Liu link for a large collection of explicit formulas. - N. J. A. Sloane, Oct 30 2019]
a((k-1)*k/2 + i) = k for k > 0 and 0 < i <= k. - Reinhard Zumkeller, Aug 30 2001
a(n) = a(n - a(n-1)) + 1, with a(1)=1. - Ian M. Levitt (ilevitt(AT)duke.poly.edu), Aug 18 2002
a(n) = round(sqrt(2n)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Nov 01 2002
T(n,k) = A003602(A118413(n,k)); = T(n,k) = A001511(A118416(n,k)). - Reinhard Zumkeller, Apr 27 2006
G.f.: (x/(1-x))*Product_{k>0} (1-x^(2*k))/(1-x^(2*k-1)). - Vladeta Jovovic, Oct 06 2003
Equals A127899 * A004736. - Gary W. Adamson, Feb 09 2007
Sum_{i=1..n} Sum_{j=i..n+i-1} T(j,i) = A000578(n); Sum_{i=1..n} T(n,i) = A000290(n). - Reinhard Zumkeller, Jun 24 2007
a(n) + n = A014132(n). - Vincenzo Librandi, Jul 08 2010
a(n) = ceiling(-1/2 + sqrt(2n)). - Branko Curgus, May 12 2009
a(A169581(n)) = A038567(n). - Reinhard Zumkeller, Dec 02 2009
a(n) = round(sqrt(2*n)) = round(sqrt(2*n-1)); there exist a and b greater than zero such that 2*n = 2+(a+b)^2 -(a+3*b) and a(n)=(a+b-1). - Fabio Civolani (civox(AT)tiscali.it), Feb 23 2010
A005318(n+1) = 2*A005318(n) - A205744(n), A205744(n) = A005318(A083920(n)), A083920(n) = n - a(n). - N. J. A. Sloane, Feb 11 2012
Expansion of psi(x) * x / (1 - x) in powers of x where psi() is a Ramanujan theta function. - Michael Somos, Mar 19 2014
G.f.: (x/(1-x)) * Product_{n>=1} (1 + x^n) * (1 - x^(2*n)). - Paul D. Hanna, Feb 27 2016
a(n) = 1 + Sum_{i=1..n/2} ceiling(floor(2(n-1)/(i^2+i))/(2n)). - José de Jesús Camacho Medina, Jan 07 2017
a(n) = floor((sqrt(8*n-7)+1)/2). - Néstor Jofré, Apr 24 2017
a(n) = floor((A000196(8*n)+1)/2). - Pontus von Brömssen, Dec 10 2018
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/4 (A003881). - Amiram Eldar, Oct 01 2022
G.f. as array: (x^2*(1 - y)^2 + y^2 + x*y*(1 - 2*y))/((1 - x)^2*(1 - y)^2). - Stefano Spezia, Apr 22 2024

A007283 a(n) = 3*2^n.

Original entry on oeis.org

3, 6, 12, 24, 48, 96, 192, 384, 768, 1536, 3072, 6144, 12288, 24576, 49152, 98304, 196608, 393216, 786432, 1572864, 3145728, 6291456, 12582912, 25165824, 50331648, 100663296, 201326592, 402653184, 805306368, 1610612736, 3221225472, 6442450944, 12884901888
Offset: 0

Keywords

Comments

Same as Pisot sequences E(3, 6), L(3, 6), P(3, 6), T(3, 6). See A008776 for definitions of Pisot sequences.
Numbers k such that A006530(A000010(k)) = A000010(A006530(k)) = 2. - Labos Elemer, May 07 2002
Also least number m such that 2^n is the smallest proper divisor of m which is also a suffix of m in binary representation, see A080940. - Reinhard Zumkeller, Feb 25 2003
Length of the period of the sequence Fibonacci(k) (mod 2^(n+1)). - Benoit Cloitre, Mar 12 2003
The sequence of first differences is this sequence itself. - Alexandre Wajnberg and Eric Angelini, Sep 07 2005
Subsequence of A122132. - Reinhard Zumkeller, Aug 21 2006
Apart from the first term, a subsequence of A124509. - Reinhard Zumkeller, Nov 04 2006
Total number of Latin n-dimensional hypercubes (Latin polyhedra) of order 3. - Kenji Ohkuma (k-ookuma(AT)ipa.go.jp), Jan 10 2007
Number of different ternary hypercubes of dimension n. - Edwin Soedarmadji (edwin(AT)systems.caltech.edu), Dec 10 2005
For n >= 1, a(n) is equal to the number of functions f:{1, 2, ..., n + 1} -> {1, 2, 3} such that for fixed, different x_1, x_2,...,x_n in {1, 2, ..., n + 1} and fixed y_1, y_2,...,y_n in {1, 2, 3} we have f(x_i) <> y_i, (i = 1,2,...,n). - Milan Janjic, May 10 2007
a(n) written in base 2: 11, 110, 11000, 110000, ..., i.e.: 2 times 1, n times 0 (see A003953). - Jaroslav Krizek, Aug 17 2009
Subsequence of A051916. - Reinhard Zumkeller, Mar 20 2010
Numbers containing the number 3 in their Collatz trajectories. - Reinhard Zumkeller, Feb 20 2012
a(n-1) gives the number of ternary numbers with n digits with no two adjacent digits in common; e.g., for n=3 we have 010, 012, 020, 021, 101, 102, 120, 121, 201, 202, 210 and 212. - Jon Perry, Oct 10 2012
If n > 1, then a(n) is a solution for the equation sigma(x) + phi(x) = 3x-4. This equation also has solutions 84, 3348, 1450092, ... which are not of the form 3*2^n. - Farideh Firoozbakht, Nov 30 2013
a(n) is the upper bound for the "X-ray number" of any convex body in E^(n + 2), conjectured by Bezdek and Zamfirescu, and proved in the plane E^2 (see the paper by Bezdek and Zamfirescu). - L. Edson Jeffery, Jan 11 2014
If T is a topology on a set V of size n and T is not the discrete topology, then T has at most 3 * 2^(n-2) many open sets. See Brown and Stephen references. - Ross La Haye, Jan 19 2014
Comment from Charles Fefferman, courtesy of Doron Zeilberger, Dec 02 2014: (Start)
Fix a dimension n. For a real-valued function f defined on a finite set E in R^n, let Norm(f, E) denote the inf of the C^2 norms of all functions F on R^n that agree with f on E. Then there exist constants k and C depending only on the dimension n such that Norm(f, E) <= C*max{ Norm(f, S) }, where the max is taken over all k-point subsets S in E. Moreover, the best possible k is 3 * 2^(n-1).
The analogous result, with the same k, holds when the C^2 norm is replaced, e.g., by the C^1, alpha norm (0 < alpha <= 1). However, the optimal analogous k, e.g., for the C^3 norm is unknown.
For the above results, see Y. Brudnyi and P. Shvartsman (1994). (End)
Also, coordination sequence for (infinity, infinity, infinity) tiling of hyperbolic plane. - N. J. A. Sloane, Dec 29 2015
The average of consecutive powers of 2 beginning with 2^1. - Melvin Peralta and Miriam Ong Ante, May 14 2016
For n > 1, a(n) is the smallest Zumkeller number with n divisors that are also Zumkeller numbers (A083207). - Ivan N. Ianakiev, Dec 09 2016
Also, for n >= 2, the number of length-n strings over the alphabet {0,1,2,3} having only the single letters as nonempty palindromic subwords. (Corollary 21 in Fleischer and Shallit) - Jeffrey Shallit, Dec 02 2019
Also, a(n) is the minimum link-length of any covering trail, circuit, path, and cycle for the set of the 2^(n+2) vertices of an (n+2)-dimensional hypercube. - Marco Ripà, Aug 22 2022
The known fixed points of maps n -> A163511(n) and n -> A243071(n). [See comments in A163511]. - Antti Karttunen, Sep 06 2023
The finite subsequence a(3), a(4), a(5), a(6) = 24, 48, 96, 192 is one of only two geometric sequences that can be formed with all interior angles (all integer, in degrees) of a simple polygon. The other sequence is a subsequence of A000244 (see comment there). - Felix Huber, Feb 15 2024
A level 1 Sierpiński triangle is a triangle. Level n+1 is formed from three copies of level n by identifying pairs of corner vertices of each pair of triangles. For n>2, a(n-3) is the radius of the level n Sierpiński triangle graph. - Allan Bickle, Aug 03 2024

References

  • Jason I. Brown, Discrete Structures and Their Interactions, CRC Press, 2013, p. 71.
  • T. Ito, Method, equipment, program and storage media for producing tables, Publication number JP2004-272104A, Japan Patent Office (written in Japanese, a(2)=12, a(3)=24, a(4)=48, a(5)=96, a(6)=192, a(7)=384 (a(7)=284 was corrected)).
  • Kenji Ohkuma, Atsuhiro Yamagishi and Toru Ito, Cryptography Research Group Technical report, IT Security Center, Information-Technology Promotion Agency, JAPAN.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of the following sequences: A029744, A029747, A029748, A029750, A362804 (after 3), A364494, A364496, A364289, A364291, A364292, A364295, A364497, A364964, A365422.
Essentially same as A003945 and A042950.
Row sums of (5, 1)-Pascal triangle A093562 and of (1, 5) Pascal triangle A096940.
Cf. Latin squares: A000315, A002860, A003090, A040082, A003191; Latin cubes: A098843, A098846, A098679, A099321.

Programs

Formula

G.f.: 3/(1-2*x).
a(n) = 2*a(n - 1), n > 0; a(0) = 3.
a(n) = Sum_{k = 0..n} (-1)^(k reduced (mod 3))*binomial(n, k). - Benoit Cloitre, Aug 20 2002
a(n) = A118416(n + 1, 2) for n > 1. - Reinhard Zumkeller, Apr 27 2006
a(n) = A000079(n) + A000079(n + 1). - Zerinvary Lajos, May 12 2007
a(n) = A000079(n)*3. - Omar E. Pol, Dec 16 2008
From Paul Curtz, Feb 05 2009: (Start)
a(n) = b(n) + b(n+3) for b = A001045, A078008, A154879.
a(n) = abs(b(n) - b(n+3)) with b(n) = (-1)^n*A084247(n). (End)
a(n) = 2^n + 2^(n + 1). - Jaroslav Krizek, Aug 17 2009
a(n) = A173786(n + 1, n) = A173787(n + 2, n). - Reinhard Zumkeller, Feb 28 2010
A216022(a(n)) = 6 and A216059(a(n)) = 7, for n > 0. - Reinhard Zumkeller, Sep 01 2012
a(n) = (A000225(n) + 1)*3. - Martin Ettl, Nov 11 2012
E.g.f.: 3*exp(2*x). - Ilya Gutkovskiy, May 15 2016
A020651(a(n)) = 2. - Yosu Yurramendi, Jun 01 2016
a(n) = sqrt(A014551(n + 1)*A014551(n + 2) + A014551(n)^2). - Ezhilarasu Velayutham, Sep 01 2019
a(A048672(n)) = A225546(A133466(n)). - Michel Marcus and Peter Munn, Nov 29 2019
Sum_{n>=1} 1/a(n) = 2/3. - Amiram Eldar, Oct 28 2020

A003602 Kimberling's paraphrases: if n = (2k-1)*2^m then a(n) = k.

Original entry on oeis.org

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

Keywords

Comments

Fractal sequence obtained from powers of 2.
k occurs at (2*k-1)*A000079(m), m >= 0. - Robert G. Wilson v, May 23 2006
Sequence is T^(oo)(1) where T is acting on a word w = w(1)w(2)..w(m) as follows: T(w) = "1"w(1)"2"w(2)"3"(...)"m"w(m)"m+1". For instance T(ab) = 1a2b3. Thus T(1) = 112, T(T(1)) = 1121324, T(T(T(1))) = 112132415362748. - Benoit Cloitre, Mar 02 2009
Note that iterating the post-numbering operator U(w) = w(1) 1 w(2) 2 w(3) 3... produces the same limit sequence except with an additional "1" prepended, i.e., 1,1,1,2,1,3,2,4,... - Glen Whitney, Aug 30 2023
In the binary expansion of n, first swallow all zeros from the right, then add 1, and swallow the now-appearing 0 bit as well. - Ralf Stephan, Aug 22 2013
Although A264646 and this sequence initially agree in their digit-streams, they differ after 48 digits. - N. J. A. Sloane, Nov 20 2015
"[This is a] fractal because we get the same sequence after we delete from it the first appearance of all positive integers" - see Cobeli and Zaharescu link. - Robert G. Wilson v, Jun 03 2018
From Peter Munn, Jun 16 2022: (Start)
The sequence is the list of positive integers interleaved with the sequence itself. Provided the offset is suitable (which is the case here) a term of such a self-interleaved sequence is determined by the odd part of its index. Putting some of the formulas given here into words, a(n) is the position of the odd part of n in the list of odd numbers.
Applying the interleaving transform again, we get A110963.
(End)
Omitting all 1's leaves A131987 + 1. - David James Sycamore, Jul 26 2022
a(n) is also the smallest positive number not among the terms between a(a(n-1)) and a(n-1) inclusive (with a(0)=1 prepended). - Neal Gersh Tolunsky, Mar 07 2023

Examples

			From _Peter Munn_, Jun 14 2022: (Start)
Start of table showing the interleaving with the positive integers:
   n  a(n)  (n+1)/2  a(n/2)
   1    1      1
   2    1               1
   3    2      2
   4    1               1
   5    3      3
   6    2               2
   7    4      4
   8    1               1
   9    5      5
  10    3               3
  11    6      6
  12    2               2
(End)
		

References

  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n) is the index of the column in A135764 where n appears (see also A054582).
Cf. A000079, A000265, A001511, A003603, A003961, A014577 (with offset 1, reduction mod 2), A025480, A035528, A048673, A101279, A110963, A117303, A126760, A181988, A220466, A249745, A253887, A337821 (2-adic valuation).
Cf. also A349134 (Dirichlet inverse), A349135 (sum with it), A349136 (Möbius transform), A349431, A349371 (inverse Möbius transform).
Cf. A264646.

Programs

  • Haskell
    a003602 = (`div` 2) . (+ 1) . a000265
    -- Reinhard Zumkeller, Feb 16 2012, Oct 14 2010
    
  • Haskell
    import Data.List (transpose)
    a003602 = flip div 2 . (+ 1) . a000265
    a003602_list = concat $ transpose [[1..], a003602_list]
    -- Reinhard Zumkeller, Aug 09 2013, May 23 2013
    
  • Maple
    A003602:=proc(n) options remember: if n mod 2 = 1 then RETURN((n+1)/2) else RETURN(procname(n/2)) fi: end proc:
    seq(A003602(n), n=1..83); # Pab Ter
    nmax := 83: for m from 0 to ceil(simplify(log[2](nmax))) do for k from 1 to ceil(nmax/(m+2)) do a((2*k-1)*2^m) := k od: od: seq(a(k), k=1..nmax); # Johannes W. Meijer, Feb 04 2013
    A003602 := proc(n)
        a := 1;
        for p in ifactors(n)[2] do
            if op(1,p) > 2 then
                a := a*op(1,p)^op(2,p) ;
            end if;
        end do  :
        (a+1)/2 ;
    end proc: # R. J. Mathar, May 19 2016
  • Mathematica
    a[n_] := Block[{m = n}, While[ EvenQ@m, m /= 2]; (m + 1)/2]; Array[a, 84] (* or *)
    a[1] = 1; a[n_] := a[n] = If[OddQ@n, (n + 1)/2, a[n/2]]; Array[a, 84] (* Robert G. Wilson v, May 23 2006 *)
    a[n_] := Ceiling[NestWhile[Floor[#/2] &, n, EvenQ]/2]; Array[a, 84] (* Birkas Gyorgy, Apr 05 2011 *)
    a003602 = {1}; max = 7; Do[b = {}; Do[AppendTo[b, {k, a003602[[k]]}], {k, Length[a003602]}]; a003602 = Flatten[b], {n, 2, max}]; a003602 (* L. Edson Jeffery, Nov 21 2015 *)
  • PARI
    A003602(n)=(n/2^valuation(n,2)+1)/2; /* Joerg Arndt, Apr 06 2011 */
    
  • Python
    import math
    def a(n): return (n/2**int(math.log(n - (n & n - 1), 2)) + 1)/2 # Indranil Ghosh, Apr 24 2017
    
  • Python
    def A003602(n): return (n>>(n&-n).bit_length())+1 # Chai Wah Wu, Jul 08 2022
  • Scheme
    (define (A003602 n) (let loop ((n n)) (if (even? n) (loop (/ n 2)) (/ (+ 1 n) 2)))) ;; Antti Karttunen, Feb 04 2015
    

Formula

a(n) = (A000265(n) + 1)/2.
a((2*k-1)*2^m) = k, for m >= 0 and k >= 1. - Robert G. Wilson v, May 23 2006
Inverse Weigh transform of A035528. - Christian G. Bower
G.f.: 1/x * Sum_{k>=0} x^2^k/(1-2*x^2^(k+1) + x^2^(k+2)). - Ralf Stephan, Jul 24 2003
a(2*n-1) = n and a(2*n) = a(n). - Pab Ter (pabrlos2(AT)yahoo.com), Oct 25 2005
a(A118413(n,k)) = A002024(n,k); = a(A118416(n,k)) = A002260(n,k); a(A014480(n)) = A001511(A014480(n)). - Reinhard Zumkeller, Apr 27 2006
Ordinal transform of A001511. - Franklin T. Adams-Watters, Aug 28 2006
a(n) = A249745(A126760(A003961(n))) = A249745(A253887(A048673(n))). That is, this sequence plays the same role for the numbers in array A135764 as A126760 does for the odd numbers in array A135765. - Antti Karttunen, Feb 04 2015 & Jan 19 2016
G.f. satisfies g(x) = g(x^2) + x/(1-x^2)^2. - Robert Israel, Apr 24 2015
a(n) = A181988(n)/A001511(n). - L. Edson Jeffery, Nov 21 2015
a(n) = A025480(n-1) + 1. - R. J. Mathar, May 19 2016
a(n) = A110963(2n-1) = A349135(4*n). - Antti Karttunen, Apr 18 2022
a(n) = (1 + n)/2, for n odd; a(n) = a(n/2), for n even. - David James Sycamore, Jul 28 2022
a(n) = n/2^A001511(n) + 1/2. - Alan Michael Gómez Calderón, Oct 06 2023
a(n) = A123390(A118319(n)). - Flávio V. Fernandes, Mar 02 2025

Extensions

More terms from Pab Ter (pabrlos2(AT)yahoo.com), Oct 25 2005

A020714 a(n) = 5 * 2^n.

Original entry on oeis.org

5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 20480, 40960, 81920, 163840, 327680, 655360, 1310720, 2621440, 5242880, 10485760, 20971520, 41943040, 83886080, 167772160, 335544320, 671088640, 1342177280, 2684354560, 5368709120, 10737418240
Offset: 0

Keywords

Comments

Same as Pisot sequences E(5,10), L(5,10), P(5,10), T(5,10). See A008776 for definitions of Pisot sequences.
The first differences are the sequence itself. - Alexandre Wajnberg & Eric Angelini, Sep 07 2005
5 times powers of 2. - Omar E. Pol, Dec 16 2008
Subsequence of A051916. - Reinhard Zumkeller, Mar 20 2010
With the addition of "2, 3," at the beginning, this sequence gives terms (n + 3) through the first term greater than 2^n, for n odd, of the negabinary Keith sequence for 2^n, thus proving that with the exception of 2 itself, no odd-indexed power of 2 is a negabinary Keith number (see A188381). - Alonso del Arte, Feb 02 2012
Let b(0) = 5 and b(n+1) = the smallest number not in the sequence such that b(n+1) - Product_{i=0..n} b(i) divides b(n+1) - Sum_{i=0..n} b(i). Then b(n+2) = a(n) for n > 0. - Derek Orr, Jan 15 2015

Crossrefs

Row sums of (4, 1)-Pascal triangle A093561.
Row sums of (9, 1)-Pascal triangle A093644.
Row sums of (1, 4)-Pascal triangle A095666 (with leading 4).

Programs

Formula

a(n) = 5*2^n. a(n) = 2*a(n-1).
G.f.: 5/(1-2*x).
If m is a term greater than 5 of this sequence then m = 5*phi(phi(m)). - Farideh Firoozbakht, Aug 16 2005
a(n) = A118416(n+1,3) for n>2. - Reinhard Zumkeller, Apr 27 2006
a(n) = A000079(n)*5. - Omar E. Pol, Dec 16 2008
a(n) = A173786(n+2,n) for n > 1. - Reinhard Zumkeller, Feb 28 2010
a(n) = A001045(n+4) - A001045(n). - Paul Curtz, Nov 08 2012
Sum_{n>=1} 1/a(n) = 2/5. - Amiram Eldar, Oct 28 2020
E.g.f.: 5*exp(2*x). - Stefano Spezia, May 15 2021

A005009 a(n) = 7*2^n.

Original entry on oeis.org

7, 14, 28, 56, 112, 224, 448, 896, 1792, 3584, 7168, 14336, 28672, 57344, 114688, 229376, 458752, 917504, 1835008, 3670016, 7340032, 14680064, 29360128, 58720256, 117440512, 234881024, 469762048, 939524096, 1879048192, 3758096384
Offset: 0

Keywords

Comments

The first differences are the sequence itself. - Alexandre Wajnberg & Eric Angelini, Sep 07 2005

Crossrefs

Sequences of the form (2*m+1)*2^n: A000079 (m=0), A007283 (m=1), A020714 (m=2), this sequence (m=3), A005010 (m=4), A005015 (m=5), A005029 (m=6), A110286 (m=7), A110287 (m=8), A110288 (m=9), A175805 (m=10), A248646 (m=11), A164161 (m=12), A175806 (m=13), A257548 (m=15).
Row sums of (6, 1)-Pascal triangle A093563 and of (1, 6)-Pascal triangle A096956, n>=1.

Programs

Formula

G.f.: 7/(1-2*x).
a(n) = A118416(n+1,4) for n > 3. - Reinhard Zumkeller, Apr 27 2006
a(n) = 2*a(n-1), for n > 0, with a(0)=7 . - Philippe Deléham, Nov 23 2008
a(n) = 7 * A000079(n). - Omar E. Pol, Dec 16 2008
a(n) = A173787(n+3,n). - Reinhard Zumkeller, Feb 28 2010
Intersection of A014311 and A212191: all terms and their squares are the sum of exactly three distinct powers of 2, A000120(a(n)) = A000120(a(n)^2) = 3. - Reinhard Zumkeller, May 03 2012
G.f.: 2/x/G(0) - 1/x + 9, where G(k)= 1 + 1/(1 - x*(7*k+2)/(x*(7*k+9) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 03 2013
E.g.f.: 7*exp(2*x). - Stefano Spezia, May 15 2021

A014480 Expansion of g.f. (1+2*x)/(1-2*x)^2.

Original entry on oeis.org

1, 6, 20, 56, 144, 352, 832, 1920, 4352, 9728, 21504, 47104, 102400, 221184, 475136, 1015808, 2162688, 4587520, 9699328, 20447232, 42991616, 90177536, 188743680, 394264576, 822083584, 1711276032, 3556769792, 7381975040, 15300820992, 31675383808, 65498251264
Offset: 0

Keywords

Comments

Number of binary trees of size n and height n-1, computed from size n=3 onward; i.e. A014480(n) = A073345(n+3,n+2). (For sizes n=0 through 2 there are no such trees.)
Also determinant of the n X n matrix M(i,j)=binomial(2i+2j,i+j). - Benoit Cloitre, Mar 27 2004
Subdiagonal in triangle displayed in A128196. - Peter Luschny, Feb 26 2007
From Jaume Oliver Lafont, Nov 08 2009: (Start)
From two BBP-type formulas by Knuth, (page 6 of the reference)
Sum_{n>=0} 1/a(n) = 2^(1/2)*log(1+2^(1/2))
Sum_{n>=0} (-1)^n/a(n) = 2^(1/2)*atan(1/2^(1/2))
(End)
Create a triangle with first column T(n,1)=1+4*n for n=0 1 2... The remaining terms T(r,c)=T(r,c-1)+T(r-1,c-1). T(n,n+1)=a(n). - J. M. Bergot, Dec 18 2012

Examples

			(1 + 2*x)/(1-2*x)^2 = 1 + 6*x + 20*x^2 + 56*x^3 + 144*x^4 + 352*x^5 + 832*x^6 + ...
		

Crossrefs

Leftmost column of A167580 (shifted).

Programs

  • Haskell
    a014480 n = a014480_list !! n
    a014480_list = 1 : 6 : map (* 4)
       (zipWith (-) (tail a014480_list) a014480_list)
    -- Reinhard Zumkeller, Jan 22 2012
    
  • Magma
    [2^n*(2*n + 1): n in [0..35]]; // Vincenzo Librandi, Oct 20 2014
  • Maple
    a:=n-> sum(2^n*n^binomial(j,n)/2,j=1..n): seq(a(n),n=1..29); # Zerinvary Lajos, Apr 18 2009
  • Mathematica
    CoefficientList[ Series[(1 + 2*x)/(1 - 2*x)^2, {x, 0, 28}], x]
    LinearRecurrence[{4, -4}, {1, 6}, 29] (* Robert G. Wilson v, Dec 26 2012 *)
    Table[2^n (2*n + 1), {n, 0, 28}] (* Fred Daniel Kline, Oct 20 2014 *)
  • PARI
    Vec((1+2*x)/(1-2*x)^2+O(x^99)) \\ Charles R Greathouse IV, Sep 23 2012
    

Formula

a(n) = (2n+1)*2^n = 4a(n-1)-4a(n-2) = 4*A052951(n-1) = a(n-1)+A052951(n) = a(n-1)*(2+4/(2n-1)) = A054582(n, n). - Henry Bottomley, May 16 2001
E.g.f.: x*cosh(sqrt(2)*x) = x + 6x^3/3! + 20x^5/5! + 56x^7/7! +... - Ralf Stephan, Mar 03 2005
From Reinhard Zumkeller, Apr 27 2006: (Start)
a(n) = A118416(n+1,n+1) = A118413(n+1,n+1);
A001511(a(n)) = A003602(a(n));
A117303(a(n)) = a(n). (End)
Row sums of triangle A132775 - Gary W. Adamson, Aug 29 2007
Row sums of triangle A134233 - Gary W. Adamson, Oct 14 2007
From Johannes W. Meijer, Nov 23 2009: (Start)
a(n) = 3*a(n-1) - 2^(n-1)*(2*n-5) with a(0) = 1.
a(n) = 3*a(n-1) - 2*a(n-2) + 2^n with a(0) = 1 and a(1) = 6.
(End)
G.f.: -G(0) where G(k) = 1 - (2*k+2)/(1 - x/(x - (k+1)/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Dec 06 2012
E.g.f.: Q(0), where Q(k)= 1 + 4*x/( 1 - 1/(1 + 2*(k+1)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 11 2013

A005010 a(n) = 9*2^n.

Original entry on oeis.org

9, 18, 36, 72, 144, 288, 576, 1152, 2304, 4608, 9216, 18432, 36864, 73728, 147456, 294912, 589824, 1179648, 2359296, 4718592, 9437184, 18874368, 37748736, 75497472, 150994944, 301989888, 603979776, 1207959552, 2415919104, 4831838208, 9663676416, 19327352832
Offset: 0

Author

N. J. A. Sloane, Jun 14 1998

Keywords

Comments

Row sums of (8, 1)-Pascal triangle A093565. - N. J. A. Sloane, Sep 22 2004
The first differences are the sequence itself. - Alexandre Wajnberg & Eric Angelini, Sep 07 2005
For n>=1, a(n) is equal to the number of functions f:{1,2,...,n+2}->{1,2,3} such that for fixed, different x_1, x_2,...,x_n in {1,2,...,n+2} and fixed y_1, y_2,...,y_n in {1,2,3} we have f(x_i)<>y_i, (i=1,2,...,n). - Milan Janjic, May 10 2007
9 times powers of 2. - Omar E. Pol, Dec 16 2008
a(n) = A173786(n+3,n) for n>2. - Reinhard Zumkeller, Feb 28 2010
Let D(m) = {d(m,i)}, i = 1..q, denote the set of the q divisors of a number m, and consider s0(m) and s1(m) the sums of the divisors that are congruent to 2 and 3 (mod 4) respectively. For n>0, the sequence a(n) lists the numbers m such that s0(m) = 26 and s1(m) = 3. - Michel Lagneau, Feb 10 2017

Crossrefs

Programs

Formula

a(n) = 9*2^n.
G.f.: 9/(1-2*x).
a(n) = A118416(n+1,5) for n>4. - Reinhard Zumkeller, Apr 27 2006
a(n) = 2*a(n-1), n>0; a(0)=9. - Philippe Deléham, Nov 23 2008
a(n) = 9*A000079(n). - Omar E. Pol, Dec 16 2008
a(n) = 3*A007283(n). - Omar E. Pol, Jul 14 2015
E.g.f.: 9*exp(2*x). - Elmo R. Oliveira, Aug 16 2024

A173786 Triangle read by rows: T(n,k) = 2^n + 2^k, 0 <= k <= n.

Original entry on oeis.org

2, 3, 4, 5, 6, 8, 9, 10, 12, 16, 17, 18, 20, 24, 32, 33, 34, 36, 40, 48, 64, 65, 66, 68, 72, 80, 96, 128, 129, 130, 132, 136, 144, 160, 192, 256, 257, 258, 260, 264, 272, 288, 320, 384, 512, 513, 514, 516, 520, 528, 544, 576, 640, 768, 1024, 1025, 1026, 1028, 1032, 1040, 1056, 1088, 1152, 1280, 1536, 2048
Offset: 0

Author

Reinhard Zumkeller, Feb 28 2010

Keywords

Comments

Essentially the same as A048645. - T. D. Noe, Mar 28 2011

Examples

			Triangle begins as:
     2;
     3,    4;
     5,    6,    8;
     9,   10,   12,   16;
    17,   18,   20,   24,   32;
    33,   34,   36,   40,   48,   64;
    65,   66,   68,   72,   80,   96,  128;
   129,  130,  132,  136,  144,  160,  192,  256;
   257,  258,  260,  264,  272,  288,  320,  384,  512;
   513,  514,  516,  520,  528,  544,  576,  640,  768, 1024;
  1025, 1026, 1028, 1032, 1040, 1056, 1088, 1152, 1280, 1536, 2048;
		

Crossrefs

Programs

  • Magma
    [2^n + 2^k: k in [0..n], n in [0..12]]; // G. C. Greubel, Jul 07 2021
    
  • Mathematica
    Flatten[Table[2^n + 2^m, {n,0,10}, {m, 0, n}]] (* T. D. Noe, Jun 18 2013 *)
  • PARI
    A173786(n) = { my(c = (sqrtint(8*n + 1) - 1) \ 2); 1 << c + 1 << (n - binomial(c + 1, 2)); }; \\ Antti Karttunen, Feb 29 2024, after David A. Corneth's PARI-program in A048645
    
  • Python
    from math import isqrt, comb
    def A173786(n):
        a = (m:=isqrt(k:=n+1<<1))-(k<=m*(m+1))
        return (1<Chai Wah Wu, Jun 20 2025
  • Sage
    flatten([[2^n + 2^k for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Jul 07 2021
    

Formula

1 <= A000120(T(n,k)) <= 2.
For n>0, 0<=kA048645(n+1,k+2) and T(n,n) = A048645(n+2,1).
Row sums give A006589(n).
Central terms give A161168(n).
T(2*n+1,n) = A007582(n+1).
T(2*n+1,n+1) = A028403(n+1).
T(n,k) = A140513(n,k) - A173787(n,k), 0<=k<=n.
T(n,k) = A059268(n+1,k+1) + A173787(n,k), 0
T(n,k) * A173787(n,k) = A173787(2*n,2*k), 0<=k<=n.
T(n,0) = A000051(n).
T(n,1) = A052548(n) for n>0.
T(n,2) = A140504(n) for n>1.
T(n,3) = A175161(n-3) for n>2.
T(n,4) = A175162(n-4) for n>3.
T(n,5) = A175163(n-5) for n>4.
T(n,n-4) = A110287(n-4) for n>3.
T(n,n-3) = A005010(n-3) for n>2.
T(n,n-2) = A020714(n-2) for n>1.
T(n,n-1) = A007283(n-1) for n>0.
T(n,n) = 2*A000079(n).

Extensions

Typo in first comment line fixed by Reinhard Zumkeller, Mar 07 2010
Showing 1-10 of 15 results. Next