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

A110240 Decimal form of binary integer produced by the ON cells at n-th generation following Wolfram's Rule 30 cellular automaton starting from a single ON-cell represented as 1.

Original entry on oeis.org

1, 7, 25, 111, 401, 1783, 6409, 28479, 102849, 456263, 1641433, 7287855, 26332369, 116815671, 420186569, 1865727615, 6741246849, 29904391303, 107568396185, 477630335215, 1725755276049, 7655529137527, 27537575631497
Offset: 0

Views

Author

Keywords

Comments

See A245549 for binary equivalents. See A070952 for number of ON cells. - N. J. A. Sloane, Jul 28 2014
For n > 0: 3 < a(n+1) / a(n) < 5, floor(a(n+1)/a(n)) = A010702(n+1). - Reinhard Zumkeller, Jun 08 2013
Iterates of A269160 starting from a(0) = 1. See also A269168. - Antti Karttunen, Feb 20 2016
Also, the decimal representation of the n-th generation of the "Rule 66847740" 5-neighbors elementary cellular automaton starting with a single ON (black) cell. - Philipp O. Tsvetkov, Jul 17 2019

Examples

			a(1)=1 because the automaton begins at first "generation" with one black cell: 1;
a(2)=5 because one black cell, through Rule 30 at 2nd generation, produces three contiguous black cells: 111 (binary), so 7 (decimal);
a(3)=25 because the third generation is "black black white white black" cells: 11001, so 25 (decimal).
		

Crossrefs

Cf. A030101, A070950, A051023, A092539, A092540, A070952 (number of ON cells, the binary weight of terms), A100053, A100054, A100055, A094603, A094604, A000225, A074890, A010702, A245549, A269160, A269162.
Cf. A269165 (indices of ones in this sequence).
Cf. A269166 (a left inverse).
Left edge of A269168.
Cf. also A265281, A328106.
For bitwise XOR (and OR) combinations with other such 1D CA trajectories, see for example: A327971, A327972, A327973, A327976, A328103, A328104.

Programs

  • Haskell
    a110240 = foldl (\v d -> 2 * v + d) 0 . map toInteger . a070950_row
    -- Reinhard Zumkeller, Jun 08 2013
    
  • Mathematica
    rows = 23; ca = CellularAutomaton[30, {{1}, 0}, rows-1]; Table[ FromDigits[ ca[[k, rows-k+1 ;; rows+k-1]], 2], {k, 1, rows}] (* Jean-François Alcover, Jun 07 2012 *)
  • PARI
    A269160(n) = bitxor(n, bitor(2*n, 4*n));
    A110240(n) = if(!n,1,A269160(A110240(n-1))); \\ Antti Karttunen, Oct 05 2019
    
  • Python
    def A269160(n): return(n^((n<<1)|(n<<2)))
    def genA110240():
        '''Yield successive terms of A110240 (Rule 30) starting from A110240(0)=1.'''
        s = 1
        while True:
           yield s
           s = A269160(s)
    def take(n, g):
        '''Returns a list composed of the next n elements returned by generator g.'''
        z = []
        if 0 == n: return(z)
        for x in g:
            z.append(x)
            if n > 1: n = n-1
            else: return(z)
    take(30, genA110240())
    # Antti Karttunen, Oct 05 2019
  • Scheme
    ;; With memoization-macro definec.
    (definec (A110240 n) (if (zero? n) 1 (A269160 (A110240 (- n 1)))))
    ;; Antti Karttunen, Feb 20 2016
    

Formula

From Antti Karttunen, Feb 20 2016: (Start)
a(0) = 1, for n >= 1, a(n) = A269160(a(n-1)).
a(n) = A030101(A265281(n)). [The rule 30 is the mirror image of the rule 86.]
A269166(a(n)) = n for all n >= 0. (End)
From Antti Karttunen, Oct 05 2019: (Start)
For n >= 1, a(n) = a(n-1) XOR 2*A328104(n-1).
For n >= 1, a(n) = 2*a(n-1) XOR A327973(n). (End)

Extensions

More terms from Eric W. Weisstein, Apr 08 2006
Offset corrected by Reinhard Zumkeller, Jun 08 2013

