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-8 of 8 results.

A252696 Number of strings of length n over a 3-letter alphabet that do not begin with a nontrivial palindrome.

Original entry on oeis.org

0, 3, 6, 12, 30, 78, 222, 636, 1878, 5556, 16590, 49548, 148422, 444630, 1333254, 3997884, 11991774, 35969766, 107903742, 323694636, 971067318, 2913152406, 8739407670, 26218074588, 78654075342, 235961781396, 707884899558, 2123653365420, 6370958763006
Offset: 0

Views

Author

Peter Kagey, Dec 20 2014

Keywords

Comments

A nontrivial palindrome is of length at least 2.
3 divides a(n) for all n.
lim n -> infinity a(n)/3^n ~ 0.278489919882115 is the probability that a random, infinite string over a 3-letter alphabet does not begin with a palindrome.
This sequence gives the number of walks on K_3 with loops that do not begin with a palindromic sequence.

Examples

			For n = 3, the first 10 of the a(3) = 12 solutions are (in lexicographic order) 011, 012, 021, 022, 100, 102, 120, 122, 200, 201.
		

Crossrefs

A248122 gives the number of strings of length n over a 3 letter alphabet that DO begin with a palindrome.
Analogous sequences for k-letter alphabets: A252697 (k=4), A252698 (k=5), A252699 (k=6), A252700 (k=7), A252701 (k=8), A252702 (k=9), A252703 (k=10).

Programs

  • Mathematica
    b[0] = 0; b[1] = 0; b[n_] := b[n] = 3*b[n-1] + 3^Ceiling[n/2] - b[Ceiling[n/2]]; a[n_] := 3^n - b[n]; a[0] = 0; Table[a[n], {n, 0, 28}] (* Jean-François Alcover, Jan 19 2015 *)
  • Ruby
    seq = [1, 0]; (2..N).each { |i| seq << 3 * seq[i-1] + 3**((i+1)/2) - seq[(i+1)/2] }; seq = seq.each_with_index.collect { |a, i| 3**i - a }

Formula

a(n) = 3^n - A248122(n) for n > 0.
a(2n) = k*a(2n-1) - a(n) for n >= 1; a(2n+1) = k*a(2n) - a(n+1) for n >= 1. - Jeffrey Shallit, Jun 09 2019

A252697 Number of strings of length n over a 4-letter alphabet that do not begin with a palindrome.

Original entry on oeis.org

0, 4, 12, 36, 132, 492, 1932, 7596, 30252, 120516, 481572, 1924356, 7695492, 30774372, 123089892, 492329316, 1969287012, 7877027532, 31507989612, 126031476876, 504125425932, 2016499779372, 8065997193132, 32263981077036, 129055916612652, 516223635676236
Offset: 0

Views

Author

Peter Kagey, Dec 20 2014

Keywords

Comments

4 divides a(n) for all n.
lim n -> infinity a(n)/4^n ~ 0.458498674725575 is the probability that a random, infinite string over a 4-letter alphabet does not begin with a palindrome.
This sequence gives the number of walks on K_4 with loops that do not begin with a palindromic sequence.

Examples

			For n = 3, the first 10 of the a(3) = 36 solutions are (in lexicographic order) 011, 012, 013, 021, 022, 023, 031, 032, 033, 100.
		

Crossrefs

A249629 gives the number of strings of length n over a 4-letter alphabet that DO begin with a palindrome.
Analogous sequences for k-letter alphabets: A252696 (k=3), A252698 (k=5), A252699 (k=6), A252700 (k=7), A252701 (k=8), A252702 (k=9), A252703 (k=10).

Programs

  • Ruby
    seq = [1, 0]; (2..N).each { |i| seq << 4 * seq[i-1] + 4**((i+1)/2) - seq[(i+1)/2] }; seq = seq.each_with_index.collect { |a, i| 4**i - a }

Formula

a(n) = 4^n - A249629(n) for n > 0.

A252699 Number of strings of length n over a 6-letter alphabet that do not begin with a palindrome.

Original entry on oeis.org

0, 6, 30, 150, 870, 5070, 30270, 180750, 1083630, 6496710, 38975190, 233820870, 1402894950, 8417188950, 50502952950, 303016634070, 1818098720790, 10908585828030, 65451508471470, 392709011853630, 2356254032146590, 14137523959058670, 84825143520531150
Offset: 0

Views

Author

Peter Kagey, Dec 20 2014

Keywords

Comments

6 divides a(n) for all n.
lim n -> infinity a(n)/6^n ~ 0.644461670963043 is the probability that a random, infinite string over a 6-letter alphabet does not begin with a palindrome.
This sequence gives the number of walks on K_6 with loops that do not begin with a palindromic sequence.

Examples

			For n = 3, the first 10 of the a(3) = 150 solutions are (in lexicographic order) 011, 012, 013, 014, 015, 021, 022, 023, 024, 025.
		

Crossrefs

A249639 gives the number of strings of length n over a 6-letter alphabet that DO begin with a palindrome.
Analogous sequences for k-letter alphabets: A252696 (k=3), A252697 (k=4), A252698 (k=5), A252700 (k=7), A252701 (k=8), A252702 (k=9), A252703 (k=10).

