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.

Previous Showing 11-20 of 27 results. Next

A130667 a(1) = 1; a(n) = max{ 5*a(k) + a(n-k) | 1 <= k <= n/2 } for n > 1.

Original entry on oeis.org

1, 6, 11, 36, 41, 66, 91, 216, 221, 246, 271, 396, 421, 546, 671, 1296, 1301, 1326, 1351, 1476, 1501, 1626, 1751, 2376, 2401, 2526, 2651, 3276, 3401, 4026, 4651, 7776, 7781, 7806, 7831, 7956, 7981, 8106, 8231, 8856, 8881, 9006, 9131, 9756, 9881, 10506, 11131
Offset: 1

Views

Author

N. J. A. Sloane, based on a message from Don Knuth, Jun 23 2007

Keywords

Comments

From Gary W. Adamson, Aug 27 2016: (Start)
The formula of Mar 26 2010 is equivalent to the following: Given the production matrix M below, lim_{k->infinity} M^k as a left-shifted vector generates the sequence.
1, 0, 0, 0, 0, ...
6, 0, 0, 0, 0, ...
5, 1, 0, 0, 0, ...
0, 6, 0, 0, 0, ...
0, 5, 1, 0, 0, ...
0, 0, 6, 0, 0, ...
0, 0, 5, 1, 0, ...
...
The sequence divided by its aerated variant is (1, 6, 5, 0, 0, 0, ...). (End)

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a130667 n = a130667_list !! (n-1)
    a130667_list = 1 : (concat $ transpose
       [zipWith (+) vs a130667_list, zipWith (+) vs $ tail a130667_list])
       where vs = map (* 5) a130667_list
    -- Reinhard Zumkeller, Apr 18 2012
    
  • Magma
    [&+[5^(2*k - Valuation(Factorial(2*k), 2)): k in [0..n]]: n in [0..50]]; // Vincenzo Librandi, Mar 15 2019
  • Maple
    a:= proc(n) option remember;
          `if`(n=1, 1, `if`(irem(n, 2, 'm')=0, 6*a(m), 5*a(m)+a(n-m)))
        end:
    seq(a(n), n=1..70); # Alois P. Heinz, Apr 09 2012
  • Mathematica
    a[1]=1; a[n_] := a[n] = If[EvenQ[n], 6a[n/2], 5a[(n-1)/2]+a[(n+1)/2]]; Array[a, 50] (* Jean-François Alcover, Feb 13 2015 *)
  • PARI
    first(n)=my(v=vector(n),r,t); v[1]=1; for(i=2,n, r=0; for(k=1,i\2, t=5*v[k]+v[i-k]; if(t>r, r=t)); v[i]=r); v \\ Charles R Greathouse IV, Aug 29 2016
    

Formula

a(2*n) = 6*a(n) and a(2*n+1) = 5*a(n) + a(n+1).
Let r(x) = (1 + 6*x + 5*x^2). Then (1 + 6*x + 11*x^2 + 36*x^3 + ...) = r(x) * r(x^2) * r(x^4) * r(x^8) * ... - Gary W. Adamson, Mar 26 2010
a(n) = Sum_{k=0..n} 5^wt(k), where wt = A000120. - Mike Warburton, Mar 14 2019
a(n) = Sum_{k=0..floor(log_2(n))} 5^k*A360189(n-1,k). - Alois P. Heinz, Mar 06 2023

A073121 a(n) = r*a(ceiling(n/2)) + s*a(floor(n/2)) with a(1)=1 and (r,s)=(2,2).

Original entry on oeis.org

1, 4, 10, 16, 28, 40, 52, 64, 88, 112, 136, 160, 184, 208, 232, 256, 304, 352, 400, 448, 496, 544, 592, 640, 688, 736, 784, 832, 880, 928, 976, 1024, 1120, 1216, 1312, 1408, 1504, 1600, 1696, 1792, 1888, 1984, 2080, 2176, 2272, 2368, 2464, 2560, 2656, 2752
Offset: 1

Views

Author

Jeffrey Shallit, Aug 25 2002

Keywords

Comments

A recurrence occurring in the analysis of a regular expression algorithm.

Examples

			a(1)=1, a(2) = 2*(a(1)+a(1)) = 4, a(3) = 2*(a(2)+a(1)) = 10.
		