A376033 Number A(n,k) of binary words of length n avoiding distance (i+1) between "1" digits if the i-th bit is set in the binary representation of k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 1, 2, 3, 8, 1, 2, 4, 5, 16, 1, 2, 3, 6, 8, 32, 1, 2, 4, 4, 9, 13, 64, 1, 2, 3, 8, 6, 15, 21, 128, 1, 2, 4, 5, 12, 9, 25, 34, 256, 1, 2, 3, 6, 7, 18, 13, 40, 55, 512, 1, 2, 4, 4, 8, 11, 27, 19, 64, 89, 1024, 1, 2, 3, 8, 5, 11, 16, 45, 28, 104, 144, 2048
Offset: 0

Views

Author

Alois P. Heinz, Sep 09 2024

Keywords

Comments

Also the number of subsets of [n] avoiding distance (i+1) between elements if the i-th bit is set in the binary representation of k. A(6,3) = 13: {}, {1}, {2}, {3}, {4}, {5}, {6}, {1,4}, {1,5}, {1,6}, {2,5}, {2,6}, {3,6}.
Each column sequence satisfies a linear recurrence with constant coefficients.
The sequence of row n is periodic with period A011782(n) = ceiling(2^(n-1)).

Examples

			A(6,6) = 17: 000000, 000001, 000010, 000011, 000100, 000110, 001000, 001100, 010000, 010001, 011000, 100000, 100001, 100010, 100011, 110000, 110001 because 6 = 110_2 and no two "1" digits have distance 2 or 3.
A(6,7) = 10: 000000, 000001, 000010, 000100, 001000, 010000, 010001, 100000, 100001, 100010.
A(7,7) = 14: 0000000, 0000001, 0000010, 0000100, 0001000, 0010000, 0010001, 0100000, 0100001, 0100010, 1000000, 1000001, 1000010, 1000100.
Square array A(n,k) begins:
     1,  1,   1,  1,   1,  1,  1,  1,   1,  1, ...
     2,  2,   2,  2,   2,  2,  2,  2,   2,  2, ...
     4,  3,   4,  3,   4,  3,  4,  3,   4,  3, ...
     8,  5,   6,  4,   8,  5,  6,  4,   8,  5, ...
    16,  8,   9,  6,  12,  7,  8,  5,  16,  8, ...
    32, 13,  15,  9,  18, 11, 11,  7,  24, 11, ...
    64, 21,  25, 13,  27, 16, 17, 10,  36, 17, ...
   128, 34,  40, 19,  45, 25, 27, 14,  54, 25, ...
   256, 55,  64, 28,  75, 37, 41, 19,  81, 37, ...
   512, 89, 104, 41, 125, 57, 60, 26, 135, 57, ...
		

Crossrefs

Columns k=0-20 give: A000079, A000045(n+2), A006498(n+2), A000930(n+2), A006500, A130137, A079972(n+3), A003269(n+4), A031923(n+1), A263710(n+1), A224809(n+4), A317669(n+4), A351873, A351874, A121832(n+4), A003520(n+4), A208742, A374737, A375977, A375980, A375978.
Rows n=0-2 give: A000012, A007395(k+1), A010702(k+1).
Main diagonal gives A376091.
A(n,2^k-1) gives A141539.
A(2^n-1,2^n-1) gives A376697.
A(n,2^k) gives A209435.

