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 21-30 of 44 results. Next

A207938 T(n,k)=Number of nXk 0..1 arrays avoiding 0 0 1 and 1 0 0 horizontally and 0 0 1 and 1 1 0 vertically.

Original entry on oeis.org

2, 4, 4, 6, 16, 6, 9, 36, 36, 8, 14, 81, 98, 64, 10, 22, 196, 271, 200, 100, 12, 35, 484, 844, 643, 350, 144, 14, 56, 1225, 2706, 2422, 1271, 556, 196, 16, 90, 3136, 8977, 9430, 5594, 2239, 826, 256, 18, 145, 8100, 30168, 38207, 25490, 11256, 3641, 1168, 324, 20, 234
Offset: 1

Views

Author

R. H. Hardin Feb 21 2012

Keywords

Comments

Table starts
..2...4....6....9....14.....22......35.......56.......90.......145........234
..4..16...36...81...196....484....1225.....3136.....8100.....21025......54756
..6..36...98..271...844...2706....8977....30168...102384....349069....1193648
..8..64..200..643..2422...9430...38207...156792...649758...2703377...11276024
.10.100..350.1271..5594..25490..121313...584386..2841676..13864995...67793828
.12.144..556.2239.11256..58602..319439..1760946..9794226..54631117..305277128
.14.196..826.3641.20568.120276..737575..4570122.28555126.178852957.1121957980
.16.256.1168.5581.34986.226850.1544037.10609482.73474400.509887759.3543126698

Examples

			Some solutions for n=4 k=3
..0..1..0....1..1..0....0..0..0....1..1..0....1..1..1....0..1..1....0..0..0
..1..1..1....1..1..0....0..0..0....0..0..0....1..0..1....1..1..0....0..1..1
..0..1..1....1..1..0....0..0..0....0..1..0....1..1..1....1..1..1....0..1..0
..0..1..1....1..1..0....0..0..0....0..1..0....1..1..1....1..1..1....0..1..1
		

Crossrefs

Column 1 is A004275(n+1)
Column 2 is A016742
Column 3 is A207106
Column 4 is A207107
Row 1 is A001611(n+2)
Row 2 is A207436

A208142 T(n,k)=Number of nXk 0..1 arrays avoiding 0 0 1 and 0 1 1 horizontally and 0 0 1 and 1 0 1 vertically.

Original entry on oeis.org

2, 4, 4, 6, 16, 6, 9, 36, 36, 8, 12, 81, 108, 64, 10, 16, 144, 324, 240, 100, 12, 20, 256, 720, 900, 450, 144, 14, 25, 400, 1600, 2400, 2025, 756, 196, 16, 30, 625, 3000, 6400, 6300, 3969, 1176, 256, 18, 36, 900, 5625, 14000, 19600, 14112, 7056, 1728, 324, 20, 42, 1296
Offset: 1

Views

Author

R. H. Hardin Feb 23 2012

Keywords

Comments

Table starts
..2...4....6.....9....12.....16.....20......25......30.......36.......42
..4..16...36....81...144....256....400.....625.....900.....1296.....1764
..6..36..108...324...720...1600...3000....5625....9450....15876....24696
..8..64..240...900..2400...6400..14000...30625...58800...112896...197568
.10.100..450..2025..6300..19600..49000..122500..264600...571536..1111320
.12.144..756..3969.14112..50176.141120..396900..952560..2286144..4889808
.14.196.1176..7056.28224.112896.352800.1102500.2910600..7683984.17929296
.16.256.1728.11664.51840.230400.792000.2722500.7840800.22581504.57081024

Examples

			Some solutions for n=4 k=3
..1..0..0....0..0..0....0..1..0....1..1..1....0..1..0....0..1..0....0..1..0
..0..0..0....1..0..0....1..1..0....1..1..0....1..0..0....0..1..0....1..0..1
..0..0..0....0..0..0....1..1..0....1..0..0....1..0..0....0..1..0....0..0..0
..0..0..0....0..0..0....1..0..0....1..0..0....1..0..0....0..1..0....0..0..0
		