References

  • K. Ellul, J. Shallit and M.-w. Wang, Regular expressions: new results and open problems, in Descriptional Complexity of Formal Systems (DCFS), Proceedings of workshop, London, Ontario, Canada, 21-24 August 2002, pp. 17-34.

Crossrefs

Sequences of form a(n) = r*a(ceiling(n/2)) + s*a(floor(n/2)), a(1)=1, for (r,s) = (1,1), (1,2), (2,1), (1,3), (2,2), (3,1), (1,4), (2,3), (3,2), (4,1): A000027, A006046, A064194, A130665, A073121, A268524, A116520, A268525, A268526, A268527.

Programs

  • Haskell
    a073121 n = a053644 n * (fromIntegral n + 2 * a053645 n)
    -- Reinhard Zumkeller, Mar 23 2012
    
  • Maple
    a:= proc(n) option remember; `if`(n=1, 1,
          2*((m-> a(m)+a(n-m))(iquo(n, 2))))
        end:
    seq(a(n), n=1..70);  # Alois P. Heinz, Feb 01 2015
  • Mathematica
    a[n_] := a[n] = If[n == 1, 1, 2*(a[Quotient[n, 2]] + a[n - Quotient[n, 2]])]; Table[a[n], {n, 1, 70}] (* Jean-François Alcover, Feb 24 2016, after Alois P. Heinz *)
    a[ n_] := If[ n < 1, 0, Module[{m = 1, A = 1}, While[m < n, m *= 2; A = (Normal[A] /. x -> x^2) 2 (1 + x)^2 - 1 + O[x]^m]; Coefficient[A, x, n - 1]]]; (* Michael Somos, Jul 04 2017 *)
  • PARI
    {a(n) = n--; if( n<0, 0, my(m=1, A = 1 + O(x)); while(m<=n, m*=2; A = subst(A, x, x^2) * 2 * (1 + x)^2 - 1); polcoeff(A, n))}; /* Michael Somos, Jul 04 2017 */

Formula

a(n) = 2*(a(floor(n/2)) + a(ceiling(n/2))) for n >= 2; alternatively, a(n) = 2^c(n+2b) where n = 2^c + b, 0 <= b < 2^c.
a(n) == 1 (mod 3), a(n+1)-a(n) = 3*A053644(n). If k >= 1: a(2^k)=4^k, a(3*2^k)=(10/9)*4^k. More generally a(m*2^k) = a(m)*4^k. Hence for any n, n^2 <= a(n) <= C*n^2 where C is a constant 1.125 < C < 1.14 and it seems that C = lim_{k->infinity} a(A001045(k))/A001045(k)^2 where A001045(k) =(2^n - (-1)^n)/3 is the Jacobsthal sequence. In other words, in the range 2^k <= n <= 2^(k+1) the maximum of a(n)/n^2 is reached for the only possible n in the Jacobsthal sequence. - Benoit Cloitre, Aug 26 2002
For any n, n^2 <= a(n) <= 9/8 * n^2. - Arnoud van der Leer, Sep 01 2019
a(n) = 2*(a(floor(n/2)) + a(ceiling(n/2))) for n >= 2; alternatively, a(n) = 2^c(n+2b) where n = 2^c + b, 0 <= b < 2^c
G.f.: 3*x/(1-x)^2 * ((2*x+1)/3 + Sum_{k>=1} 2^(k-1)*x^2^k). - Ralf Stephan, Apr 18 2003
G.f.: A(x) = 2 * (1/x + 2 + x) * A(x^2) - x. - Michael Somos, Jul 04 2017

Extensions

Edited by N. J. A. Sloane, Feb 16 2016

A161342 Number of "ON" cubic cells at n-th stage in simple 3-dimensional cellular automaton: a(n) = A160428(n)/8.

Original entry on oeis.org

0, 1, 8, 15, 64, 71, 120, 169, 512, 519, 568, 617, 960, 1009, 1352, 1695, 4096, 4103, 4152, 4201, 4544, 4593, 4936, 5279, 7680, 7729, 8072, 8415, 10816, 11159, 13560, 15961, 32768, 32775, 32824, 32873, 33216, 33265, 33608, 33951, 36352, 36401, 36744, 37087, 39488
Offset: 0

Views

Author

Omar E. Pol, Jun 14 2009

Keywords

Comments