Programs

  • Mathematica
    a252699[n_] := Block[{f}, f[0] = f[1] = 0;
      f[x_] := 6*f[x - 1] + 6^Ceiling[(x)/2] - f[Ceiling[(x)/2]];
    Prepend[Rest@Table[6^i - f[i], {i, 0, n}], 0]]; a252699[22] (* Michael De Vlieger, Dec 26 2014 *)
  • Ruby
    seq = [1, 0]; (2..N).each { |i| seq << 6 * seq[i-1] + 6**((i+1)/2) - seq[(i+1)/2] }; seq = seq.each_with_index.collect { |a, i| 6**i - a }

Formula

a(n) = 6^n - A249639(n) for n > 0.

A252700 Number of strings of length n over a 7-letter alphabet that do not begin with a palindrome.

Original entry on oeis.org

0, 7, 42, 252, 1722, 11802, 82362, 574812, 4021962, 28141932, 196981722, 1378789692, 9651445482, 67559543562, 472916230122, 3310409588892, 23172863100282, 162210013560042, 1135470066778362, 7948290270466812, 55638031696285962, 389466220495212042
Offset: 0

Views

Author

Peter Kagey, Dec 20 2014

Keywords

Comments

7 divides a(n) for all n.
lim n -> infinity a(n)/7^n ~ 0.697286015491013 is the probability that a random, infinite string over a 7-letter alphabet does not begin with a palindrome.
This sequence gives the number of walks on K_7 with loops that do not begin with a palindromic sequence.

Examples

			For n = 3, the first 10 of the a(3) = 252 solutions are (in lexicographic order) 011, 012, 013, 014, 015, 016, 021, 022, 023, 024.
		

Crossrefs

A249640 gives the number of strings of length n over a 7-letter alphabet that DO begin with a palindrome.
Analogous sequences for k-letter alphabets: A252696 (k=3), A252697 (k=4), A252698 (k=5), A252699 (k=6), A252701 (k=8), A252702 (k=9), A252703 (k=10).

Programs

  • Mathematica
    a252700[n_] := Block[{f}, f[0] = f[1] = 0;
      f[x_] := 7*f[x - 1] + 7^Ceiling[(x)/2] - f[Ceiling[(x)/2]];
    Prepend[Rest@Table[7^i - f[i], {i, 0, n}], 0]]; a252700[21] (* Michael De Vlieger, Dec 26 2014 *)
  • Ruby
    seq = [1, 0]; (2..N).each { |i| seq << 7 * seq[i-1] + 7**((i+1)/2) - seq[(i+1)/2] }; seq = seq.each_with_index.collect { |a, i| 7**i - a }

Formula

a(n) = 7^n - A249640(n) for n > 0.

A252701 Number of strings of length n over an 8-letter alphabet that do not begin with a palindrome.

Original entry on oeis.org

0, 8, 56, 392, 3080, 24248, 193592, 1545656, 12362168, 98873096, 790960520, 6327490568, 50619730952, 404956301960, 3239648870024, 25917178598024, 207337416422024, 1658699232503096, 13269593761151672, 106156749298252856, 849253993595062328, 6794031942433008056
Offset: 0

Views

Author

Peter Kagey, Dec 20 2014

Keywords

Comments

8 divides a(n) for all n.
lim n -> infinity a(n)/8^n ~ 0.73661041899617 is the probability that a random, infinite string over an 8-letter alphabet does not begin with a palindrome.
This sequence gives the number of walks on K_8 with loops that do not begin with a palindromic sequence.

Examples

			For n = 3, the first 10 of the a(3) = 392 solutions are (in lexicographic order) 011, 012, 013, 014, 015, 016, 017, 021, 022, 023.
		

Crossrefs

A249641 gives the number of strings of length n over an 8-letter alphabet that DO begin with a palindrome.
Analogous sequences for k-letter alphabets: A252696 (k=3), A252697 (k=4), A252698 (k=5), A252699 (k=6), A252700 (k=7), A252702 (k=9), A252703 (k=10).

Programs

  • Mathematica
    a252701[n_] := Block[{f}, f[0] = f[1] = 0;
      f[x_] := 8*f[x - 1] + 8^Ceiling[(x)/2] - f[Ceiling[(x)/2]];
    Prepend[Rest@Table[8^i - f[i], {i, 0, n}], 0]]; a252701[21] (* Michael De Vlieger, Dec 26 2014 *)
  • Ruby
    seq = [1, 0]; (2..N).each { |i| seq << 8 * seq[i-1] + 8**((i+1)/2) - seq[(i+1)/2] }; seq = seq.each_with_index.collect { |a, i| 8**i - a }

Formula

a(n) = 8^n - A249641(n) for n > 0.

A252702 Number of strings of length n over a 9-letter alphabet that do not begin with a palindrome.

Original entry on oeis.org

0, 9, 72, 576, 5112, 45432, 408312, 3669696, 33022152, 297153936, 2674339992, 24068651616, 216617456232, 1949553436392, 17545977257832, 157913762298336, 1421223827662872, 12791014151811912, 115119127069153272, 1036072140948039456, 9324649265858015112
Offset: 0

