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

A255264 Total number of ON cells in the "Ulam-Warburton" two-dimensional cellular automaton of A147562 after A048645(n) generations.

Original entry on oeis.org

1, 5, 9, 21, 25, 37, 85, 89, 101, 149, 341, 345, 357, 405, 597, 1365, 1369, 1381, 1429, 1621, 2389, 5461, 5465, 5477, 5525, 5717, 6485, 9557, 21845, 21849, 21861, 21909, 22101, 22869, 25941, 38229, 87381, 87385, 87397, 87445, 87637
Offset: 1

Views

Author

Omar E. Pol, Feb 19 2015

Keywords

Comments

It appears that these are the terms of A147562, A162795, A169707, A255366, A256250, A256260, whose indices have binary weight 1 or 2.

Examples

			Also, written as an irregular triangle in which row lengths are the terms of A028310 the sequence begins:
      1;
      5;
      9,    21;
     25,    37,    85;
     89,   101,   149,   341;
    345,   357,   405,   597,  1365;
   1369,  1381,  1429,  1621,  2389,  5461;
   5465,  5477,  5525,  5717,  6485,  9557, 21845;
  21849, 21861, 21909, 22101, 22869, 25941, 38229, 87381;
  ...
Right border gives the positive terms of A002450.
It appears that the second leading diagonal gives the odd terms of A206374.
		

Crossrefs

Formula

a(n) = A147562(A048645(n)).
Conjecture 1: a(n) = A162795(A048645(n)).
Conjecture 2: a(n) = A169707(A048645(n)).
Conjecture 3: a(n) = A255366(A048645(n)).
Conjecture 4: a(n) = A256250(A048645(n)).
Conjecture 5: a(n) = A256260(A048645(n)).
a(n) = A032925(A209492(n-1)) (conjectured). - Jon Maiga, Dec 17 2021

A003056 n appears n+1 times. Also the array A(n,k) = n+k (n >= 0, k >= 0) read by antidiagonals. Also inverse of triangular numbers.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Also triangle read by rows: T(n,k), n>=0, k>=0, in which n appears n+1 times in row n. - Omar E. Pol, Jul 15 2012
The PARI functions t1, t2 can be used to read a triangular array T(n,k) (n >= 0, 0 <= k <= n-1) by rows from left to right: n -> T(t1(n), t2(n)). - Michael Somos, Aug 23 2002
Number of terms in partition of n with greatest number of distinct terms. - Amarnath Murthy, May 20 2001
Summation table for (x+y) = (0+0),(0+1),(1+0),(0+2),(1+1),(2+0), ...
Also the number of triangular numbers less than or equal to n, not counting 0 as triangular. - Robert G. Wilson v, Oct 21 2005
Permutation of A116939: a(n) = A116939(A116941(n)), a(A116942(n)) = A116939(n). - Reinhard Zumkeller, Feb 27 2006
Maximal size of partitions of n into distinct parts, see A000009. - Reinhard Zumkeller, Jun 13 2009
Also number of digits of A000462(n). - Reinhard Zumkeller, Mar 27 2011
Also the maximum number of 1's contained in the list of hook-lengths of a partition of n. E.g., a(4)=2 because hooks of partitions of n=4 comprise {4,3,2,1}, {4,2,1,1}, {3,2,2,1}, {4,1,2,1}, {4,3,2,1} where the number of 1's in each is 1,2,1,2,1. Hence the maximum is 2. - T. Amdeberhan, Jun 03 2012
Fan, Yang, and Yu (2012) prove a conjecture of Amdeberhan on the generating function of a(n). - Jonathan Sondow, Dec 17 2012
Also the number of partitions of n into distinct parts p such that max(p) - min(p) <= length(p). - Clark Kimberling, Apr 18 2014
Also the maximum number of occurrences of any single value among the previous terms. - Ivan Neretin, Sep 20 2015
Where records occur gives A000217. - Omar E. Pol, Nov 05 2015
Also number of peaks in the largest Dyck path of the symmetric representation of sigma(n), n >= 1. Cf. A237593. - Omar E. Pol, Dec 19 2016

Examples

			G.f. = x + x^2 + 2*x^3 + 2*x^4 + 2*x^5 + 3*x^6 + 3*x^7 + 3*x^8 + 3*x^9 + 4*x^10 + ...
As triangle, the sequence starts
  0;
  1, 1;
  2, 2, 2;
  3, 3, 3, 3;
  4, 4, 4, 4, 4;
  5, 5, 5, 5, 5, 5;
  6, 6, 6, 6, 6, 6, 6;
  7, 7, 7, 7, 7, 7, 7, 7;
  8, 8, 8, 8, 8, 8, 8, 8, 8;
  ...
		

Crossrefs

a(n) = A002024(n+1)-1.
Cf. A000196, A000217, A000462, A001227, A001462, A001614, A004247 (multiplication table), A006463 (partial sums), A016655, A050600, A050602, A048645, A122797, A131507, A238005.
Partial sums of A073424.

Programs

  • Haskell
    a003056 = floor . (/ 2) . (subtract 1) .
                      sqrt . (+ 1) . (* 8) . fromIntegral
    a003056_row n = replicate (n + 1) n
    a003056_tabl = map a003056_row [0..]
    a003056_list = concat $ a003056_tabl
    -- Reinhard Zumkeller, Aug 02 2014, Oct 17 2010
    
  • Magma
    [Floor((Sqrt(1+8*n)-1)/2): n in [0..80]]; // Vincenzo Librandi, Oct 23 2011
    
  • Maple
    A003056 := (n,k) -> n: # Peter Luschny, Oct 29 2011
    a := [ 0 ]: for i from 1 to 15 do for j from 1 to i+1 do a := [ op(a),i ]; od: od: a;
    A003056 := proc(n)
        floor((sqrt(1+8*n)-1)/2) ;
    end proc: # R. J. Mathar, Jul 10 2015
  • Mathematica
    f[n_] := Floor[(Sqrt[1 + 8n] - 1)/2]; Table[ f[n], {n, 0, 87}] (* Robert G. Wilson v, Oct 21 2005 *)
    Table[x, {x, 0, 13}, {y, 0, x}] // Flatten
    T[ n_, k_] := If[ n >= k >= 0, n, 0]; (* Michael Somos, Dec 22 2016 *)
    Flatten[Table[PadRight[{},n+1,n],{n,0,12}]] (* Harvey P. Dale, Jul 03 2021 *)
  • PARI
    A003056(n)=(sqrtint(8*n+1)-1)\2  \\ M. F. Hasler, Oct 08 2011
    
  • PARI
    t1(n)=floor(-1/2+sqrt(2+2*n)) /* A003056 */
    
  • PARI
    t2(n)=n-binomial(floor(1/2+sqrt(2+2*n)),2) /* A002262 */
    
  • Python
    from math import isqrt
    def A003056(n): return (k:=isqrt(m:=n+1<<1))+int((m<<2)>(k<<2)*(k+1)+1)-1 # Chai Wah Wu, Jul 26 2022