First differences are in A161343. - Omar E. Pol, May 03 2015
From Gary W. Adamson, Aug 30 2016: (Start)
Let M =
1, 0, 0, 0, 0, ...
8, 0, 0, 0, 0, ...
7, 1, 0, 0, 0, ...
0, 8, 0, 0, 0, ...
0, 7, 1, 0, 0, ...
0, 0, 8, 0, 0, ...
0, 0, 7, 1, 0, ...
...
Then M^k converges to a single nonzero column giving the sequence.
The sequence with offset 1 divided by its aerated variant is (1, 8, 7, 0, 0, 0, ...). (End)

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<0, 0,
          b(n-1)+x^add(i, i=Bits[Split](n)))
        end:
    a:= n-> subs(x=7, b(n-1)):
    seq(a(n), n=0..44);  # Alois P. Heinz, Mar 06 2023
  • Mathematica
    A161342list[nmax_]:=Join[{0},Accumulate[7^DigitCount[Range[0,nmax-1],2,1]]];A161342list[100] (* Paolo Xausa, Aug 05 2023 *)

Formula

From Nathaniel Johnston, Nov 13 2010: (Start)
a(n) = Sum_{k=0..n-1} 7^A000120(k).
a(n) = 1 + 7 * Sum_{k=1..n-1} A151785(k), for n >= 1.
a(2^n) = 2^(3n).
(End)
a(n) = Sum_{k=0..floor(log_2(n))} 7^k*A360189(n-1,k). - Alois P. Heinz, Mar 06 2023

Extensions

More terms from Nathaniel Johnston, Nov 13 2010

A268524 a(n) = r*a(ceiling(n/2))+s*a(floor(n/2)) with a(1)=1 and (r,s)=(3,1).

Original entry on oeis.org

1, 4, 13, 16, 43, 52, 61, 64, 145, 172, 199, 208, 235, 244, 253, 256, 499, 580, 661, 688, 769, 796, 823, 832, 913, 940, 967, 976, 1003, 1012, 1021, 1024, 1753, 1996, 2239, 2320, 2563, 2644, 2725, 2752, 2995, 3076, 3157, 3184, 3265, 3292, 3319, 3328, 3571, 3652, 3733, 3760, 3841, 3868, 3895
Offset: 1

Views

Author

N. J. A. Sloane, Feb 16 2016

Keywords

Comments

Number of triples 0 <= i, j, k < n such that bitwise AND of all pairs (i, j), (j, k), (k, i) is 0. - Peter Karpov, Mar 01 2016
Start with A = [[[1]]], iteratively replace every element Aijk with Aijk * [[[1, 1], [1, 0]], [[1, 0], [0, 0]]]. a(n) is the sum of the resulting array inside the cubic region i, j, k < n. - Peter Karpov, Mar 01 2016

Crossrefs

Sequences of form a(n) = r*a(ceiling(n/2))+s*a(floor(n/2)) with a(1)=1 and (r,s) = (1,1), (1,2), (2,1), (1,3), (2,2), (3,1), (1,4), (2,3), (3,2), (4,1): A000027, A006046, A064194, A130665, A073121, A268524, A116520, A268525, A268526, A268527.

Programs

  • PARI
    a(n) = if (n==1, 1, 3*a(ceil(n/2)) + a(floor(n/2))); \\ Michel Marcus, Mar 24 2016

A160412 Number of "ON" cells at n-th stage in simple 2-dimensional cellular automaton (see Comments for precise definition).

Original entry on oeis.org

0, 3, 12, 21, 48, 57, 84, 111, 192, 201, 228, 255, 336, 363, 444, 525, 768, 777, 804, 831, 912, 939, 1020, 1101, 1344, 1371, 1452, 1533, 1776, 1857, 2100, 2343, 3072, 3081, 3108, 3135, 3216, 3243, 3324, 3405, 3648, 3675, 3756, 3837, 4080, 4161, 4404, 4647
Offset: 0

Views

Author

Omar E. Pol, May 20 2009, Jun 01 2009

Keywords

Comments

From Omar E. Pol, Nov 10 2009: (Start)
On the infinite square grid, consider the outside corner of an infinite square.
We start at round 0 with all cells in the OFF state.
The rule: A cell in turned ON iff exactly one of its four vertices is a corner vertex of the set of ON cells. So in each generation every exposed vertex turns on three new cells.
At round 1, we turn ON three cells around the corner of the infinite square, forming a concave-convex hexagon with three exposed vertices.
At round 2, we turn ON nine cells around the hexagon.
At round 3, we turn ON nine other cells. Three cells around of every corner of the hexagon.
And so on.
Shows a fractal-like behavior similar to the toothpick sequence A153006.
For the first differences see the entry A162349.
For more information see A160410, which is the main entry for this sequence.
(End)