Crossrefs

Column 1 is A004275(n+1)
Column 2 is A016742
Column 3 is A202195(n-2)
Row 1 is A002620(n+2)
Row 2 is A030179(n+2)
Row 3 is A202093(n-2)

Formula

Empirical for column k:
k=1: a(n) = 2*n
k=2: a(n) = 4*n^2
k=3: a(n) = 3*n^3 + 3*n^2
k=4: a(n) = (9/4)*n^4 + (9/2)*n^3 + (9/4)*n^2
k=5: a(n) = n^5 + 4*n^4 + 5*n^3 + 2*n^2
k=6: a(n) = (4/9)*n^6 + (8/3)*n^5 + (52/9)*n^4 + (16/3)*n^3 + (16/9)*n^2
k=7: a(n) = (5/36)*n^7 + (5/4)*n^6 + (155/36)*n^5 + (85/12)*n^4 + (50/9)*n^3 + (5/3)*n^2

A208379 T(n,k)=Number of nXk 0..1 arrays avoiding 0 0 0 and 1 1 1 horizontally and 0 0 1 and 1 0 1 vertically.

Original entry on oeis.org

2, 4, 4, 6, 16, 6, 10, 36, 36, 8, 16, 100, 72, 64, 10, 26, 256, 240, 108, 100, 12, 42, 676, 704, 420, 144, 144, 14, 68, 1764, 2080, 1344, 640, 180, 196, 16, 110, 4624, 6216, 4212, 2176, 900, 216, 256, 18, 178, 12100, 18496, 13860, 7072, 3200, 1200, 252, 324, 20, 288
Offset: 1

Views

Author

R. H. Hardin Feb 25 2012

Keywords

Comments

Table starts
..2...4...6...10...16....26....42.....68.....110.....178......288......466
..4..16..36..100..256...676..1764...4624...12100...31684....82944...217156
..6..36..72..240..704..2080..6216..18496...55000..163760...487296..1450192
..8..64.108..420.1344..4212.13860..44880..144540..468852..1517184..4906980
.10.100.144..640.2176..7072.25200..87040..296560.1028128..3545856.12198016
.12.144.180..900.3200.10660.40740.148240..526900.1931300..7015680.25336420
.14.196.216.1200.4416.14976.60984.231744..851400.3276624.12438144.46737936
.16.256.252.1540.5824.20020.86436.340816.1285900.5170900.20393856.79220932

Examples

			Some solutions for n=4 k=3
..0..1..0....0..1..1....1..1..0....0..0..1....0..0..1....1..0..1....1..0..0
..1..1..0....0..1..1....1..1..0....0..1..1....1..0..1....1..1..0....1..0..0
..1..1..0....0..0..1....1..1..0....0..1..0....0..0..1....0..1..0....1..0..0
..1..0..0....0..0..1....1..1..0....0..1..0....0..0..1....0..1..0....1..0..0
		

Crossrefs

Column 1 is A004275(n+1)
Column 2 is A016742
Column 3 is A044102(n-1) for n>1
Row 1 is A006355(n+2)
Row 2 is A206981
Row 3 is A207840

Formula