Formula

a(n) = floor((sqrt(1+8*n)-1)/2). - Antti Karttunen
a(n) = floor(-1/2 + sqrt(2*n+b)) with 1/4 <= b < 9/4 or a(n) = floor((sqrt(8*n+b)-1)/2) with 1 <= b < 9. - Michael A. Childers (childers_moof(AT)yahoo.com), Nov 11 2001
a(n) = f(n,0) with f(n,k) = k if n <= k, otherwise f(n-k-1, k+1). - Reinhard Zumkeller, May 23 2009
a(n) = 2*n + 1 - A001614(n+1) = n + 1 - A122797(n+1). - Reinhard Zumkeller, Feb 12 2012
a(n) = k if k*(k+1)/2 <= n < (k+1)*(k+2)/2. - Jonathan Sondow, Dec 17 2012
G.f.: (1-x)^(-1)*Sum_{n>=1} x^(n*(n+1)/2) = (Theta_2(0,x^(1/2)) - 2*x^(1/8))/(2*x^(1/8)*(1-x)) where Theta_2 is a Jacobi Theta function. - Robert Israel, May 21 2015
a(n) = floor((A000196(1+8*n)-1)/2). - Pontus von Brömssen, Dec 10 2018
a(n+1) = a(n-a(n)) + 1, a(0) = 0. - Rok Cestnik, Dec 29 2020
a(n) = A001227(n) + A238005(n), n >= 1. - Omar E. Pol, Sep 30 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2)/2 (cf. A016655). - Amiram Eldar, Sep 24 2023
G.f. as array: (x + y - 2*x*y)/((1 - x)^2*(1 - y)^2). - Stefano Spezia, Dec 20 2023 [corrected by Stefano Spezia, Apr 22 2024]

Extensions

Definition clarified by N. J. A. Sloane, Dec 08 2020

A002262 Triangle read by rows: T(n,k) = k, 0 <= k <= n, in which row n lists the first n+1 nonnegative integers.

Original entry on oeis.org

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

Views

Author

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

Keywords

Comments

The point with coordinates (x = A025581(n), y = A002262(n)) sweeps out the first quadrant by upwards antidiagonals. N. J. A. Sloane, Jul 17 2018
Old name: Integers 0 to n followed by integers 0 to n+1 etc.
a(n) = n - the largest triangular number <= n. - Amarnath Murthy, Dec 25 2001
The PARI functions t1, t2 can be used to read a square array T(n,k) (n >= 0, k >= 0) by antidiagonals downwards: n -> T(t1(n), t2(n)). - Michael Somos, Aug 23 2002
Values x of unique solution pair (x,y) to equation T(x+y) + x = n, where T(k)=A000217(k). - Lekraj Beedassy, Aug 21 2004
a(A000217(n)) = 0; a(A000096(n)) = n. - Reinhard Zumkeller, May 20 2009
Concatenation of the set representation of ordinal numbers, where the n-th ordinal number is represented by the set of all ordinals preceding n, 0 being represented by the empty set. - Daniel Forgues, Apr 27 2011
An integer sequence is nonnegative if and only if it is a subsequence of this sequence. - Charles R Greathouse IV, Sep 21 2011
a(A195678(n)) = A000040(n) and a(m) <> A000040(n) for m < A195678(n), an example of the preceding comment. - Reinhard Zumkeller, Sep 23 2011
A 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. A002262 is reluctant sequence of 0,1,2,3,... The nonnegative integers, A001477. - Boris Putievskiy, Dec 12 2012

Examples

			From _Daniel Forgues_, Apr 27 2011: (Start)
Examples of set-theoretic representation of ordinal numbers:
  0: {}
  1: {0} = {{}}
  2: {0, 1} = {0, {0}} = {{}, {{}}}
  3: {0, 1, 2} = {{}, {0}, {0, 1}} = ... = {{}, {{}}, {{}, {{}}}} (End)
From _Omar E. Pol_, Jul 15 2012: (Start)
  0;
  0, 1;
  0, 1, 2;
  0, 1, 2, 3;
  0, 1, 2, 3, 4;
  0, 1, 2, 3, 4, 5;
  0, 1, 2, 3, 4, 5, 6;
  0, 1, 2, 3, 4, 5, 6, 7;
  0, 1, 2, 3, 4, 5, 6, 7, 8;
  0, 1, 2, 3, 4, 5, 6, 7, 8, 9;
  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
(End)
		

Crossrefs

As a sequence, essentially same as A048151.
Cf. A060510 (parity).

