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: Sébastien Dumortier

Sébastien Dumortier's wiki page.

Sébastien Dumortier has authored 24 sequences. Here are the ten most recent ones:

A343292 Number of distinct results produced when generating a graphical image of each row of the multiplication table modulo n.

Original entry on oeis.org

1, 2, 3, 4, 4, 6, 5, 8, 7, 9, 7, 12, 8, 12, 13, 14, 10, 16, 11, 18, 17, 18, 13, 24, 16, 21, 19, 24, 16, 28, 17, 26, 25, 27, 25, 32, 20, 30, 29, 36, 22, 38, 23, 36, 35, 36, 25, 44, 29, 41, 37, 42, 28, 46, 37, 48, 41, 45, 31, 56, 32, 48, 47, 50, 43, 58, 35, 54, 49, 60
Offset: 1

Author

Sébastien Dumortier, Apr 12 2021

Keywords

Comments

The k-th row of the multiplication tables can be shown graphically by drawing a line for each i from i to k * i (mod n). The direction of the lines is not important.

Examples

			Modulo 11, the 2 and 6 time tables, the 3 and 4 time tables, the 5 and 9 time tables, and the 7 and 8 time tables give the same pattern. So there are only 7 different time tables (0,1,2,3,5,7 and 10).
		

Crossrefs