Examples

			If we label the generations of cells turned ON by consecutive numbers we get the cell pattern shown below:
...77..77..77..77
...766667..766667
....6556....6556.
....654444444456.
...76643344334667
...77.43222234.77
......44211244...
00000000001244...
00000000002234.77
00000000004334667
0000000000444456.
0000000000..6556.
0000000000.766667
0000000000.77..77
0000000000.......
0000000000.......
0000000000.......
		

Crossrefs

Programs

  • Mathematica
    a[n_] := 3*Sum[3^DigitCount[k, 2, 1], {k, 0, n - 1}]; Array[a, 48, 0] (* Michael De Vlieger, Nov 01 2022 *)

Formula

From Omar E. Pol, Nov 10 2009: (Start)
a(n) = A160410(n)*3/4.
a(0) = 0, a(n) = A130665(n-1)*3, for n>0.
(End)

Extensions

More terms from Omar E. Pol, Nov 10 2009
Edited by Omar E. Pol, Nov 11 2009
More terms from Nathaniel Johnston, Nov 06 2010
More terms from Colin Barker, Apr 19 2015

A268525 a(n) = r*a(ceiling(n/2))+s*a(floor(n/2)) with a(1)=1 and (r,s)=(2,3).

Original entry on oeis.org

1, 5, 13, 25, 41, 65, 89, 125, 157, 205, 253, 325, 373, 445, 517, 625, 689, 785, 881, 1025, 1121, 1265, 1409, 1625, 1721, 1865, 2009, 2225, 2369, 2585, 2801, 3125, 3253, 3445, 3637, 3925, 4117, 4405, 4693, 5125, 5317, 5605, 5893, 6325, 6613, 7045, 7477, 8125, 8317, 8605, 8893, 9325, 9613, 10045
Offset: 1

Views

Author

N. J. A. Sloane, Feb 16 2016

Keywords

Crossrefs

Sequences of form a(n) = r*a(ceiling(n/2))+s*a(floor(n/2)) with a(1)=1 and (r,s) = (1,1), (1,2), (2,1), (1,3), (2,2), (3,1), (1,4), (2,3), (3,2), (4,1): A000027, A006046, A064194, A130665, A073121, A268524, A116520, A268525, A268526, A268527.

Programs

  • Magma
    [n le 1 select 1 else 2*Self(Ceiling(n/2))+3*Self(Floor(n/2)): n in [1..60]]; // Vincenzo Librandi, Aug 30 2016
  • PARI
    a(n) = if (n==1, 1, 2*a(ceil(n/2))+3*a(floor(n/2))); \\ Michel Marcus, Aug 30 2016
    

A268526 a(n) = r*a(ceiling(n/2))+s*a(floor(n/2)) with a(1)=1 and (r,s)=(3,2).

Original entry on oeis.org

1, 5, 17, 25, 61, 85, 109, 125, 233, 305, 377, 425, 497, 545, 593, 625, 949, 1165, 1381, 1525, 1741, 1885, 2029, 2125, 2341, 2485, 2629, 2725, 2869, 2965, 3061, 3125, 4097, 4745, 5393, 5825, 6473, 6905, 7337, 7625, 8273, 8705, 9137, 9425, 9857, 10145, 10433, 10625, 11273, 11705, 12137, 12425
Offset: 1

Views

Author

N. J. A. Sloane, Feb 16 2016

Keywords

Crossrefs

Sequences of form a(n) = r*a(ceiling(n/2))+s*a(floor(n/2)) with a(1)=1 and (r,s) = (1,1), (1,2), (2,1), (1,3), (2,2), (3,1), (1,4), (2,3), (3,2), (4,1): A000027, A006046, A064194, A130665, A073121, A268524, A116520, A268525, A268526, A268527.

Programs

  • Magma
    [n le 1 select 1 else 3*Self(Ceiling(n/2))+2*Self(Floor(n/2)): n in [1..60]]; // Vincenzo Librandi, Aug 30 2016
  • PARI
    a(n) = if (n==1, 1, 3*a(ceil(n/2))+2*a(floor(n/2))); \\ Michel Marcus, Aug 30 2016
    

A268527 a(n) = r*a(ceiling(n/2))+s*a(floor(n/2)) with a(1)=1 and (r,s)=(4,1).