Views

Author

Peter Kagey, Dec 20 2014

Keywords

Comments

9 divides a(n) for all n.
lim n -> infinity a(n)/9^n ~ 0.766976957370438 is the probability that a random, infinite string over a 9-letter alphabet does not begin with a palindrome.
This sequence gives the number of walks on K_9 with loops that do not begin with a palindromic sequence.

Examples

			For n = 3, the first 10 of the a(3) = 576 solutions are (in lexicographic order) 011, 012, 013, 014, 015, 016, 017, 018, 021, 022.
		

Crossrefs

A249642 gives the number of strings of length n over a 9-letter alphabet that DO begin with a palindrome.
Analogous sequences for k-letter alphabets: A252696 (k=3), A252697 (k=4), A252698 (k=5), A252699 (k=6), A252700 (k=7), A252701 (k=8), A252703 (k=10).

Programs

  • Ruby
    seq = [1, 0]; (2..N).each { |i| seq << 9 * seq[i-1] + 9**((i+1)/2) - seq[(i+1)/2] }; seq = seq.each_with_index.collect { |a, i| 9**i - a }

Formula

a(n) = 9^n - A249642(n) for n > 0.

A252703 Number of strings of length n over a 10-letter alphabet that do not begin with a palindrome.

Original entry on oeis.org

0, 10, 90, 810, 8010, 79290, 792090, 7912890, 79120890, 791129610, 7911216810, 79111376010, 791112968010, 7911121767210, 79111209759210, 791112018471210, 7911120105591210, 79111200264782490, 791112001856695290, 7911120010655736090, 79111200098646144090
Offset: 0

Views

Author

Peter Kagey, Dec 20 2014

Keywords

Comments

10 divides a(n) for all n.
lim n -> infinity a(n)/10^n ~ 0.79111200088977 is the probability that a random, infinite string over a 10-letter alphabet does not begin with a palindrome.
This sequence gives the number of walks on K_10 with loops that do not begin with a palindromic sequence.

Examples

			For n = 3, the first 20 of the a(3) = 810 solutions are (in lexicographic order) 011, 012, 013, 014, 015, 016, 017, 018, 019, 021, 022, 023, 024, 025, 026, 027, 028, 029, 031, 032.
		

Crossrefs

A249643 gives the number of strings of length n over a 10-letter alphabet that DO begin with a palindrome.
Analogous sequences for k-letter alphabets: A252696 (k=3), A252697 (k=4), A252698 (k=5), A252699 (k=6), A252700 (k=7), A252701 (k=8), A252702 (k=9).

Programs

  • Mathematica
    a252703[n_] := Block[{f},
      f[0] = f[1] = 0;
      f[x_] := 10*f[x - 1] + 10^Ceiling[(x)/2] - f[Ceiling[(x)/2]];
    Prepend[Rest@Table[10^i - f[i], {i, 0, n}],0]]; a252703[20] (* Michael De Vlieger, Dec 26 2014 *)
  • Ruby
    seq = [1, 0]; (2..N).each { |i| seq << 10 * seq[i-1] + 10**((i+1)/2) - seq[(i+1)/2] }; seq = seq.each_with_index.collect { |a, i| 10**i - a }

Formula

a(n) = 10^n - A249643(n) for n > 0.

A342238 Table read by upward antidiagonals: T(n,k) is the number of strings of length k over an n-letter alphabet that do not begin with a palindrome of two or more letters; n, k >= 1.

Original entry on oeis.org

1, 2, 0, 3, 2, 0, 4, 6, 2, 0, 5, 12, 12, 2, 0, 6, 20, 36, 30, 2, 0, 7, 30, 80, 132, 78, 2, 0, 8, 42, 150, 380, 492, 222, 2, 0, 9, 56, 252, 870, 1820, 1932, 636, 2, 0, 10, 72, 392, 1722, 5070, 9020, 7596, 1878, 2, 0, 11, 90, 576, 3080, 11802, 30270, 44720, 30252, 5556, 2, 0
Offset: 1

Views

Author

Peter Kagey, Mar 06 2021

Keywords

Examples

			Table begins:
n\k | 1  2   3    4     5      6       7        8
----+--------------------------------------------
  1 | 1  0   0    0     0      0       0        0
  2 | 2  2   2    2     2      2       2        2
  3 | 3  6  12   30    78    222     636     1878
  4 | 4 12  36  132   492   1932    7596    30252
  5 | 5 20  80  380  1820   9020   44720   223220
  6 | 6 30 150  870  5070  30270  180750  1083630
  7 | 7 42 252 1722 11802  82362  574812  4021962
  8 | 8 56 392 3080 24248 193592 1545656 12362168
		

Crossrefs

Rows: A252696 (n=3), A252697 (n=4), A252698 (n=5), A252699 (n=6), A252700 (n=7), A252701 (n=8), A252702 (n=9), A252703 (n=10).
Columns: A002378 (k=2), A011379 (k=3).

Formula

T(n,k) = n^k - A342237(n,k).
Showing 1-8 of 8 results.