Programs

  • Maple
    h:= proc(n) option remember; `if`(n=0, 1, 2^(1+ilog2(n))) end:
    b:= proc(n, k, t) option remember; `if`(n=0, 1, add(`if`(j=1 and
          Bits[And](t, k)>0, 0, b(n-1, k, irem(2*t+j, h(k)))), j=0..1))
        end:
    A:= (n, k)-> b(n, k, 0):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • PARI
    step(v,b)={vector(#v, i, my(j=(i-1)>>1); if(bittest(i-1,0), if(bitand(b,j)==0, v[1+j], 0), v[1+j] + v[1+#v/2+j]));}
    col(n,k)={my(v=vector(2^(1+logint(k,2))), r=vector(1+n)); v[1]=r[1]=1; for(i=1, n, v=step(v,k); r[1+i]=vecsum(v)); r}
    A(n,k)=if(k==0, 2^n, col(n,k)[n+1]) \\ Andrew Howroyd, Oct 03 2024

Formula

A(n,k) = A(n,k+ceiling(2^(n-1))).
A(n,ceiling(2^(n-1))-1) = n+1.
A(n,ceiling(2^(n-2))) = ceiling(3*2^(n-2)) = A098011(n+2).

A047355 Numbers that are congruent to {0, 3} mod 7.

Original entry on oeis.org

0, 3, 7, 10, 14, 17, 21, 24, 28, 31, 35, 38, 42, 45, 49, 52, 56, 59, 63, 66, 70, 73, 77, 80, 84, 87, 91, 94, 98, 101, 105, 108, 112, 115, 119, 122, 126, 129, 133, 136, 140, 143, 147, 150, 154, 157, 161, 164, 168, 171, 175, 178, 182, 185, 189, 192, 196, 199, 203
Offset: 1

Views

Author

Keywords

Comments

Numbers k such that k^2/7 + k*(k + 1)/7 = k*(2*k + 1)/7 is a nonnegative integer. - Bruno Berselli, Feb 14 2017

Crossrefs

Cf. A030123, A010702 (first differences).

Programs

Formula

a(n) = a(n-2) + 7 = a(n-1) + a(n-2) - a(n-3). - Henry Bottomley, Jan 19 2001
From Bruno Berselli, Sep 12 2011: (Start)
G.f.: x^2*(3 + 4*x)/((1 + x)*(1 - x)^2).
a(n) = (14*n - (-1)^n - 15)/4. (End)
a(n+1) = Sum_{k>=0} A030308(n,k)*A125176(k+2). - Philippe Deléham, Oct 17 2011
a(n) = 2*n - 2 + floor((3*n - 3)/2). - Wesley Ivan Hurt, Jan 30 2014
E.g.f.: 4 + ((14*x - 15)*exp(x) - exp(-x))/4. - David Lovler, Aug 31 2022

A010695 Period 2: repeat (2,5).

Original entry on oeis.org

2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5, 2, 5
Offset: 0

Views

Author

Keywords

Comments

Also decimal expansion of 25/99.
Continued fraction expansion of A176052. - R. J. Mathar, Mar 08 2012
Periodic part of the partial quotients of the continued fraction expansion of sqrt(7/5), which starts [1, 5, 2, 5, 2, 5, ...]. - Hugo Pfoertner, Jan 10 2025

Crossrefs

Cf. A010674 (2^(1-(-1)^n) - 1).
Cf. A010691.

Programs

  • Magma
    &cat [[2,5]^^50]; // Bruno Berselli, Dec 29 2015
  • Mathematica
    PadRight[{}, 100, {2, 5}] (* Paolo Xausa, Jan 16 2025 *)
  • Maxima
    makelist(if evenp(n) then 2 else 5, n, 0, 80); /* Martin Ettl, Nov 09 2012 */
    

Formula

G.f.: (2+5*x)/((1-x)*(1+x)). - R. J. Mathar, Nov 21 2011
a(n) = 2^(1-(-1)^n) + 1. - Bruno Berselli, Dec 29 2015
From Nicolas Bělohoubek, Nov 11 2021: (Start)
a(n) = 10/a(n-1). See also A010691.
a(n) = 7 - a(n-1). See also A010702. (End)

Extensions

Edited by Bruno Berselli, Dec 29 2015

A047356 Numbers that are congruent to {1, 3} mod 7.

Original entry on oeis.org

1, 3, 8, 10, 15, 17, 22, 24, 29, 31, 36, 38, 43, 45, 50, 52, 57, 59, 64, 66, 71, 73, 78, 80, 85, 87, 92, 94, 99, 101, 106, 108, 113, 115, 120, 122, 127, 129, 134, 136, 141, 143, 148, 150, 155, 157, 162, 164, 169
Offset: 1

Views

Author

Keywords

Comments

This sequence is related to A010702 by a(n) = (Sum_{i=1..n} A010702(i)) - A010702(n+1). - Bruno Berselli, Mar 12 2012

Crossrefs

Cf. A010702.

Programs

  • Mathematica
    With[{c=7 Range[0,50]},Sort[Join[c+1,c+3]]] (* or *) LinearRecurrence[ {1,1,-1},{1,3,8},100] (* Harvey P. Dale, May 29 2012 *)
  • PARI
    a(n) = (14*n - 13 - 3*(-1)^n)/4 \\ David Lovler, Sep 11 2022

Formula

a(n) = 7*n - a(n-1) - 10 with n > 1, a(1)=1. - Vincenzo Librandi, Aug 05 2010
From R. J. Mathar, Oct 08 2011: (Start)
a(n) = 7*n/2 - 13/4 - 3*(-1)^n/4.
G.f.: x*(1+2*x+4*x^2) / ( (1+x)*(x-1)^2 ). (End)
E.g.f.: 4 + ((14*x - 13)*exp(x) - 3*exp(-x))/4. - David Lovler, Sep 11 2022

A274913 Square array read by antidiagonals upwards in which each new term is the least positive integer distinct from its neighbors.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Jul 11 2016

Keywords

Comments

This is also a triangle read by rows in which each new term is the least positive integer distinct from its neighbors.
In the square array we have that:
Antidiagonal sums give the positive terms of A008851.
Odd-indexed rows give A010684.
Even-indexed rows give A010694.
Odd-indexed columns give A000034.
Even-indexed columns give A010702.
Odd-indexed antidiagonals give the initial terms of A010685.
Even-indexed antidiagonals give the initial terms of A010693.
Main diagonal gives A010685.
This is also a triangle read by rows in which each new term is the least positive integer distinct from its neighbors.
In the triangle we have that:
Row sums give the positive terms of A008851.
Odd-indexed columns give A000034.
Even-indexed columns give A010702.
Odd-indexed diagonals give A010684.
Even-indexed diagonals give A010694.
Odd-indexed rows give the initial terms of A010685.
Even-indexed rows give the initial terms of A010693.
Odd-indexed antidiagonals give the initial terms of A010684.
Even-indexed antidiagonals give the initial terms of A010694.

Examples

			The corner of the square array begins:
1, 3, 1, 3, 1, 3, 1, 3, 1, 3, ...
2, 4, 2, 4, 2, 4, 2, 4, 2, ...
1, 3, 1, 3, 1, 3, 1, 3, ...
2, 4, 2, 4, 2, 4, 2, ...
1, 3, 1, 3, 1, 3, ...
2, 4, 2, 4, 2, ...
1, 3, 1, 3, ...
2, 4, 2, ...
1, 3, ...
2, ...
...
The sequence written as a triangle begins:
1;
2, 3;
1, 4, 1;
2, 3, 2, 3;
1, 4, 1, 4, 1;
2, 3, 2, 3, 2, 3;
1, 4, 1, 4, 1, 4, 1;
2, 3, 2, 3, 2, 3, 2, 3;
1, 4, 1, 4, 1, 4, 1, 4, 1;
2, 3, 2, 3, 2, 3, 2, 3, 2, 3;
...
		

Crossrefs

Programs

  • Mathematica
    Table[1 + Boole@ EvenQ@ # + 2 Boole@ EvenQ@ k &[n - k + 1], {n, 14}, {k, n}] // Flatten (* Michael De Vlieger, Nov 14 2016 *)

Formula

a(n) = A274912(n) + 1.

A176102 Decimal expansion of (3+2*sqrt(3))/2.

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, Apr 10 2010

Keywords

Comments

Continued fraction expansion of (3+2*sqrt(3))/2 is A010702.

Examples

			(3+2*sqrt(3))/2 = 3.23205080756887729352...
		

Crossrefs

Cf. A002194 (decimal expansion of sqrt(3)), A010702 (repeat 3, 4).

Programs

  • Mathematica
    RealDigits[(3+2*Sqrt[3])/2,10,120][[1]] (* Harvey P. Dale, Jun 24 2017 *)

Formula

Equals A002194+3/2.

A195084 a(2n-1) = 2-n, a(2n) = 2+n.

Original entry on oeis.org

2, 1, 3, 0, 4, -1, 5, -2, 6, -3, 7, -4, 8, -5, 9, -6, 10, -7, 11, -8, 12, -9, 13, -10, 14, -11, 15, -12, 16, -13, 17, -14, 18, -15, 19, -16, 20, -17, 21, -18, 22, -19, 23, -20, 24, -21, 25, -22, 26, -23, 27, -24, 28, -25, 29, -26, 30, -27, 31, -28, 32, -29, 33
Offset: 0

Views

Author

Dave Durgin, Sep 08 2011

Keywords

Comments

Start with a(0)=2, subtract 1, add 2, subtract 3, add 4, subtract 5 and so on.
A permutation of all integers. - Ruud H.G. van Tol, Sep 21 2024

Crossrefs

Formula

From Bruno Berselli, Sep 12 2011: (Start)
G.f.: (2*x^2+3*x+2)/((1-x)*(1+x)^2).
a(n) = a(-n-1) = -((2*n+1)*a(n-1)-7*n)/(2*n-1) = -a(n-1)+a(n-2)+a(n-3).
a(n) = ((2*n+1)*(-1)^n+7)/4.
a(n) = 2 - A001057(n).
a(n)-a(n-1) = A038608(n); a(n)+a(n-1) = A010702(n-1).
Sum(n=1..n, a(i)) = ((n+1)*(-1)^n+7*n-1)/4, i.e. A016777 and A008586 (>0) alternately. (End)
a(n+2) = a(n) + (-1)^n. - Vincenzo Librandi, Sep 12 2011
E.g.f.: ((4 - x)*cosh(x) + (3 + x)*sinh(x))/2. - Stefano Spezia, Sep 22 2024

Extensions

Definition corrected by Omar E. Pol, Sep 11 2011
a(0)=2 prepended by Ruud H.G. van Tol, Sep 21 2024

A271937 a(n) = (7/4)*n^2 + (5/2)*n + (7 + (-1)^n)/8.

Original entry on oeis.org

1, 5, 13, 24, 39, 57, 79, 104, 133, 165, 201, 240, 283, 329, 379, 432, 489, 549, 613, 680, 751, 825, 903, 984, 1069, 1157, 1249, 1344, 1443, 1545, 1651, 1760, 1873, 1989, 2109, 2232, 2359, 2489, 2623, 2760, 2901, 3045, 3193, 3344, 3499, 3657, 3819, 3984, 4153
Offset: 0

Views

Author

Vincenzo Librandi, Apr 20 2016

Keywords

Comments

Let P be a polygon with vertices (0,0), (0,2), (1,1) and (0,3/2). The number of integer points in nP is counted by this quasi-polynomial (nP is the n-fold dilation of P). See Wikipedia in Links section.
From Bob Selcoe, Sep 10 2016: (Start)
a(n) = the number of partitions in reverse lexicographic order starting with n 3's followed by n 2's; i.e., the number of partitions summing to 5n such that no part > 3 and the number of 3's digits <= the number of 2's digits.
First differences are A047346(n+1); second differences are 4 when n is even and 3 when n is odd (i.e., A010702(n+1)); third differences are 1 when n is even and -1 when n is odd. (End)

Examples

			a(1) = 5; the 5 partitions are: {3,2}; {3,1,1}; {2,2,1}; {2,1,1,1}; {1,1,1,1,1}.
a(3) = 24: floor(8/2) + floor(11/2) + floor(14/2) + floor(17/2) = 4+5+7+8 = 24.
		

Crossrefs

First bisection (after 1) is A168235.
Second bisection is A135703 (without 0).

Programs

  • Magma
    [(7/4)*n^2+(5/2)*n+(7+(-1)^n)/8: n in [0..50]];
    
  • Mathematica
    Table[(7/4) n^2 + (5/2) n + (7 + (-1)^n)/8, {n, 0, 50}]
    LinearRecurrence[{2,0,-2,1},{1,5,13,24},50] (* Harvey P. Dale, Mar 23 2025 *)
  • PARI
    Vec((1+3*x+3*x^2)/((1-x)^3*(1+x)) + O(x^99)) \\ Altug Alkan, Sep 10 2016

Formula

O.g.f.: (1 + 3*x + 3*x^2)/((1 - x)^3*(1 + x)).
E.g.f.: (7 + 34*x + 14*x^2)*exp(x)/8 + exp(-x)/8.
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4).
a(2*k) = k*(7*k + 5) + 1, a(2*k+1) = (k + 1)*(7*k + 5).
From Bob Selcoe, Sep 10 2016 (Start):
a(n) = (n+1)^2 + A006578(n).
a(n) = a(n-1) + A047346(n+1).
a(n) = Sum_{j=0..n} floor((2n+3j+2)/2).
(End)

Extensions

Edited and extended by Bruno Berselli, Apr 20 2016

A176214 Decimal expansion of (6+4*sqrt(3))/3.

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, Apr 12 2010

Keywords

Comments

Continued fraction expansion of (6+4*sqrt(3))/3 is A010702.

Examples

			(6+4*sqrt(3))/3 = 4.30940107675850305803...
		

Crossrefs

Cf. A002194 (decimal expansion of sqrt(3)), A010702 (repeat 4, 3).
Showing 1-10 of 11 results. Next