Original entry on oeis.org

1, 5, 21, 25, 89, 105, 121, 125, 381, 445, 509, 525, 589, 605, 621, 625, 1649, 1905, 2161, 2225, 2481, 2545, 2609, 2625, 2881, 2945, 3009, 3025, 3089, 3105, 3121, 3125, 7221, 8245, 9269, 9525, 10549, 10805, 11061, 11125, 12149, 12405, 12661, 12725, 12981, 13045, 13109, 13125, 14149, 14405
Offset: 1

Views

Author

N. J. A. Sloane, Feb 16 2016

Keywords

Crossrefs

Sequences of form a(n) = r*a(ceiling(n/2))+s*a(floor(n/2)) with a(1)=1 and (r,s) = (1,1), (1,2), (2,1), (1,3), (2,2), (3,1), (1,4), (2,3), (3,2), (4,1): A000027, A006046, A064194, A130665, A073121, A268524, A116520, A268525, A268526, A268527.

Programs

  • PARI
    a(n) = if (n==1, 1, 4*a(ceil(n/2))+a(floor(n/2))); \\ Michel Marcus, Aug 30 2016

A116522 a(0)=1, a(1)=1, a(n)=7*a(n/2) for n=2,4,6,..., a(n)=6*a((n-1)/2)+a((n+1)/2) for n=3,5,7,....

Original entry on oeis.org

0, 1, 7, 13, 49, 55, 91, 127, 343, 349, 385, 421, 637, 673, 889, 1105, 2401, 2407, 2443, 2479, 2695, 2731, 2947, 3163, 4459, 4495, 4711, 4927, 6223, 6439, 7735, 9031, 16807, 16813, 16849, 16885, 17101, 17137, 17353, 17569, 18865, 18901, 19117, 19333
Offset: 0

Views

Author

Roger L. Bagula, Mar 15 2006

Keywords

Comments

A 7-divide version of A084230.
The Harborth: f(2^k) = 3^k suggests that a family of sequences of the form: f(2^k) = prime(n)^k.
From Gary W. Adamson, Aug 27 2016: (Start)
Let M = the production matrix below. Then lim_{k->infinity} M^k generates the sequence with offset 1 by extracting the left-shifted vector.
1, 0, 0, 0, 0, ...
7, 0, 0, 0, 0, ...
6, 1, 0, 0, 0, ...
0, 7, 0, 0, 0, ...
0, 6, 1, 0, 0, ...
0, 0, 7, 0, 0, ...
0, 0, 6, 1, 0, ...
...
The sequence divided by its aerated variant is (1, 7, 6, 0, 0, 0, ...). (End)

Crossrefs

Programs

  • Maple
    a:=proc(n) if n=0 then 0 elif n=1 then 1 elif n mod 2 = 0 then 7*a(n/2) else 6*a((n-1)/2)+a((n+1)/2) fi end: seq(a(n),n=0..47);
    # second Maple program:
    b:= proc(n) option remember; `if`(n<0, 0,
          b(n-1)+x^add(i, i=Bits[Split](n)))
        end:
    a:= n-> subs(x=6, b(n-1)):
    seq(a(n), n=0..44);  # Alois P. Heinz, Mar 06 2023
  • Mathematica
    b[0] := 0; b[1] := 1; b[n_?EvenQ] := b[n] = 7*b[n/2]; b[n_?OddQ] := b[n] = 6*b[(n - 1)/2] + b[(n + 1)/2]; a = Table[b[n], {n, 1, 25}]

Formula

G.f.: (r(x) * r(x^2) * r(x^4) * r(x^8) * ...), where r(x) = (1 + 7x + 6x^2).
a(n) = Sum_{k=0..n-1} 6^wt(k), where wt = A000120. - Mike Warburton, Mar 14 2019
a(n) = Sum_{k=0..floor(log_2(n))} 6^k*A360189(n-1,k). - Alois P. Heinz, Mar 06 2023

Extensions

Edited by N. J. A. Sloane, Apr 16 2005

A173068 a(n) = A160120(n) - A160715(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 30, 30, 30, 30, 30, 30, 30, 30, 42, 42, 42, 42, 42, 42, 42, 42, 120
Offset: 0

Views

Author

Omar E. Pol, May 29 2010

Keywords

Crossrefs

Extensions

a(14)-a(33) from Robert Price, Jun 17 2019
Previous Showing 11-20 of 27 results. Next