Programs

  • Haskell
    a002262 n k = a002262_tabl !! n !! k
    a002262_row n = a002262_tabl !! n
    a002262_tabl = map (enumFromTo 0) [0..]
    a002262_list = concat a002262_tabl
    -- Reinhard Zumkeller, Aug 05 2015, Jul 13 2012, Mar 07 2011
    
  • Maple
    seq(seq(i,i=0..n),n=0..14); # Peter Luschny, Sep 22 2011
    A002262 := n -> n - binomial(floor((1/2)+sqrt(2*(1+n))),2);
  • Mathematica
    m[n_]:= Floor[(-1 + Sqrt[8n - 7])/2]
    b[n_]:= n - m[n] (m[n] + 1)/2
    Table[m[n], {n, 1, 105}]     (* A003056 *)
    Table[b[n], {n, 1, 105}]     (* A002260 *)
    Table[b[n] - 1, {n, 1, 120}] (* A002262 *)
    (* Clark Kimberling, Jun 14 2011 *)
    Flatten[Table[k, {n, 0, 14}, {k, 0, n}]] (* Alonso del Arte, Sep 21 2011 *)
    Flatten[Table[Range[0,n], {n,0,15}]] (* Harvey P. Dale, Jan 31 2015 *)
  • PARI
    a(n)=n-binomial(round(sqrt(2+2*n)),2)
    
  • PARI
    t1(n)=n-binomial(floor(1/2+sqrt(2+2*n)),2) /* A002262, this sequence */
    
  • PARI
    t2(n)=binomial(floor(3/2+sqrt(2+2*n)),2)-(n+1) /* A025581, cf. comment by Somos for reading arrays by antidiagonals */
    
  • PARI
    concat(vector(15,n,vector(n,i,i-1)))  \\ M. F. Hasler, Sep 21 2011
    
  • PARI
    apply( {A002262(n)=n-binomial(sqrtint(8*n+8)\/2,2)}, [0..99]) \\ M. F. Hasler, Oct 20 2022
    
  • Python
    for i in range(16):
        for j in range(i):
            print(j, end=", ") # Mohammad Saleh Dinparvar, May 13 2020
    
  • Python
    from math import comb, isqrt
    def a(n): return n - comb((1+isqrt(8+8*n))//2, 2)
    print([a(n) for n in range(105)]) # Michael S. Branicky, May 07 2023

Formula

a(n) = A002260(n) - 1.
a(n) = n - (trinv(n)*(trinv(n)-1))/2; trinv := n -> floor((1+sqrt(1+8*n))/2) (cf. A002024); # gives integral inverses of triangular numbers
a(n) = n - A000217(A003056(n)) = n - A057944(n). - Lekraj Beedassy, Aug 21 2004
a(n) = A140129(A023758(n+2)). - Reinhard Zumkeller, May 14 2008
a(n) = f(n,1) with f(n,m) = if nReinhard Zumkeller, May 20 2009
a(n) = (1/2)*(t - t^2 + 2*n), where t = floor(sqrt(2*n+1) + 1/2) = round(sqrt(2*n+1)). - Ridouane Oudra, Dec 01 2019
a(n) = ceiling((-1 + sqrt(9 + 8*n))/2) * (1 - ((1/2)*ceiling((1 + sqrt(9 + 8*n))/2))) + n. - Ryan Jean, Sep 03 2022
G.f.: x*y/((1 - x)*(1 - x*y)^2). - Stefano Spezia, Feb 21 2024

Extensions

New name from Omar E. Pol, Jul 15 2012
Typo in definition fixed by Reinhard Zumkeller, Aug 05 2015

A147562 Number of "ON" cells at n-th stage in the "Ulam-Warburton" two-dimensional cellular automaton.

Original entry on oeis.org

0, 1, 5, 9, 21, 25, 37, 49, 85, 89, 101, 113, 149, 161, 197, 233, 341, 345, 357, 369, 405, 417, 453, 489, 597, 609, 645, 681, 789, 825, 933, 1041, 1365, 1369, 1381, 1393, 1429, 1441, 1477, 1513, 1621, 1633, 1669, 1705, 1813, 1849, 1957, 2065, 2389, 2401, 2437, 2473
Offset: 0

Views

Author

N. J. A. Sloane, based on emails from Franklin T. Adams-Watters, R. J. Mathar and David W. Wilson, Apr 29 2009

Keywords

Comments

Studied by Holladay and Ulam circa 1960. See Fig. 1 and Example 1 of the Ulam reference. - N. J. A. Sloane, Aug 02 2009.
Singmaster calls this the Ulam-Warburton cellular automaton. - N. J. A. Sloane, Aug 05 2009
On the infinite square grid, start with all cells OFF.
Turn a single cell to the ON state.
At each subsequent step, each cell with exactly one neighbor ON is turned ON, and everything that is already ON remains ON.
Here "neighbor" refers to the four adjacent cells in the X and Y directions.
Note that "neighbor" could equally well refer to the four adjacent cells in the diagonal directions, since the graph formed by Z^2 with "one-step rook" adjacencies is isomorphic to Z^2 with "one-step bishop" adjacencies.
Also toothpick sequence starting with a central X-toothpick followed by T-toothpicks (see A160170 and A160172). The sequence gives the number of polytoothpicks in the structure after n-th stage. - Omar E. Pol, Mar 28 2011
It appears that this sequence shares infinitely many terms with both A162795 and A169707, see Formula section and Example section. - Omar E. Pol, Feb 20 2015
It appears that the positive terms are also the odd terms (a bisection) of A151920. - Omar E. Pol, Mar 06 2015
Also, the number of active (ON, black) cells in the n-th stage of growth of two-dimensional cellular automaton defined by Wolfram's "Rule 558" or "Rule 686" based on the 5-celled von Neumann neighborhood. - Robert Price, May 10 2016
From Omar E. Pol, Mar 05 2019: (Start)
a(n) is also the total number of "hidden crosses" after 4*n stages in the toothpick structure of A139250, including the central cross, beginning to count the crosses when their nuclei are totally formed with 4 quadrilaterals.
a(n) is also the total number of "flowers with six petals" after 4*n stages in the toothpick structure of A323650.
Note that the location of the "nuclei of the hidden crosses" and the "flowers with six petals" in both toothpick structures is essentially the same as the location of the "ON" cells in the version "one-step bishop" of this sequence (see the illustration of initial terms, figure 2). (End)
This sequence has almost exactly the same graph as A187220, A162795, A169707 and A160164 which is twice A139250. - Omar E. Pol, Jun 18 2022

Examples

			If we label the generations of cells turned ON by consecutive numbers we get a rosetta cell pattern:
. . . . . . . . . . . . . . . . .
. . . . . . . . 4 . . . . . . . .
. . . . . . . 4 3 4 . . . . . . .
. . . . . . 4 . 2 . 4 . . . . . .
. . . . . 4 3 2 1 2 3 4 . . . . .
. . . . . . 4 . 2 . 4 . . . . . .
. . . . . . . 4 3 4 . . . . . . .
. . . . . . . . 4 . . . . . . . .
. . . . . . . . . . . . . . . . .
In the first generation, only the central "1" is ON, a(1)=1. In the next generation, we turn ON four "2", leading to a(2)=a(1)+4=5. In the third generation, four "3" are turned ON, a(3)=a(2)+4=9. In the fourth generation, each of the four wings allows three 4's to be turned ON, a(4)=a(3)+4*3=21.
From _Omar E. Pol_, Feb 18 2015: (Start)
Also, written as an irregular triangle T(j,k), j>=0, k>=1, in which the row lengths are the terms of A011782:
1;
5;
9,   21;
25,  37, 49, 85;
89, 101,113,149,161,197,233,341;
345,357,369,405,417,453,489,597,609,645,681,789,825,933,1041,1365;
...
The right border gives the positive terms of A002450.
(End)
It appears that T(j,k) = A162795(j,k) = A169707(j,k), if k is a power of 2, for example: it appears that the three mentioned triangles only share the elements from the columns 1, 2, 4, 8, 16, ... - _Omar E. Pol_, Feb 20 2015
		

References

  • S. Ulam, On some mathematical problems connected with patterns of growth of figures, pp. 215-224 of R. E. Bellman, ed., Mathematical Problems in the Biological Sciences, Proc. Sympos. Applied Math., Vol. 14, Amer. Math. Soc., 1962.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 928.

Crossrefs

Programs

  • Maple
    Since this is the partial sum sequence of A147582, it is most easily obtained using the Maple code given in A147582.
    # [x,y] coordinates of cells on
    Lse := [[0,0]] ;
    # enclosing rectangle of the cells on (that is, minima and maxima in Lse)
    xmin := 0 ;
    xmax := 0 ;
    ymin := 0 ;
    ymax := 0 ;
    # count neighbors of x,y which are on; return 0 if [x,y] is in L
    cntnei := proc(x,y,L)
    local a,p,xpt,ypt;
    a := 0 ;
    if not [x,y] in L then
    for p in Lse do
    xpt := op(1,p) ;
    ypt := op(2,p) ;
    if ( abs(xpt-x) = 1 and ypt=y ) or ( x=xpt and abs(ypt-y) = 1) then
    a := a+1 ;
    fi;
    od:
    fi:
    RETURN(a) ;
    end:
    # loop over generations/steps
    for stp from 1 to 10 do
    Lnew := [] ;
    for x from xmin-1 to xmax+1 do
    for y from ymin-1 to ymax+1 do
    if cntnei(x,y,Lse) = 1 then
    Lnew := [op(Lnew),[x,y]] ;
    fi;
    od:
    od:
    for p in Lnew do
    xpt := op(1,p) ;
    ypt := op(2,p) ;
    xmin := min(xmin,xpt) ;
    xmax := max(xmax,xpt) ;
    ymin := min(ymin,ypt) ;
    ymax := max(ymax,ypt) ;
    od:
    Lse := [op(Lse),op(Lnew)] ;
    print(nops(Lse)) ;
  • Mathematica
    Join[{0},Map[Function[Apply[Plus,Flatten[ #1]]],CellularAutomaton[{686,{2,{{0,2,0},{2,1,2},{0,2,0}}},{1,1}},{{{1}},0},200]]] (* Nadia Heninger and N. J. A. Sloane, Aug 11 2009; modified by Paolo Xausa, Aug 12 2022 to include the a(0) term *)
    ArrayPlot /@ CellularAutomaton[{686, {2, {{0, 2, 0}, {2, 1, 2}, {0, 2, 0}}}, {1, 1}}, {{{1}}, 0}, 16] (* N. J. A. Sloane, Nov 08 2014 *)
    A147562list[nmax_]:=Accumulate[Join[{0,1},4*3^(DigitCount[Range[nmax-1],2,1]-1)]];A147562list[100] (* Paolo Xausa, May 21 2023 *)
  • PARI
    a(n) = if (n, 1 + 4*sum(k=1, n-1, 3^(hammingweight(k)-1)), 0); \\ Michel Marcus, Jul 05 2022

Formula

a(n) = 1 + 4*Sum_{k=1..n-1} 3^(wt(k)-1) for n>1, where wt() = A000120(). [Corrected by Paolo Xausa, Aug 12 2022]
For asymptotics see the discussion in the comments in A006046. - N. J. A. Sloane, Mar 11 2021
From Omar E. Pol, Mar 13 2011: (Start)
a(n) = 2*A151917(n) - 1, for n >= 1.
a(n) = 1 + 4*A151920(n-2), for n >= 2.
(End)
It appears that a(n) = A162795(n) = A169707(n), if n is a member of A048645, otherwise a(n) < A162795(n) < A169707(n). - Omar E. Pol, Feb 20 2015
It appears that a(n) = A151920(2n-2), n >= 1. - Omar E. Pol, Mar 06 2015
It appears that a(n) = (A130665(2n-1) - 1)/3, n >= 1. - Omar E. Pol, Mar 07 2015
a(n) = 1 + 4*(A130665(n-1) - 1)/3, n >= 1. Omar E. Pol, Mar 07 2015
a(n) = A323650(2n)/3. - Omar E. Pol, Mar 04 2019

Extensions

Offset and initial terms changed by N. J. A. Sloane, Jun 07 2009
Numbers in the comment adapted to the offset by R. J. Mathar, Mar 03 2010

A018900 Sums of two distinct powers of 2.

Original entry on oeis.org

3, 5, 6, 9, 10, 12, 17, 18, 20, 24, 33, 34, 36, 40, 48, 65, 66, 68, 72, 80, 96, 129, 130, 132, 136, 144, 160, 192, 257, 258, 260, 264, 272, 288, 320, 384, 513, 514, 516, 520, 528, 544, 576, 640, 768, 1025, 1026, 1028, 1032, 1040, 1056, 1088, 1152, 1280, 1536, 2049, 2050, 2052, 2056, 2064, 2080, 2112, 2176, 2304, 2560, 3072
Offset: 1

Views

Author

Jonn Dalton (jdalton(AT)vnet.ibm.com), Dec 11 1996

Keywords

Comments

Appears to give all k such that 8 is the highest power of 2 dividing A005148(k). - Benoit Cloitre, Jun 22 2002
Seen as a triangle read by rows, T(n,k) = 2^(k-1) + 2^n, 1 <= k <= n, the sum of the n-th row equals A087323(n). - Reinhard Zumkeller, Jun 24 2009
Numbers whose base-2 sum of digits is 2. - Tom Edgar, Aug 31 2013
All odd terms are A000051. - Robert G. Wilson v, Jan 03 2014
A239708 holds the subsequence of terms m such that m - 1 is prime. - Hieronymus Fischer, Apr 20 2014

Examples

			From _Hieronymus Fischer_, Apr 27 2014: (Start)
a(1) = 3, since 3 = 2^1 + 2^0.
a(5) = 10, since 10 = 2^3 + 2^1.
a(10^2) = 16640
a(10^3) = 35184372089344
a(10^4) = 2788273714550169769618891533295908724670464 = 2.788273714550...*10^42
a(10^5) = 3.6341936214780344527466190...*10^134
a(10^6) = 4.5332938264998904048012398...*10^425
a(10^7) = 1.6074616084721302346802429...*10^1346
a(10^8) = 1.4662184497310967196301632...*10^4257
a(10^9) = 2.3037539289782230932863807...*10^13462
a(10^10) = 9.1836811272250798973464436...*10^42571
(End)
		

Crossrefs

Cf. A000079, A014311, A014312, A014313, A023688, A023689, A023690, A023691 (Hamming weight = 1, 3, 4, ..., 9).
Sum of base-b digits equal b: A226636 (b = 3), A226969 (b = 4), A227062 (b = 5), A227080 (b = 6), A227092 (b = 7), A227095 (b = 8), A227238 (b = 9), A052224 (b = 10). - M. F. Hasler, Dec 23 2016

Programs

  • C
    unsigned hakmem175(unsigned x) {
        unsigned s, o, r;
        s = x & -x; r = x + s;
        o = x ^ r;  o = (o >> 2) / s;
        return r | o;
    }
    unsigned A018900(int n) {
        if (n == 1) return 3;
        return hakmem175(A018900(n - 1));
    } // Peter Luschny, Jan 01 2014
    
  • Haskell
    a018900 n = a018900_list !! (n-1)
    a018900_list = elemIndices 2 a073267_list  -- Reinhard Zumkeller, Mar 07 2012
    
  • Maple
    a:= n-> (i-> 2^i+2^(n-1-i*(i-1)/2))(floor((sqrt(8*n-1)+1)/2)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 01 2022
  • Mathematica
    Select[ Range[ 1056 ], (Count[ IntegerDigits[ #, 2 ], 1 ]==2)& ]
    Union[Total/@Subsets[2^Range[0,10],{2}]] (* Harvey P. Dale, Mar 04 2012 *)
  • PARI
    for(m=1,9,for(n=0,m-1,print1(2^m+2^n", "))) \\ Charles R Greathouse IV, Sep 09 2011
    
  • PARI
    is(n)=hammingweight(n)==2 \\ Charles R Greathouse IV, Mar 03 2014
    
  • PARI
    for(n=0,10^5,if(hammingweight(n)==2,print1(n,", "))); \\ Joerg Arndt, Mar 04 2014
    
  • PARI
    a(n)= my(t=sqrtint(n*8)\/2); 2^t + 2^(n-1-t*(t-1)/2); \\ Ruud H.G. van Tol, Nov 30 2024
    
  • Python
    print([n for n in range(1, 3001) if bin(n)[2:].count("1")==2]) # Indranil Ghosh, Jun 03 2017
    
  • Python
    A018900_list = [2**a+2**b for a in range(1,10) for b in range(a)] # Chai Wah Wu, Jan 24 2021
    
  • Python
    from math import isqrt, comb
    def A018900(n): return (1<<(m:=isqrt(n<<3)+1>>1))+(1<<(n-1-comb(m,2))) # Chai Wah Wu, Oct 30 2024
  • Smalltalk
    distinctPowersOf: b
      "Version 1: Answers the n-th number of the form b^i + b^j, i>j>=0, where n is the receiver.
      b > 1 (b = 2, for this sequence).
      Usage: n distinctPowersOf: 2
      Answer: a(n)"
      | n i j |
      n := self.
      i := (8*n - 1) sqrtTruncated + 1 // 2.
      j := n - (i*(i - 1)/2) - 1.
      ^(b raisedToInteger: i) + (b raisedToInteger: j)
    [by Hieronymus Fischer, Apr 20 2014]
    ------------
    
  • Smalltalk
    distinctPowersOf: b
      "Version 2: Answers an array which holds the first n numbers of the form b^i + b^j, i>j>=0, where n is the receiver. b > 1 (b = 2, for this sequence).
      Usage: n distinctPowersOf: 2
      Answer: #(3 5 6 9 10 12 ...) [first n terms]"
      | k p q terms |
      terms := OrderedCollection new.
      k := 0.
      p := b.
      q := 1.
      [k < self] whileTrue:
             [[q < p and: [k < self]] whileTrue:
                       [k := k + 1.
                       terms add: p + q.
                       q := b * q].
             p := b * p.
             q := 1].
      ^terms as Array
    [by Hieronymus Fischer, Apr 20 2014]
    ------------
    
  • Smalltalk
    floorDistinctPowersOf: b
      "Answers an array which holds all the numbers b^i + b^j < n, i>j>=0, where n is the receiver.
      b > 1 (b = 2, for this sequence).
      Usage: n floorDistinctPowersOf: 2
      Answer: #(3 5 6 9 10 12 ...) [all terms < n]"
      | a n p q terms |
      terms := OrderedCollection new.
      n := self.
      p := b.
      q := 1.
      a := p + q.
      [a < n] whileTrue:
             [[q < p and: [a < n]] whileTrue:
                       [terms add: a.
                       q := b * q.
                       a := p + q].
             p := b * p.
             q := 1.
             a := p + q].
      ^terms as Array
    [by Hieronymus Fischer, Apr 20 2014]
    ------------
    
  • Smalltalk
    invertedDistinctPowersOf: b
      "Given a number m which is a distinct power of b, this method answers the index n such that there are uniquely defined i>j>=0 for which b^i + b^j = m, where m is the receiver;  b > 1 (b = 2, for this sequence).
      Usage: m invertedDistinctPowersOf: 2
      Answer: n such that a(n) = m, or, if no such n exists, min (k | a(k) >= m)"
      | n i j k m |
      m := self.
      i := m integerFloorLog: b.
      j := m - (b raisedToInteger: i) integerFloorLog: b.
      n := i * (i - 1) / 2 + 1 + j.
      ^n
    [by Hieronymus Fischer, Apr 20 2014]
    

Formula

a(n) = 2^trinv(n-1) + 2^((n-1)-((trinv(n-1)*(trinv(n-1)-1))/2)), i.e., 2^A002024(n)+2^A002262(n-1). - Antti Karttunen
a(n) = A059268(n-1) + A140513(n-1). A000120(a(n)) = 2. Complement of A161989. A151774(a(n)) = 1. - Reinhard Zumkeller, Jun 24 2009
A073267(a(n)) = 2. - Reinhard Zumkeller, Mar 07 2012
Start with A000051. If n is in sequence, then so is 2n. - Ralf Stephan, Aug 16 2013
a(n) = A057168(a(n-1)) for n>1 and a(1) = 3. - Marc LeBrun, Jan 01 2014
From Hieronymus Fischer, Apr 20 2014: (Start)
Formulas for a general parameter b according to a(n) = b^i + b^j, i>j>=0; b = 2 for this sequence.
a(n) = b^i + b^j, where i = floor((sqrt(8n - 1) + 1)/2), j = n - 1 - i*(i - 1)/2 [for a Smalltalk implementation see Prog section, method distinctPowersOf: b (2 versions)].
a(A000217(n)) = (b + 1)*b^(n-1) = b^n + b^(n-1).
a(A000217(n)+1) = 1 + b^(n+1).
a(n + 1 + floor((sqrt(8n - 1) + 1)/2)) = b*a(n).
a(n + 1 + floor(log_b(a(n)))) = b*a(n).
a(n + 1) = b^2/(b+1) * a(n) + 1, if n is a triangular number (s. A000217).
a(n + 1) = b*a(n) + (1-b)* b^floor((sqrt(8n - 1) + 1)/2), if n is not a triangular number.
The next term can also be calculated without using the index n. Let m be a term and i = floor(log_b(m)), then:
a(n + 1) = b*m + (1-b)* b^i, if floor(log_b(m/(b+1))) + 1 < i,
a(n + 1) = b^2/(b+1) * m + 1, if floor(log_b(m/(b+1))) + 1 = i.
Partial sum:
Sum_{k=1..n} a(k) = ((((b-1)*(j+1)+i-1)*b^(i-j) + b)*b^j - i)/(b-1), where i = floor((sqrt(8*n - 1) + 1)/2), j = n - 1 - i*(i - 1)/2.
Inverse:
For each sequence term m, the index n such that a(n) = m is determined by n := i*(i-1)/2 + j + 1, where i := floor(log_b(m)), j := floor(log_b(m - b^floor(log_b(m)))) [for a Smalltalk implementation see Prog section, method invertedDistinctPowersOf: b].
Inequalities:
a(n) <= (b+1)/b * b^floor(sqrt(2n)+1/2), equality holds for triangular numbers.
a(n) > b^floor(sqrt(2n)+1/2).
a(n) < b^sqrt(2n)*sqrt(b).
a(n) > b^sqrt(2n)/sqrt(b).
Asymptotic behavior:
lim sup a(n)/b^sqrt(2n) = sqrt(b).
lim inf a(n)/b^sqrt(2n) = 1/sqrt(b).
lim sup a(n)/b^(floor(sqrt(2n))) = b.
lim inf a(n)/b^(floor(sqrt(2n))) = 1.
lim sup a(n)/b^(floor(sqrt(2n)+1/2)) = (b+1)/b.
lim inf a(n)/b^(floor(sqrt(2n)+1/2)) = 1.
(End)
Sum_{n>=1} 1/a(n) = A179951. - Amiram Eldar, Oct 06 2020

Extensions

Edited by M. F. Hasler, Dec 23 2016

A003313 Length of shortest addition chain for n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Equivalently, minimal number of multiplications required to compute the n-th power.

Examples

			For n < 149 and for many higher values of n, a(n) is the depth of n in a tree whose first 6 levels are shown below. The path from the root of the tree to n gives an optimal addition chain. (See Knuth, Vol. 2, Sect. 4.6.3, Fig. 14 and Ex. 5.)
                  1
                  |
                  2
                 / \
                /   \
               /     \
              /       \
             /         \
            3           4
           / \           \
          /   \           \
         /     \           \
        /       \           \
       5         6           8
      / \        |         /   \
     /   \       |        /     \
    7    10      12      9       16
   /    /  \    /  \    /  \    /  \
  14   11  20  15  24  13  17  18  32
E.g., a(15) = 5 and an optimal chain for 15 is 1, 2, 3, 6, 12, 15.
It is not possible to extend the tree to include the optimal addition chains for all n. For example, the chains for 43, 77, and 149 are incompatible. See the link to Achim Flammenkamp's web page on addition chains.
		

References

  • Hatem M. Bahig, Mohamed H. El-Zahar, and Ken Nakamula, Some results for some conjectures in addition chains, in Combinatorics, computability and logic, pp. 47-54, Springer Ser. Discrete Math. Theor. Comput. Sci., Springer, London, 2001.
  • D. Bleichenbacher and A. Flammenkamp, An Efficient Algorithm for Computing Shortest Addition Chains, Preprint, 1997.
  • A. Flammenkamp, Drei Beitraege zur diskreten Mathematik: Additionsketten, No-Three-in-Line-Problem, Sociable Numbers, Diplomarbeit, Bielefeld 1991.
  • S. B. Gashkov and V. V. Kochergin, On addition chains of vectors, gate circuits and the complexity of computations of powers [translation of Metody Diskret. Anal. No. 52 (1992), 22-40, 119-120; 1265027], Siberian Adv. Math. 4 (1994), 1-16.
  • A. A. Gioia and M. V. Subbarao, The Scholz-Brauer problem in addition chains, II, in Proceedings of the Eighth Manitoba Conference on Numerical Mathematics and Computing (Univ. Manitoba, Winnipeg, Man., 1978), pp. 251-274, Congress. Numer., XXII, Utilitas Math., Winnipeg, Man., 1979.
  • D. E. Knuth, The Art of Computer Programming, vol. 2, Seminumerical Algorithms, 2nd ed., Fig. 14 on page 403; 3rd edition, 1998, p. 465.
  • D. E. Knuth, website, further updates to Vol. 2 of TAOCP.
  • Michael O. Rabin and Shmuel Winograd, "Fast evaluation of polynomials by rational preparation." Communications on Pure and Applied Mathematics 25.4 (1972): 433-458. See Table p. 455.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Formula

a(n*m) <= a(n)+a(m). In particular, a(n^k) <= k * a(n). - Max Alekseyev, Jul 22 2005
For all n >= 2, a(n) <= (4/3)*floor(log_2 n) + 2. - Jonathan Vos Post, Oct 08 2008
From Achim Flammenkamp, Oct 26 2016: (Start)
a(n) <= 9/log_2(71) log_2(n), for all n.
It is conjectured by D. E. Knuth, K. Stolarsky et al. that for all n: floor(log_2(n)) + ceiling(log_2(v(n))) <= a(n). (End)
a(n) <= A014701(n). - Charles R Greathouse IV, Jan 03 2018
From Szymon Lukaszyk, Apr 05 2024: (Start)
For n = 2^s, a(n)=s;
for n = 2^s + 2^m, m in [0..s-1] (A048645), a(n)=s+1;
for n = 2^s + 3*2^m, m in [0..s-2] (A072823), a(n)=s+2;
for n = 2^s + 7*2^(s-3), s>2 (A072823), a(n)=s+2.(End)

Extensions

More terms from Jud McCranie, Nov 01 2001

A169707 Total number of ON cells at stage n of two-dimensional cellular automaton defined by "Rule 750" using the von Neumann neighborhood.

Original entry on oeis.org

1, 5, 9, 21, 25, 37, 57, 85, 89, 101, 121, 149, 169, 213, 281, 341, 345, 357, 377, 405, 425, 469, 537, 597, 617, 661, 729, 805, 889, 1045, 1241, 1365, 1369, 1381, 1401, 1429, 1449, 1493, 1561, 1621, 1641, 1685, 1753, 1829, 1913, 2069, 2265, 2389, 2409, 2453, 2521
Offset: 1

Views

Author

N. J. A. Sloane, Apr 17 2010

Keywords

Comments

Square grid, 4 neighbors per cell (N, E, S, W cells), turn ON iff exactly 1 or 3 neighbors are ON; once ON, cells stay ON.
The terms agree with those of A246335 for n <= 11, although the configurations are different starting at n = 7. - N. J. A. Sloane, Sep 21 2014
Offset 1 is best for giving a formula for a(n), although the Maple and Mathematica programs index the states starting at state 0.
It appears that this shares infinitely many terms with both A162795 and A147562, see Formula section and Example section. - Omar E. Pol, Feb 19 2015

Examples

			Divides naturally into blocks of sizes 1,2,4,8,16,...:
1,
5, 9,
21, 25, 37, 57,
85, 89, 101, 121, 149, 169, 213, 281, <- terms 8 through 15
341, 345, 357, 377, 405, 425, 469, 537, 597, 617, 661, 729, 805, 889, 1045, 1241,
1365, 1369, 1381, 1401, 1429, 1449, 1493, 1561, 1621, 1641, 1685, 1753, 1829, 1913, 2069, 2265, 2389, 2409, 2453, 2521, ...
From _Omar E. Pol_, Feb 18 2015: (Start)
Also, written as an irregular triangle T(j,k), k>=1, in which the row lengths are the terms of A011782:
1;
5;
9,   21;
25,  37,   57,  85;
89,  101, 121, 149, 169, 213, 281, 341;
345, 357, 377, 405, 425, 469, 537, 597, 617, 661, 729, 805, 889, 1045, 1241, 1365;
The right border gives the positive terms of A002450.
It appears that T(j,k) = A162795(j,k) = A147562(j,k), if k is a power of 2, for example: it appears that the three mentioned triangles only share the elements from the columns 1, 2, 4, 8, 16, ...
(End)
		

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 928.

Crossrefs

Cf. A169708 (first differences), A147562, A147582, A169648, A169649, A169709, A169710, A246333, A246334, A246335, A246336, A253098 (partial sums).
See A253088 for the analogous CA using Rule 750 and a 9-celled neighborhood.

Programs

  • Maple
    (Maple program that uses the actual definition of the automaton, rather than the (conjectured) formula, from N. J. A. Sloane, Feb 15 2015):
    # Count terms in a polynomial:
    C := f->`if`(type(f, `+`), nops(f), 1);
    # Replace all nonzero coeffts by 1:
    bool := proc(f) local ix, iy, f2, i, t1, t2, A;
    f2:=expand(f);
    if whattype(f) = `+` then
    t1:=nops(f2); A:=0;
    for i from 1 to t1 do t2:=op(i, f2); ix:=degree(t2, x); iy:=degree(t2, y);
    A:=A+x^ix*y^iy; od: A;
    else ix:=degree(f2, x); iy:=degree(f2, y); x^ix*y^iy;
    fi;
    end;
    # a loop that produces M steps of A169707 and A169708:
    M:=20;
    F:=x*y+x/y+1/x*y+1/x/y mod 2;
    GG[0]:=1;
    for n from 1 to M do dd[n]:=expand(F*GG[n-1]) mod 2;
    GG[n]:=bool(GG[n-1]+dd[n]);
    lprint(n,C(GG[n]), C(GG[n]-GG[n-1])); od:
  • Mathematica
    Map[Function[Apply[Plus,Flatten[ #1]]], CellularAutomaton[{ 750, {2,{{0,2,0},{2,1,2},{0,2,0}}},{1,1}},{{{1}},0},100]]
    ArrayPlot /@ CellularAutomaton[{750, {2, {{0, 2, 0}, {2, 1, 2}, {0, 2, 0}}}, {1, 1}}, {{{1}}, 0}, 23]
    (* The next two lines deal with the equivalent CA based on neighbors NW, NE, SE, SW. This is to facilitate the comparison with A246333 and A246335 *)
    Map[Function[Apply[Plus, Flatten[ #1]]], CellularAutomaton[{ 750, {2, {{2, 0, 2}, {0, 1, 0}, {2, 0, 2}}}, {1, 1}}, {{{1}}, 0}, 100]]
    ArrayPlot /@ CellularAutomaton[{750, {2, {{2, 0, 2}, {0, 1, 0}, {2, 0, 2}}}, {1, 1}}, {{{1}}, 0}, 23]

Formula

a(2^k + i) = (4^(k+1)-1)/3 + 4*A246336(i), for k >= 0, 0 <= i < 2^k. For example, if n = 15 = 2^3 + 7, so k=3, i=7, we have a(15) = (4^4-1)/3 + 4*A246336(7) = 85 + 4*49 = 281.
a(n) = 1 + 2*(A139250(n) - A160552(n)) = A160164(n) - A170903(n) = A187220(n) + 2*(A160552(n-1)). - Omar E. Pol, Feb 18 2015
It appears that a(n) = A162795(n) = A147562(n), if n is a member of A048645, otherwise a(n) > A162795(n) > A147562(n). - Omar E. Pol, Feb 19 2015
It appears that a(n) = 1 + 4*A255747(n-1). - Omar E. Pol, Mar 05 2015
It appears that a(n) = 1 + 4*(A139250(n-1) - (a(n-1) - 1)/4), n > 1. - Omar E. Pol, Jul 24 2015
It appears that a(2n) = 1 + 4*A162795(n). - Omar E. Pol, Jul 04 2017

Extensions

Edited (added formula, illustration, etc.) by N. J. A. Sloane, Aug 30 2014
Offset changed to 1 by N. J. A. Sloane, Feb 09 2015

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

Views

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

A162795 Total number of toothpicks in the toothpick structure A139250 that are parallel to the initial toothpick, after n odd rounds.

Original entry on oeis.org

1, 5, 9, 21, 25, 37, 53, 85, 89, 101, 117, 149, 165, 201, 261, 341, 345, 357, 373, 405, 421, 457, 517, 597, 613, 649, 709, 793, 853, 965, 1173, 1365, 1369, 1381, 1397, 1429, 1445, 1481, 1541, 1621, 1637, 1673, 1733, 1817, 1877, 1989, 2197, 2389, 2405, 2441, 2501
Offset: 1

Author

Omar E. Pol, Jul 14 2009

Keywords

Comments

Partial sums of A162793.
Also, total number of ON cells at stage n of the two-dimensional cellular automaton defined as follows: replace every "vertical" toothpick of length 2 with a centered unit square "ON" cell, so we have a cellular automaton which is similar to both A147562 and A169707 (this is the "one-step bishop" version). For the "one-step rook" version we use toothpicks of length sqrt(2), then rotate the structure 45 degrees and then replace every toothpick with a unit square "ON" cell. For the illustration of the sequence as a cellular automaton we now have three versions: the original version with toothpicks, the one-step rook version and one-step bishop version. Note that the last two versions refer to the standard ON cells in the same way as the two versions of A147562 and the two versions of A169707. It appears that the graph of this sequence lies between the graphs of A147562 and A169707. Also, it appears that this sequence shares infinitely many terms with both A147562 and A169707, see Formula section and Example section. - Omar E. Pol, Feb 20 2015
It appears that this is also a bisection (the odd terms) of A255747.

Examples

			From _Omar E. Pol_, Feb 18 2015: (Start)
Written as an irregular triangle T(j,k), k>=1, in which the row lengths are the terms of A011782:
    1;
    5;
    9, 21;
   25, 37, 53, 85;
   89,101,117,149,165,201,261,341;
  345,357,373,405,421,457,517,597,613,649,709,793,853,965,1173,1365;
  ...
The right border gives the positive terms of A002450.
(End)
It appears that T(j,k) = A147562(j,k) = A169707(j,k), if k is a power of 2, for example: it appears that the three mentioned triangles only share the elements of the columns 1, 2, 4, 8, 16, ... - _Omar E. Pol_, Feb 20 2015
		

Formula

It appears that a(n) = A147562(n) = A169707(n), if n is a term of A048645, otherwise A147562(n) < a(n) < A169707(n). - Omar E. Pol, Feb 20 2015
It appears that a(n) = (A169707(2n) - 1)/4 = A255747(2n-1). - Omar E. Pol, Mar 07 2015
a(n) = 1 + 4*A255737(n-1). - Omar E. Pol, Mar 08 2015

Extensions

More terms from N. J. A. Sloane, Dec 28 2009

A295235 Numbers k such that the positions of the ones in the binary representation of k are in arithmetic progression.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 24, 28, 30, 31, 32, 33, 34, 36, 40, 42, 48, 56, 60, 62, 63, 64, 65, 66, 68, 72, 73, 80, 84, 85, 96, 112, 120, 124, 126, 127, 128, 129, 130, 132, 136, 144, 146, 160, 168, 170, 192, 224, 240, 248
Offset: 1

Author

Rémy Sigrist, Nov 18 2017

Keywords

Comments

Also numbers k of the form Sum_{b=0..h-1} 2^(i+j*b) for some h >= 0, i >= 0, j > 0 (in fact, h = A000120(k), and if k > 0, i = A007814(k)).
There is a simple bijection between the finite sets of nonnegative integers in arithmetic progression and the terms of this sequence: s -> Sum_{i in s} 2^i; the term 0 corresponds to the empty set.
For any n > 0, A054519(n) gives the numbers of terms with n+1 digits in binary representation.
For any n >= 0, n is in the sequence iff 2*n is in the sequence.
For any n > 0, A000695(a(n)) is in the sequence.
The first prime numbers in the sequence are: 2, 3, 5, 7, 17, 31, 73, 127, 257, 8191, 65537, 131071, 262657, 524287, ...
This sequence contains the following sequences: A000051, A000079, A000225, A000668, A002450, A019434, A023001, A048645.
For any k > 0, 2^k - 2, 2^k - 1, 2^k, 2^k + 1 and 2^k + 2 are in the sequence (e.g., 14, 15, 16, 17, and 18).
Every odd term is a binary palindrome (and thus belongs to A006995).
Odd terms are A064896. - Robert Israel, Nov 20 2017

Examples

			The binary representation of the number 42 is "101010" and has ones evenly spaced, hence 42 appears in the sequence.
The first terms, alongside their binary representations, are:
   n  a(n)  a(n) in binary
  --  ----  --------------
   1    0           0
   2    1           1
   3    2          10
   4    3          11
   5    4         100
   6    5         101
   7    6         110
   8    7         111
   9    8        1000
  10    9        1001
  11   10        1010
  12   12        1100
  13   14        1110
  14   15        1111
  15   16       10000
  16   17       10001
  17   18       10010
  18   20       10100
  19   21       10101
  20   24       11000
		

Crossrefs

Cf. A029931, A048793 (binary indices triangle), A070939, A291166, A325328 (prime indices rather than binary indices), A326669, A326675.

Programs

  • Maple
    f:= proc(d) local i,j,k;
      op(sort([seq(seq(add(2^(d-j*k),k=0..m),m=1..d/j),j=1..d),2^(d+1)]))
    end proc:
    0,1,seq(f(d),d=0..10); # Robert Israel, Nov 20 2017
  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Select[Range[100],SameQ@@Differences[bpe[#]]&] (* Gus Wiseman, Jul 22 2019 *)
  • PARI
    is(n) = my(h=hammingweight(n)); if(h<3, return(1), my(i=valuation(n,2),w=#binary(n)); if((w-i-1)%(h-1)==0, my(j=(w-i-1)/(h-1)); return(sum(k=0,h-1,2^(i+j*k))==n), return(0)))
Showing 1-10 of 33 results. Next