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.

User: Robert FERREOL

Robert FERREOL's wiki page.

Robert FERREOL has authored 16 sequences. Here are the ten most recent ones:

A378683 a(0) = 1, a(n+1) = 6*a(n)^3 - 3*a(n).

Original entry on oeis.org

1, 3, 153, 21489003, 59538796254981950751153, 1266343134315970349117919634635229303292221774134557782012151266098003
Offset: 0

Author

Robert FERREOL, Dec 03 2024

Keywords

Comments

If we define u(0) = 1 , u(n+1) = (u(n)/3)*(u(n)^2+9) / (u(n)^2 + 1), then u(n) = A238799(n) / a(n) ; this is Halley's method to calculate sqrt(3).

Crossrefs

Programs

  • Maple
    a:=1 : A:=NULL : for k to 5 do a:=6*a^3-3*a : A:=A,a od : A;
  • Mathematica
    NestList[6#^3-3# &, 1, 5] (* Stefano Spezia, Dec 06 2024 *)

Formula

a(n) = ((1 + sqrt(3))^(3^n) - (1 - sqrt(3))^(3^n))/2^((3^n+1)/2) / sqrt(3).
a(n) = A002530(3^n).
a(n) = A002605(3^n)/2^((3^n+1)/2).

A371805 Composite numbers k that divide A001644(k) - 1.

Original entry on oeis.org

182, 25201, 54289, 63618, 194390, 750890, 804055, 1889041, 2487941, 3542533, 3761251, 6829689, 12032021, 12649337, 18002881
Offset: 1

Author

Robert FERREOL, Apr 06 2024

Keywords

Comments

If k is prime, k divides A001644(k) - 1; and since A001644(k) satisfies a tribonacci recurrence, these numbers could be called tribonacci pseudoprimes.

Examples

			(A001644(182)-1)/182 = 8056145960961609628091266244940745410646318417.
		

Crossrefs

Cf. A001644.
Cf. A005845 (composite k that divide Lucas(k) - 1).
Cf. A013998 (composite k that divide Perrin(k) - 1).

Programs

  • Maple
    A001644:=proc(n) option remember: if n=0 then 3 elif n=1 then 1 elif n=2 then 3 else A001644(n-1)+A001644(n-2)+A001644(n-3) fi end:
    test:=n->A001644(n) mod n = 1:select(test and not isprime, [seq(n, n=1..100000)]);
  • Mathematica
    seq[kmax_] := Module[{x = 1, y = 3, z = 7, s = {}, t}, Do[t = x + y + z; If[Mod[t, k] == 1 && CompositeQ[k], AppendTo[s, k]]; x = y; y = z; z = t, {k, 4, kmax}]; s]; seq[200000] (* Amiram Eldar, Apr 06 2024 *)
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        t0, t1, t2 = 3, 1, 3
        for k in count(1):
            t0, t1, t2 = t1, t2, t0+t1+t2
            if k > 1 and not isprime(k) and (t0-1)%k == 0:
                yield k
    print(list(islice(agen(), 5))) # Michael S. Branicky, Apr 07 2024

Extensions

a(13)-a(15) from Amiram Eldar, Apr 07 2024

A352615 Decimal expansion of Integral_{0<=x,y<=Pi/2} sqrt(1-cos^2(x)*cos^2(y)) dx dy.

Original entry on oeis.org

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

Author

Robert FERREOL, Mar 23 2022

Keywords

Examples

			2.0776814600281582057831205567855290128037790576247...
		

Crossrefs

Cf. A091670 ((1/Pi^2)*Integral_{0<=x,y<=Pi} 1/sqrt(1-cos^2(x)*cos^2(y)) dx dy).

Programs

  • Maple
    a:=1/sqrt(2):evalf((EllipticE(a)-EllipticK(a))^2+EllipticE(a)^2,50);
  • Mathematica
    RealDigits[(EllipticE[1/2] - EllipticK[1/2])^2 + EllipticE[1/2]^2, 10, 105][[1]] (* Amiram Eldar, Mar 24 2022 *)

Formula

Equals Sum _{n>=0} (Pi^2/(4*(2*n-1))*(binomial(2*n,n)/4^n)^3).
Equals (E(a) - K(a))^2 + E(a)^2 where a = 1/sqrt(2) and E (resp. K) is the complete elliptic integral of the second (resp. first) kind.

A307768 Number of n-step random walks on a line starting from the origin and returning to it at least once.

Original entry on oeis.org

0, 0, 2, 4, 10, 20, 44, 88, 186, 372, 772, 1544, 3172, 6344, 12952, 25904, 52666, 105332, 213524, 427048, 863820, 1727640, 3488872, 6977744, 14073060, 28146120, 56708264, 113416528, 228318856, 456637712, 918624304, 1837248608, 3693886906, 7387773812, 14846262964, 29692525928
Offset: 0

Author

Robert FERREOL, Apr 27 2019

Keywords

Comments

a(n)/2^n tends to 1 as n goes to infinity; this means that on the line any random walk returns sooner or later to its starting point with a probability 1.
a(n) is also the number of heads-or-tails games of length n during which at some point there are as many heads as tails.

Examples

			The a(3)=4 three-step walks returning to 0 are [0, -1, 0, -1], [0, -1, 0, 1], [0, 1, 0, -1], [0, 1, 0, 1].
The a(4)=10 three-step walks returning to 0 are [0, -1, -2, -1, 0], [0, -1, 0, -1, -2], [0, -1, 0, -1, 0], [0, -1, 0, 1, 0], [0, -1, 0, 1, 2], [0, 1, 0, -1, -2], [0, 1, 0, -1, 0], [0, 1, 0, 1, 0], [0, 1, 0, 1, 2], [0, 1, 2, 1, 0].
		

Crossrefs

Programs

  • Maple
    b:=n->piecewise(n mod 2 = 0,binomial(n,n/2),2*binomial(n-1,(n-1)/2)):
    seq(2^n-b(n),n=0..20);
    # second program:
    A307768 := series(exp(2*x) - int((1/x + 2)*BesselI(1,2*x),x) - BesselI(1,2*x), x = 0, 36): seq(n!*coeff(A307768, x, n), n = 0 .. 35); # Mélika Tebni, Jun 19 2024
  • Mathematica
    a[n_] := If[n == 0, 0, 2^n - 2*Binomial[n-1, Floor[(n-1)/2]]];
    Array[a, 36, 0] (* Jean-François Alcover, May 05 2019 *)

Formula

a(n) = 2^n - A063886(n).
a(n+1) = 2*A045621(n) = 2*(2^n - binomial(n,floor(n/2))).
a(2n) = 2^(2n) - binomial(2n,n); a(2n+1) = 2*a(2n).
G.f.: (1-sqrt(1-4*x^2))/(1-2*x). - Alois P. Heinz, May 05 2019
n*(a(n)-2*a(n-1)) - 4*(n-3)*(a(n-2)-2*a(n-3)) = 0. - Robert Israel, May 06 2019
a(2n+2) - 2*a(2n+1) = A284016(n) = 2*Catalan(n). - Robert FERREOL, Aug 26 2019
From Mélika Tebni, Jun 19 2024: (Start)
E.g.f.: exp(2*x) - Integral_{x=-oo..oo} (1/x + 2)*BesselI(1, 2*x) dx - BesselI(1, 2*x).
a(n) = 2*(A027306(n) - A128014(n)). (End)

A323605 Smallest prime divisor of A000058(n) = A007018(n) + 1 (Sylvester's sequence).

Original entry on oeis.org

2, 3, 7, 43, 13, 3263443, 547, 29881, 5295435634831, 181, 2287, 73
Offset: 0

Author

Robert FERREOL, Jan 19 2019

Keywords

Comments

a(n) is also the smallest prime divisor of A007018(n+1) that is not a divisor of A007018(n).
The prime numbers a(n) are all distinct, which proves the infinitude of the prime numbers (Saidak's proof).
a(12) <= 2589377038614498251653. - Daniel Suteu, Jan 20 2019
a(12)..a(50) = [?, 52387, 13999, 17881, 128551, 635263, ?, ?, 352867, 387347773, ?, 74587, ?, ?, 27061, 164299, 20929, 1171, ?, 1679143, ?, ?, 120823, 2408563, 38218903, 333457, 30241, 4219, 1085443, 7603, 1861, ?, 23773, 51769, 1285540933, 429547, ?, 8323570543, ?], where ? denote unknown values > 10^10. - Max Alekseyev, Oct 11 2023

Crossrefs

Programs

  • Maple
    with(numtheory):
    u:=1: P:=NULL: to 9 do P:=P,sort([op(divisors(u+1))])[2]: u:=u*(u+1) od:
    P;
  • PARI
    f(n)=if(n<1, n>=0, f(n-1)+f(n-1)^2); \\ A007018
    a(n)=divisors(f(n)+1)[2]; \\ Michel Marcus, Jan 20 2019

Formula

a(n) = A007996(m), where m is the smallest index such that A180871(m) = n. - Max Alekseyev, Oct 11 2023

Extensions

a(10)-a(11) from Daniel Suteu, Jan 20 2019

A322419 Number of n-step self-avoiding walks on L-lattice.

Original entry on oeis.org

1, 2, 4, 8, 12, 20, 32, 52, 84, 136, 220, 356, 564, 904, 1448, 2320, 3684, 5872, 9376, 14960, 23688, 37652, 59912, 95316, 150744, 239080, 379528, 602424, 951788, 1507136, 2388252, 3784344, 5973988, 9447880, 14950796, 23658540, 37321752, 58965260, 93206864, 147333080, 232286272
Offset: 0

Author

Robert FERREOL, Dec 07 2018

Keywords

Comments

The L-lattice is an oriented square lattice in which each step must be followed by a step perpendicular to the preceding one.

Examples

			a(1) = 2 because there are only two possible directions at each intersection; for the same reason a(2) = 2*2 and a(3) = 2*4 ; but a(4) = 12 (not 16) because four paths return to the starting point and are not self-avoiding. See the 12 paths under "links".
		

Crossrefs

Cf. A001411 (square lattice), A117633 (Manhattan lattice), A189722, A004277 (coordination sequence), A151798.

Programs

  • Maple
    walks:=proc(n)
        option remember;
        local i,father,End,X,walkN,dir,u,x,y;
        if n=1 then [[[0,0]]] else
             father:=walks(n-1):
             walkN:=NULL:
             for i to nops(father) do
                u:=father[i]:End:=u[n-1]:if n mod 2 = 0 then
                dir:=[[1,0], [-1, 0]] else dir := [[0,1], [0, -1]] fi:
                for X in dir do
                 if not(member(End+X,u)) then walkN:=walkN,[op(u),End+X] fi;
                 od od:
             [walkN] fi end:
    n:=5:L:=walks(n):N:=nops(L);
    # This program explicitly gives the a(n) walks.
  • Mathematica
    mo = {{1, 0}, {-1, 0}}; moo = {{0, 1}, {0, -1}}; a[0] = 1;
    a[tg_, p_: {{0, 0}}] := Module[{e, mv},
    If[Mod[tg, 2] == 0, mv = Complement[Last[p] + # & /@ mo, p],
    mv = Complement[Last[p] + # & /@ moo, p]];
    If[tg == 1, Length@mv, Sum[a[tg - 1, Append[p, e]], {e, mv}]]];
    a /@ Range[0, 20] (* after the program from Giovanni Resta at A001411 *)
  • Python
    def add(L, x):
        M = [y for y in L]
        M.append(x)
        return M
    plus = lambda L, M: [x + y for x, y in zip(L, M)]
    mo = [[1, 0], [-1, 0]]
    moo = [[0, 1], [0, -1]]
    def a(n, P=[[0, 0]]):
        if n == 0:
            return 1
        if n % 2 == 0:
            mv1 = [plus(P[-1], x) for x in mo]
        else:
            mv1 = [plus(P[-1], x) for x in moo]
        mv2 = [x for x in mv1 if x not in P]
        if n == 1:
            return len(mv2)
        else:
            return sum(a(n - 1, add(P, x)) for x in mv2)
    [a(n) for n in range(21)]

Formula

a(n) = 4*A189722(n) for n >= 2.
It is proved that a(n)^(1/n) has a limit mu called the "connective constant" of the L-lattice; approximate value of mu: 1.5657. It is only conjectured that a(n + 1) ~ mu * a(n).

A321172 Triangle read by rows: T(m,n) = number of Hamiltonian cycles on m X n grid of points (m >= 2, 2 <= n <= m).

Original entry on oeis.org

1, 1, 0, 1, 2, 6, 1, 0, 14, 0, 1, 4, 37, 154, 1072, 1, 0, 92, 0, 5320, 0, 1, 8, 236, 1696, 32675, 301384, 4638576, 1, 0, 596, 0, 175294, 0, 49483138, 0, 1, 16, 1517, 18684, 1024028, 17066492, 681728204, 13916993782, 467260456608
Offset: 2

Author

Robert FERREOL, Jan 10 2019

Keywords

Comments

Orientation of the path is not important; you can start going either clockwise or counterclockwise. Paths related by symmetries are considered distinct.
The m X n grid of points when drawn forms a (m-1) X (n-1) rectangle of cells, so m-1 and n-1 are sometimes used as indices instead of m and n (see, e. g., Kreweras' reference below).
These cycles are also called "closed non-intersecting rook's tours" on m X n chess board.

Examples

			T(5,4)=14 is illustrated in the links above.
Table starts:
=================================================================
m\n|  2    3      4       5         6           7            8
---|-------------------------------------------------------------
2  |  1    1      1       1         1           1            1
3  |  1    0      2       0         4           0            8
4  |  1    2      6      14        37          92          236
5  |  1    0     14       0       154           0         1696
6  |  1    4     37     154      1072        5320        32675
7  |  1    0     92       0      5320           0       301384
8  |  1    8    236    1696     32675      301384      4638576
The table is symmetric, so it is completely described by its lower-left half.
		

Crossrefs

Row/column k=4..12 are: (with interspersed zeros for odd k): A006864, A006865, A145401, A145416, A145418, A160149, A180504, A180505, A213813.
Cf. A003763 (bisection of main diagonal), A222200 (subdiagonal), A231829, A270273, A332307.
T(n,2n) gives A333864.

Programs

  • Python
    # Program due to Laurent Jouhet-Reverdy
    def cycle(m, n):
         if (m%2==1 and n%2==1): return 0
         grid = [[0]*n for _ in range(m)]
         grid[0][0] = 1; grid[1][0] = 1
         counter = [0]; stop = m*n-1
         def run(i, j, nb_points):
             for ni, nj in [(i-1, j), (i+1, j), (i, j+1), (i, j-1)] :
                 if  0<=ni<=m-1 and 0<=nj<=n-1 and grid[ni][nj]==0 and (ni,nj)!=(0,1):
                     grid[ni][nj] = 1
                     run(ni, nj, nb_points+1)
                     grid[ni][nj] = 0
                 elif (ni,nj)==(0,1) and nb_points==stop:
                     counter[0] += 1
         run(1, 0, 2)
         return counter[0]
    L=[];n=7#maximum for a time < 1 mn
    for i in range(2,n):
        for j in range(2,i+1):
           L.append(cycle(i,j))
    print(L)

Formula

T(m,n) = T(n,m).
T(2m+1,2n+1) = 0.
T(2n,2n) = A003763(n).
T(n,n+1) = T(n+1,n) = A222200(n).
G. functions , G_m(x)=Sum {n>=0} T(m,n-2)*x^n after Stoyan's link p. 18 :
G_2(x) = 1/(1-x) = 1+x+x^2+...
G_3(x) = 1/(1-2*x^2) = 1+2*x^2+4*x^4+...
G_4(x) = 1/(1-2*x-2*x^2+2*x^3-x^4) = 1+2*x+6*x^2+...
G_5(x) = (1+3*x^2)/(1-11*x^2-2*x^6) = 1+14*x^2+154*x^4+...

Extensions

More terms from Pontus von Brömssen, Feb 15 2021

A320122 Numbers that are not Keith numbers in any base.

Original entry on oeis.org

12, 30, 390, 1170, 1200, 1560, 2340, 2760, 3120, 3900, 4680, 6120, 6240, 7680, 7800, 8460, 10020, 10140, 10950, 11580, 15090, 15480, 17160, 17580, 18360, 19140, 20280, 20700, 20940, 21480, 23040, 23280, 24060, 24210, 24960, 26550, 28740, 29250, 29520, 29670, 30060, 31080, 32400
Offset: 1

Author

Robert FERREOL, Oct 06 2018

Keywords

Comments

A number N >= 2 is a Keith number in a base b <= N if the Fibonacci sequence u(i) whose initial terms are the t digits of N in the base b, and later terms are given by rule that u(i) = sum of t previous terms, contains N itself. Here a(n) is the n-th number N that is not a Keith number in any base b <= N.

Examples

			a(1) = 12 because 12 is not a Keith number in any base from 2 to 12, while all previous numbers are in some base.
For example, with b = 2, the sequence is : 1, 1, 0, 0, 2, 3, 5, 10, 20, ...; it doesn't contain 12. See A251703.
		

Crossrefs

Cf. A007629 (Keith numbers in base 10).

Programs

  • Maple
    fibo:=proc(n, b) local L,m,M,k:
    L:=convert(n,base,b):m:=nops(L):M:=seq(L[m+1-k],k=1..m):
    while M[m]
    				
  • PARI
    iskb(n, b) = if(nA007629
    isok(n) = if (n<=2, 0, for(b=2, n-1, if (iskb(n, b), return(0))); return (1)); \\ Michel Marcus, Oct 08 2018
  • Python
    def digits(n, b):
        r = []
        m = n
        while m > 0:
            r = [m % b] + r
            m = m // b
        return r
    def fibo(n, b):
        L = digits(n, b)
        m = len(L) - 1
        while L[m] < n:
            L.append(sum(k for k in L))
            L.pop(0)
        return L[m] == n
    def test(n):
        for b in range(2, n + 1):
            if fibo(n, b):
                return True
        return False
    print([n for n in range(2, 2001) if not test(n)])
    

Extensions

More terms from Michel Marcus, Oct 08 2018

A284458 Number of pairs (f,g) of endofunctions on [n] such that the composite function gf has no fixed point.

Original entry on oeis.org

1, 0, 2, 156, 16920, 2764880, 650696400, 210105425628, 89425255439744, 48588905856409920, 32845298636854828800, 27047610425293718239100, 26664178085975252011318272, 31009985808408471580603417296, 42017027730087624384021945067520
Offset: 0

Author

Robert FERREOL, Mar 27 2017

Keywords

Comments

Consider n boys and n girls, each boy secretly loving a girl and vice versa. The probability that no couple could be formed is a(n)/n^(2n).
a(n) is the number of pairs of binary matrices n X n (M, N), M having only one 1 per row, N having only one 1 per column, such that M + N has no coefficient equal to 2.
Limit_{n -> infinity} a(n)/n^(2n) = 1/e.

Examples

			For two boys A,B and two girls A',B', the a(2) possibilities are:
A loves A' who loves B who loves B' who loves A;
A loves B' who loves B who loves A' who loves A.
		

Crossrefs

Programs

  • Maple
    a:=n->add((-1)^k*binomial(n,k)^2*k!*n^(2*(n-k)),k=0..n):
    seq(a(n),n=0..15);
  • Mathematica
    Table[Sum[(-1)^k Binomial[n,k]^2 * k! * n^(2*(n - k)), {k, 0, n}], {n, 1, 15}] (* Indranil Ghosh, Mar 27 2017 *)
    Table[HypergeometricU[-n, 1, n^2], {n, 1, 15}] (* Jean-François Alcover, Mar 29 2017 *)
  • PARI
    a(n) = sum(k=0, n, (-1)^k * binomial(n,k)^2 * k! * n^(2*(n-k))); \\ Michel Marcus, Apr 04 2017

Formula

a(n) = Sum_{k=0..n} (-1)^k * binomial(n,k)^2 * k! * n^(2*(n-k)).
a(n) = A343700(n)/A350558(n). - Dan Eilers, Jan 17 2023

A283654 Triangle T(n,m) read by rows: number of n X m binary matrices with no rows or columns in which all entries are the same (n >= 1, 1 <= m <= n).

Original entry on oeis.org

0, 0, 2, 0, 6, 102, 0, 14, 906, 22874, 0, 30, 6510, 417810, 17633670, 0, 62, 42666, 6644714, 622433730, 46959933962, 0, 126, 267582, 99044946, 20218802310, 3204360965106, 451575174961302, 0, 254, 1641786, 1430529674, 630917888610, 208308918928634, 60134626974122946, 16271255119687320314
Offset: 1

Author

Robert FERREOL, Mar 14 2017

Keywords

Examples

			The T(2,3)=6 matrices are
1 0 1
0 1 0
and the matrices obtained by permutations of rows and columns.
First values in triangle
0;
0, 2;
0, 6, 102;
0, 14, 906, 22874;
0, 30, 6510, 417810, 17633670;
0, 62, 42666, 6644714, 622433730, 46959933962;
0, 126, 267582, 99044946, 20218802310, 3204360965106, 451575174961302;
		

Crossrefs

Diagonal gives A283624.
Cf. A183109.

Programs

  • Maple
    T0:=(n,m)->add((-1)^(m+k)*binomial(n,k)*(2^k-1)^m, k=0..n):
    T:=(n,m)->2*T0(n,m)+2^(n*m)+(2^n-2)^m+(2^m-2)^n-2*(2^m-1)^n-2*(2^n-1)^m:
    seq(seq(T(n,m), m=1..n),n=1..10);
  • Mathematica
    T[n_, m_] := Sum[(-1)^j*Binomial[m, j]*(2^(m - j) - 1)^n, {j, 0, m}]; Flatten[Table[2*T[n, m] + 2^(n*m) + (2^n - 2)^m + (2^m - 2)^n - 2*(2^m - 1)^n - 2*(2^n - 1)^m, {n, 10}, {m, n}]] (* Indranil Ghosh, Mar 14 2017 *)
  • PARI
    T(n, m) = sum(j=0, m, (-1)^j*binomial(m, j)*(2^(m - j) - 1)^n);
    tabl(nn) = {for(n=1, nn, for(m=1, n, print1(2*T(n,m) + 2^(n*m) + (2^n - 2)^m + (2^m - 2)^n - 2*(2^m - 1)^n - 2*(2^n - 1)^m,", ");); print(););};
    tabl(10); \\ Indranil Ghosh, Mar 14 2017
    
  • Python
    import math
    f=math.factorial
    def C(n,r): return f(n)//f(r)//f(n - r)
    def T(n,m): return sum([(-1)**j*C(m,j)*(2**(m - j) - 1)**n for j in range (0, m+1)])
    i=1
    for n in range(1,11):
        for m in range(1, n+1):
            print(str(i)+" "+str(2*T(n, m) + 2**(n*m) + (2**n - 2)**m + (2**m - 2)**n - 2*(2**m - 1)**n - 2*(2**n - 1)**m))
            i+=1 # Indranil Ghosh, Mar 14 2017

Formula

T(n,m) = T(m,n) = 2*A183109(n,m) + 2^(n*m) + (2^n-2)^m + (2^m-2)^n - 2*(2^m-1)^n - 2*(2^n-1)^m.
T(n,1)=0, T(n,2)=2^n-2, T(n,3)=6^n-6*(3^n-2^n).