Empirical for column k:
k=1: a(n) = 2*n
k=2: a(n) = 4*n^2
k=3: a(n) = 36*n - 36 for n>1
k=4: a(n) = 20*n^2 + 40*n - 60 for n>1
k=5: a(n) = 96*n^2 - 32*n - 64 for n>1
k=6: a(n) = 364*n^2 - 416*n + 52 for n>1
k=7: a(n) = 84*n^3 + 840*n^2 - 1344*n + 420 for n>1
Empirical for row n:
n=1: a(k)=a(k-1)+a(k-2)
n=2: a(k)=2*a(k-1)+2*a(k-2)-a(k-3)
n=3: a(k)=a(k-1)+4*a(k-2)+5*a(k-3)+2*a(k-4)-a(k-5)+a(k-6) for k>8
n=4: a(k)=a(k-1)+4*a(k-2)+9*a(k-3)+5*a(k-4)-2*a(k-5)+4*a(k-6) for k>8
n=5: a(k)=a(k-1)+4*a(k-2)+13*a(k-3)+8*a(k-4)-3*a(k-5)+9*a(k-6) for k>8
n=6: a(k)=a(k-1)+4*a(k-2)+17*a(k-3)+11*a(k-4)-4*a(k-5)+16*a(k-6) for k>8
n=7: a(k)=a(k-1)+4*a(k-2)+21*a(k-3)+14*a(k-4)-5*a(k-5)+25*a(k-6) for k>8

A220032 T(n,k)=Number of nXk arrays of the minimum value of corresponding elements and their horizontal or diagonal neighbors in a random, but sorted with lexicographically nondecreasing rows and nonincreasing columns, 0..1 nXk array.

Original entry on oeis.org

2, 2, 3, 3, 4, 4, 4, 6, 6, 5, 5, 9, 10, 8, 6, 6, 12, 19, 15, 10, 7, 7, 15, 30, 34, 21, 12, 8, 8, 18, 42, 61, 55, 28, 14, 9, 9, 21, 55, 95, 111, 83, 36, 16, 10, 10, 24, 69, 137, 192, 187, 119, 45, 18, 11, 11, 27, 84, 187, 302, 358, 297, 164, 55, 20, 12, 12, 30, 100, 246, 442, 613, 626
Offset: 1

Views

Author

R. H. Hardin Dec 03 2012

Keywords

Comments

Table starts
..2..2..3...4....5....6.....7.....8.....9....10....11....12....13....14...15
..3..4..6...9...12...15....18....21....24....27....30....33....36....39...42
..4..6.10..19...30...42....55....69....84...100...117...135...154...174..195
..5..8.15..34...61...95...137...187...246...315...395...487...592...711..845
..6.10.21..55..111..192...302...442...618...838..1111..1447..1857..2353.2948
..7.12.28..83..187..358...613...962..1426..2034..2823..3839..5137..6782.8850
..8.14.36.119..297..626..1165..1963..3088..4630..6711..9492.13175.18010
..9.16.45.164..450.1038..2094..3789..6334..9995.15133.22239.31956
.10.18.55.219..656.1646..3587..6962.12375.20581.32588
.11.20.66.285..926.2513..5893.12243.23132.40583
.12.22.78.363.1272.3714..9335.20705.41537
.13.24.91.454.1707.5337.14323.33819

Examples

			Some solutions for n=3 k=4
..0..0..0..0....1..0..0..0....1..0..0..0....0..0..0..0....1..0..0..0
..0..0..0..0....1..1..0..0....1..0..0..0....1..1..0..0....1..1..1..0
..1..1..0..0....1..1..0..0....1..0..0..0....1..1..1..1....1..1..1..1
		

Crossrefs

Column 1 is A000027(n+1)
Column 2 is A004275(n+1)
Column 3 is A000217(n+1)
Column 4 is A062748 for n>1
Row 1 is A000027
Row 2 is A204502(n+3)

A204512 Square roots of [A055872/8]: Their square written in base 8, with some digit appended, is again a square.

Original entry on oeis.org

0, 0, 0, 1, 2, 6, 12, 35, 70, 204, 408, 1189, 2378, 6930, 13860, 40391, 80782, 235416, 470832, 1372105, 2744210, 7997214, 15994428, 46611179, 93222358, 271669860, 543339720, 1583407981, 3166815962, 9228778026, 18457556052, 53789260175, 107578520350
Offset: 1

Views

Author

M. F. Hasler, Jan 15 2012

Keywords