Programs

  • Mathematica
    {1}~Join~Array[# - (EulerPhi[#] - Sum[Boole[Mod[k^2, #] == 1], {k, #}])/2 &, 69, 2] (* Michael De Vlieger, Apr 13 2021 *)
  • PARI
    G(n,r)={Set(vector(n, i, my(j=i*r%n); [min(i,j), max(i,j)]))}
    a(n)={#Set(vector(n, k, concat(G(n,k-1))))} \\ Andrew Howroyd, Apr 12 2021
    
  • PARI
    \\ here b(n) is A060594(n).
    b(n)={my(o=valuation(n, 2)); 2^(omega(n>>o)+max(min(o-1, 2), 0))}
    a(n)={n - (eulerphi(n)-b(n))/2} \\ Andrew Howroyd, Apr 12 2021

Formula

a(n) = n - A329152(n) = n - (A000010(n) - A060594(n))/2. - Andrew Howroyd, Apr 12 2021
a(p) = (p + 3)/2 for p prime. - Michael De Vlieger, Apr 13 2021

A340491 Number of n-digit numbers x such that rev(x^2) = rev(x)^2 and x does not contain any zero digits, where rev(x) is the digit reversal of x.

Original entry on oeis.org

3, 6, 9, 11, 10, 7, 7, 1, 1
Offset: 1

Author

Sébastien Dumortier, Jan 10 2021

Keywords

Comments

The number of solutions of rev(x^2) = rev(x)^2 increases but the solutions with a 0 don't. Any number with more than 9 digits can't be a solution, due to the development of x^2.

Examples

			The 7 solutions with 7 digits are 1111111, 1111112, 1111121, 1111211, 1121111, 1211111, 2111111.
		

Crossrefs

Cf. A098701 (number of solutions) and A085305 (the solutions), where digit 0 is not forbidden.
Cf. A004086 (digit reversal), A052382 (zeroless numbers).

Programs

  • PARI
    isok(k) = my(d=digits(k)); vecmin(d) && (fromdigits(Vecrev(digits(k^2))) == fromdigits(Vecrev(d))^2);
    a(n) = sum(k=10^(n-1), 10^n-1, isok(k)); \\ Michel Marcus, Jan 16 2021

A273982 Number of little cubes visible around an n X n X n cube with a face on a table.

Original entry on oeis.org

1, 8, 25, 52, 89, 136, 193, 260, 337, 424, 521, 628, 745, 872, 1009, 1156, 1313, 1480, 1657, 1844, 2041, 2248, 2465, 2692, 2929, 3176, 3433, 3700, 3977, 4264, 4561, 4868, 5185, 5512, 5849, 6196, 6553, 6920, 7297, 7684, 8081, 8488, 8905, 9332, 9769, 10216
Offset: 1

Author

Sébastien Dumortier, Jun 05 2016

Keywords

Comments

There are fewer visible cubes on the bottom than on the top.

Examples

			a(3)=25 because around a 3 X 3 X 3 cube, when it's on a table, it's possible to see only 25 little cubes (8 on each of the 2 bottom layers and 9 on the top layer).
		

Crossrefs

Programs

  • Magma
    [5*n^2-8*n+4: n in [1..60]]; // Vincenzo Librandi, Jun 06 2016
    
  • Maple
    A273982:=n->5*n^2-8*n+4: seq(A273982(n), n=1..60); # Wesley Ivan Hurt, Oct 06 2017
  • Mathematica
    Table[5 n^2 - 8 n + 4, {n, 46}] (* or *)
    LinearRecurrence[{3, -3, 1}, {1, 8, 25}, 46] (* or *)
    CoefficientList[Series[(-1 - 5 x - 4 x^2)/(-1 + x)^3, {x, 0, 45}], x] (* Michael De Vlieger, Oct 06 2017 *)
  • PARI
    a(n) = 5*n^2 - 8*n + 4; \\ Altug Alkan, Oct 06 2017

Formula

a(n) = 5*n^2 - 8*n + 4.
a(n) = n^3 - (n-2)^3 - (n-2)^2. - Joerg Arndt, Jun 06 2016
a(n) = A168668(n-1) + 1. - Altug Alkan, Oct 06 2017
G.f.: (-1 - 5*x - 4*x^2)/(-1 + x)^3. - Michael De Vlieger, Oct 06 2017
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 3. - Wesley Ivan Hurt, Oct 06 2017
a(n) = A000566(n-1) + A000566(n), the sum of consecutive heptagonal numbers. - Charlie Marion, Jul 01 2021
a(n) = n^2 + 4*(n-1)^2. - Leo Tavares, Mar 24 2022

Extensions

a(2) corrected and entry edited by Andrey Zabolotskiy, Oct 06 2017

A273981 Erroneous version of A005897.

Original entry on oeis.org

1, 4, 26, 56, 98, 152, 218, 296, 386, 488, 602, 728, 866, 1016, 1178, 1352, 1538, 1736, 1946, 2168, 2402, 2648, 2906, 3176, 3458, 3752, 4058, 4376, 4706, 5048, 5402, 5768, 6146, 6536, 6938, 7352, 7778, 8216, 8666, 9128, 9602, 10088
Offset: 1

Author

Sébastien Dumortier, Jun 05 2016

Keywords

Formula

a(n) = 6*n^2 - 12*n + 8 = A005897(n-1) for n > 2.
a(n) = n^3 - (n-2)^3 for n > 2. - Joerg Arndt, Jun 06 2016

A185634 Number of n-length cycles from any point in a complete graph on n nodes.

Original entry on oeis.org

1, 2, 21, 204, 2605, 39990, 720601, 14913080, 348678441, 9090909090, 261535698061, 8230246567620, 281241170407093, 10371206370520814, 410525522232055665, 17361641481138401520, 781282469559318055057, 37275544492386193492506, 1879498672877297909667781
Offset: 2

Author

Sébastien Dumortier, Dec 18 2012

Keywords

Comments

If M is the n X n matrix filled with ones, a(n) is the upper left element of (M-Id)^n.

Examples

			In a complete graph in 5 nodes, there are 204 different cycles with a length of 5, from a point to itself.
		

Crossrefs

Cf. A173499.

Formula

a(n) = floor((n-1)^n/n) + ((-1)^n+1)/2.
a(n) = floor((n-1)^n/n)+1 for n odd, a(n) = floor((n-1)^n/n) for n even.

A178786 Express n as the sum of four squares, x^2+y^2+z^2+w^2, with x>=y>=z>=w>=0, maximizing the value of x. Then a(n) is that x.

Original entry on oeis.org

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

Author

Sébastien Dumortier, Jun 24 2011

Keywords

Comments

Lagrange's theorem tells us that each positive integer can be written as a sum of four squares.

Crossrefs

Analogs for 3 squares: A261904 and A261915.

Programs

  • Python
    from math import *
    for nbre in range(0, 500): # or more than 500 !
        maxc4=0
        for c1 in range(0, int(sqrt(nbre/4))+1):
            for c2 in range(c1, int(sqrt(nbre/3))+1):
                for c3 in range(c2, int(sqrt(nbre/2))+1):
                    s3=c3**2+c2**2+c1**2
                    if s3<=nbre:
                        c4=sqrt(nbre-s3)
                        if int(c4)==c4 and c4>=c3:
                            if c4>maxc4:
                                maxc4=int(c4)
        print(maxc4, end=', ')

A172164 Differences between numbers of triangles entirely contained in two consecutive turns of Pythagoras's snail (Theodorus spiral).

Original entry on oeis.org

20, 19, 20, 19, 20, 21, 18, 21, 19, 20, 20, 20, 19, 20, 20, 19, 20, 20, 20, 19, 21, 18, 21, 19, 21, 18, 21, 19, 21, 18, 21, 19, 20, 20, 20, 19, 20, 20, 19, 20, 20, 20, 19, 20, 20, 20, 19, 21, 18, 21, 19, 20, 20, 20, 19, 20, 20, 20, 19, 20, 20, 19, 20, 20, 20, 19, 21, 18, 21
Offset: 2

Author

Sébastien Dumortier, Jan 27 2010

Keywords

Comments

Conjecture : The terms are only 18,19,20,21 (From the first thousand turns, there are 2,3% of 18, 36,5% of 19, 46,2% of 20 and 15% of 21). No period found. Probably due to Pi transcendence.
From the first one hundred thousand turns, there are 1.662% 18s, 36.350% 19s, 48.393% 20s and 13.595% 21s. - Robert G. Wilson v, Mar 31 2013
From the first 10 Million turns, there are 1.69208% 18s, 36.33984% 19s, 48.32320% 20s and 13.64488% 21s. - Herbert Kociemba, Jul 15 2013

Examples

			In the first turn, 16 triangles are complete. In the 2nd turn, there are 36 triangles completely included. The difference is 20.
		

Crossrefs

Programs

  • Mathematica
    (* Obtain the sequence of A072895 and set it equal to lst. *); Differences[lst, 2] (* Robert G. Wilson v, Mar 31 2013 *)
  • Python
    # See A137515 for Python code, and then OooCalc for more.

Formula

The second forward difference of A072895. - Robert G. Wilson v, Mar 31 2013

A145461 Numbers that can be written with a single digit in base 10 as well as in some base b<10.

Original entry on oeis.org

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

Author

Sébastien Dumortier, Oct 10 2008

Keywords

Comments

If a number is written in base 10 with a digit x and in base b with a digit y, then (b-1)*x*10^n - 9*y*b^m + (9*y - (b-1)*x) = 0. Varying parameters b=2,3,...,9; x=1,2,...,9; and y=1,2,...,b-1 give a finite number of equations. It is easy to find all solutions (w.r.t. n and m) of each equation or establish that there are none. In particular, for b=7, x=9, y=5, the equation is 54*10^n - 45*7^m - 9 = 0 or 6*10^n - 5*7^m - 1 = 0 that does not have solutions since the left hand side is not 0 modulo 5. It proves completeness and finiteness. - Max Alekseyev, Nov 06 2008

Examples

			777[base 10]=3333[base 6]
		

Programs

  • Python
    from math import *
    i=1
    while i<(10**10-1)/9:
        i=10*i+1
        for m in range(1,10):
            q=i*m
            q2=q
            for b in range(2,10):
                restes=[]
                q=q2
                while q>0:
                    r=q%b
                    q=q//b
                    restes.append(r)
                if restes==[restes[0]]*len(restes):
                    print(q2,restes,"en base ",b)

A145004 Values of n at which the number of roots of the function x+n*cos(x) increases.

Original entry on oeis.org

0, 3, 7, 10, 13, 16, 19, 22, 26, 29, 32, 35, 38, 41, 44, 48, 51
Offset: 0

Author

Sébastien Dumortier, Sep 28 2008

Keywords

Examples

			For n=0..2, there is 1 root. For n=3..6, there are 3 roots. For n=7..9, there are 5 roots. etc... So first ranks are 0,3,7,10, ...
		

Crossrefs

A145491 In these bases, there exist numbers written with only one distinct digit whose translation in binary is also written with the same lonely digit.

Original entry on oeis.org

5, 6, 14, 30, 62, 90, 126, 254, 510, 1022, 2046, 4094, 8190
Offset: 1

Author

Sébastien Dumortier and Bastien Lapeyre, Oct 11 2008

Keywords

Comments

All terms are equal to 2^n-2, except 5 and 90.
In base 2^n-2, we need 2 digits when there are n digits in binary.
In base 5, we need 3 digits for 5 digits in binary.
In base 90, we need 3 digits for 13 digits in binary.

Examples

			In base 5 : 11111[2] = 111[5].
In base 90 : 1111111111111[2] = 111[90].
		

Programs

  • Python
    for b1 in range(2, 3):
       for b2 in range(b1+1, 10001):
           for m in range(2, 20):
               for n in range(2, m+1):
                   if (1-b1**m)*(1-b2)==(1-b1)*(1-b2**n):
                       print("b1, b2=", b1, b2, " m, n=", m, n)