Comments

Base-8 analog of A031150. The square of the terms (= truncated squares A055872) are listed in A204504.

Crossrefs

See also A031149=sqrt(A023110) (base 10), A204502=sqrt(A204503) (base 9), A204514=sqrt(A055872) (base 8), A204516=sqrt(A055859) (base 7), A204518=sqrt(A055851) (base 6), A204520=sqrt(A055812) (base 5), A004275=sqrt(A055808) (base 4), A001075=sqrt(A055793) (base 3), A001541=sqrt(A055792) (base 2).

Programs

  • Mathematica
    CoefficientList[Series[(x^4 (1+2x))/(1-6x^2+x^4),{x,0,40}],x] (* Harvey P. Dale, Nov 30 2020 *)
  • PARI
    b=8;for(n=1,1e7,issquare(n^2\b) & print1(sqrtint(n^2\b)","))
    
  • PARI
    a(n)=polcoeff((2*x^5 + x^4)/(x^4 - 6*x^2 + 1+O(x^n)),n)

Formula

G.f. = x^4*(1 + 2*x)/(1 - 6*x^2 + x^4)

A300576 Number of nights required in the worst case to find the princess in a castle with n rooms arranged in a line (Castle and princess puzzle).

Original entry on oeis.org

1, 2, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122
Offset: 1

Views

Author

Dmitry Kamenetsky, Mar 09 2018

Keywords

Comments

This is a logic puzzle. There is a castle with n rooms arranged in a line. The princess living in the castle sleeps in a different room each night, but always one adjacent to the one in which she slept on the previous night. She is free to choose any room in which to sleep on the first night. A prince would like to find the princess, but she will not tell him where she is going to sleep each night. Each night the prince can look in a single room. What strategy should he follow in order to guarantee that he finds the princess in a minimum number of nights?
The strategy to find the princess guaranteed within a(n) nights takes on average k(n) nights until the princess is found with lim_{n->oo} k(n) = n-1.5. For n>4, strategies with lower average numbers of trials exist; A386462 provides this strategy for n=8. See there for more information. - Ruediger Jehn, Aug 05 2025
Christian Perfect (see link) considered the case when the rooms are arranged as a general graph. He showed that the set of solvable graphs is exactly the set of trees not containing the "threesy" subgraph, which is A130131. He also showed that for d-level binary trees with 1 <= d <= 4 the number of required nights is 1, 2, 6, 18. Binary trees with d >= 5 are unsolvable as they contain "threesy".

Examples

			For n = 1, there is only one room to search, so a(1) = 1.
For n = 2, the prince searches room 1 on the first night. If the princess is not there that means she was in room 2. If the prince searches room 1 again then he is guaranteed to see the princess as she has to move from room 2 to room 1 (she cannot stay in the same room). So a(2) = 2.
For n = 3, the prince searches room 2 on the first night. If the princess is not there that means she was either in room 1 or 3. On the second night she must go to room 2 and this is where the prince will find her. So a(3) = 2.
For n = 4, a solution that guarantees to find the princess in a(4)=4 nights is to search rooms (2,3,3,2).
For n = 5, a solution that guarantees to find the princess in a(5)=6 nights is to search rooms (2,3,4,4,3,2).
In the general case for n >= 3, a solution guaranteeing success in the minimum number of nights is to search rooms (2,3,...,n-1,n-1,...,3,2), so a(n) = 2*n - 4.
		

Crossrefs

Essentially the same as A005843, A004277 and A004275.

Programs

  • Mathematica
    CoefficientList[ Series[(2x^3 - x^2 + 1)/(x - 1)^2, {x, 0, 62}], x] (* Robert G. Wilson v, Mar 12 2018 *)
    Join[{1,2},Range[2,200,2]] (* Harvey P. Dale, Jan 25 2019 *)

Formula

For n >= 3, a(n) = 2*n - 4.
From Chai Wah Wu, Apr 14 2024: (Start)
a(n) = 2*a(n-1) - a(n-2) for n > 4.
G.f.: x*(2*x^3 - x^2 + 1)/(x - 1)^2. (End)
E.g.f.: 4 + 2*exp(x)*(x - 2) + 3*x + x^2. - Stefano Spezia, Aug 15 2025

A251603 Numbers k such that k + 2 divides k^k - 2.

Original entry on oeis.org

3, 4551, 46775, 82503, 106976, 1642796, 4290771, 4492203, 4976427, 21537831, 21549347, 21879936, 51127259, 56786087, 60296571, 80837771, 87761787, 94424463, 96593696, 138644871, 168864999, 221395539, 255881451, 297460451, 305198247, 360306363, 562654203
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 05 2014

Keywords

Comments

Numbers k such that (k^k - 2)/(k + 2) is an integer.
Since k == -2 (mod k+2), also numbers k such that k + 2 divides (-2)^k - 2. - Robert Israel, Jan 04 2015
Numbers k == 0 (mod 4) such that A066602(k/2+1) = 8, and odd numbers k such that k = 3 or A082493(k+2) = 8. - Robert Israel, Apr 08 2015

Examples

			3 is in this sequence because 3 + 2 = 5 divides 3^3 - 2 = 25.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..10000] | Denominator((n^n-2)/(n+2)) eq 1];
    
  • Maple
    isA251603 := proc(n)
        if modp(n &^ n-2,n+2) = 0 then
            true;
        else
            false;
        end if;
    end proc:
    A251603 := proc(n)
        option remember;
        local a;
        if n = 1 then
            3;
        else
            for a from procname(n-1)+1 do
                if isA251603(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Jan 09 2015
  • Mathematica
    Select[Range[10^6], Mod[PowerMod[#, #, # + 2] - 2, # + 2] == 0 &] (* Michael De Vlieger, Dec 20 2014, based on Robert G. Wilson v at A252041 *)
  • PARI
    for(n=1,10^9,if(Mod(n,n+2)^n==+2,print1(n,", "))); \\ Joerg Arndt, Dec 06 2014
    
  • Python
    A251603_list = [n for n in range(1,10**6) if pow(n, n, n+2) == 2] # Chai Wah Wu, Apr 13 2015

Formula

The even terms form A122711, the odd terms are those in A245319 (forming A357125) decreased by 2. - Max Alekseyev, Sep 22 2016

Extensions

a(6)-a(27) from Joerg Arndt, Dec 06 2014

A084100 Expansion of (1+x-x^2-x^3)/(1+x^2).

Original entry on oeis.org

1, 1, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2, -2, 2, 2, -2
Offset: 0

Views

Author

Paul Barry, May 15 2003

Keywords

Comments

Partial sums are A084099.
The unsigned sequence 1,1,2,2,2,2,.. has g.f. (1+x^2)/(1-x) and a(n)=sum{k=0..n, binomial(1,k/2)(1+(-1)^k)/2}. Its partial sums are A004275(n+1). The sequence 1,-1,2,-2,2,-2,... has g.f. (1+x^2)/(1+x) and a(n)=sum{k=0..n, (-1)^(n-k)binomial(1,k/2)(1+(-1)^k)/2}. - Paul Barry, Oct 15 2004

Examples

			G.f. = 1 + x - 2*x^2 - 2*x^3 + 2*x^4 + 2*x^5 - 2*x^6 - 2*x^7 + 2*x^8 + 2*x^9 + ...
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1+x-x^2-x^3)/(1+x^2),{x,0,100}],x]  (* Harvey P. Dale, Apr 20 2011 *)
    a[ n_] := (-1)^Quotient[n, 2] If[ Quotient[n, 2] != 0, 2, 1]; (* Michael Somos, Jan 05 2017 *)
  • PARI
    {a(n) = (-1)^(n\2) * if( n\2, 2, 1)}; /* Michael Somos, Jan 05 2017 */

Formula

Euler transform of length 4 sequence [1, -3, 0, 1]. - Michael Somos, Jan 05 2017
G.f.: (1 + x) * (1 - x^2) / (1 + x^2). - Michael Somos, Jan 05 2017
a(n) = a(1-n) for all n in Z. - Michael Somos, Jan 05 2017
a(2*n) = a(2*n + 1) = A280560(n) for all n in Z. - Michael Somos, Jan 05 2017

A252041 Numbers m such that m - 3 divides m^m + 3.

Original entry on oeis.org

1, 2, 4, 5, 6, 9, 10, 85, 105, 136, 186, 262, 820, 1161, 2626, 2926, 4924, 10396, 11656, 19689, 27637, 33736, 36046, 42886, 42901, 53866, 55189, 82741, 95266, 103762, 106822, 127401, 135460, 251506, 366796, 375220, 413326, 466966, 531445, 553456, 568876
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 12 2014

Keywords

Comments

Numbers m such that (m^m + 3)/(m - 3) is an integer.
Most but not all terms are congruent to 4 modulo 6. - Robert G. Wilson v, Dec 19 2014
Note that m^m == 3^m (mod m-3). - Robert Israel, Dec 19 2014

Examples

			2 is in this sequence because (2^2 + 3)/(2 - 3) = -7 is an integer.
4 is in this sequence because (4^4 + 3)/(4 - 3) = 259 is an integer.
7 is not in the sequence because (7^7 + 3)/4 = 411773/2, which is not an integer.
		

Crossrefs

Cf. ...............Numbers n such that x divides y, where:
...x......y....k = 0.....k = 1.....k = 2......k = 3.......
..n-k..n^n-k..A000027...A087156...A242787....A242788......
..n-k..n^n+k..A000027..see below..A249751..this sequence..
..n+k..n^n-k..A000027...A004275...A251603....A251862......
..n+k..n^n+k..A000027...A004273...A213382....A242800......
(For x=n-1 and y=n^n+1, the only terms are 0, 2 and 3. - David L. Harden, Dec 28 2014)

Programs

  • Magma
    [n: n in [4..50000] | Denominator((n^n+3)/(n-3)) eq 1];
    
  • Maple
    select(t -> 3 &^t + 3 mod (t-3) = 0, [1,2,$4..10^6]); # Robert Israel, Dec 19 2014
  • Mathematica
    fQ[n_] := Mod[PowerMod[n, n, n - 3] + 3, n - 3] == 0; Select[Range@ 1000000, fQ] (* Michael De Vlieger, Dec 13 2014; modified by Robert G. Wilson v, Dec 19 2014 *)
  • PARI
    isok(n) = (n != 3) && (Mod(n, n-3)^n  == -3); \\ Michel Marcus, Dec 13 2014

Extensions

More terms from Michel Marcus, Dec 13 2014

A103829 Sum of even digits less than sum of odd digits.

Original entry on oeis.org

0, 2, 4, 6, 8, 12, 14, 16, 18, 20, 21, 22, 24, 26, 28, 34, 36, 38, 40, 41, 42, 43, 44, 46, 48, 56, 58, 60, 61, 62, 63, 64, 65, 66, 68, 78, 80, 81, 82, 83, 84, 85, 86, 87, 88, 102, 104, 106, 108, 114, 116, 118, 120, 122, 124, 126, 128, 136, 138, 140, 141, 142, 144, 146
Offset: 1

Views

Author

Zak Seidov, Feb 17 2005

Keywords

Comments

0 is assumed as even digit: A005843, A004275, A007928. Sum of even digits equals sum of odd digits A036301.

Crossrefs

Programs

  • Mathematica
    Select[Range[300], Plus@@Select[IntegerDigits[ # ], OddQ]
    				
Previous Showing 21-30 of 44 results. Next