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: Daniel Mondot

Daniel Mondot's wiki page.

Daniel Mondot has authored 78 sequences. Here are the ten most recent ones:

A382632 Numbers k such that one can make an equilateral triangle from a chain of linked rods of length 1, 2, 3, ..., k, with perimeter equal to the total length.

Original entry on oeis.org

9, 90, 125, 153, 189, 440, 819, 989, 1295, 1394, 1484, 1701, 2079, 2448, 2925, 3024, 4004, 5453, 6174, 7865, 8910, 13509, 13689, 13923, 16235, 19683, 20294, 21824, 24804, 26649, 32760, 33488, 37169, 37925, 39024, 40733, 42704, 44225, 44289, 47915, 48734, 52325, 97335, 101870
Offset: 1

Author

Daniel Mondot, Apr 01 2025

Keywords

Comments

For all known terms (n<157), there is only one solution, except for 125 and 158949 which both have 2 solutions.
Conjecture: Out of some linked rods of length 1, 2...k, we can fold them in half (digon), or make equilateral triangles, but no other regular polygons (squares, regular pentagons, etc...) can be made.

Examples

			For k=9, the sides of the triangle are 15 in length: [4+5+6], [7+8] and [9+1+2+3]. Therefore 9 is in the sequence.
For k=90, the sides of the triangle are 1365 in length: [16+...+54], [55+...+75] and [76+...+90 + 1+...+15]. Therefore 90 is in the sequence.
The 2 solutions for 125 are:
    [3+4+...+71+72], [73+74+...+101+102] and [103+104+...+124+125 +1+2]
and [58+...+92], [93+...+117] and [118+...+125 + 1+...+58], all sides 2625 in length.
		

Crossrefs

A382605 Number of distinct solutions to the problem of folding in half a chain of linked rods of length 1, ..., n.

Original entry on oeis.org

0, 0, 1, 1, 0, 0, 1, 2, 0, 0, 1, 1, 0, 0, 2, 1, 0, 0, 1, 3, 0, 0, 1, 2, 0, 0, 3, 1, 0, 0, 1, 2, 0, 0, 4, 1, 0, 0, 4, 1, 0, 0, 1, 4, 0, 0, 1, 2, 0, 0, 3, 1, 0, 0, 3, 3, 0, 0, 1, 1, 0, 0, 2, 1, 0, 0, 1, 3, 0, 0, 1, 1, 0, 0, 4, 1, 0, 0, 1, 4, 0, 0, 1, 5, 0, 0, 3, 1, 0, 0, 1, 3, 0, 0, 2, 1, 0, 0, 6, 1
Offset: 1

Author

Daniel Mondot, Mar 31 2025

Keywords

Comments

In order to be able to fold such chain in half, the total length of the chain (A000217(n)) has to be even, which is true when n=3 (mod 4) or n=0 (mod 4).
Conjecture: Whenever the length of the chain is even, there is at least one solution. That makes A154708 the sequence that lists numbers k that have at least one solution.

Examples

			A chain of 7 rods of length 1 to 7, can be folded in half in only one way: 2+3+4+5 on one side, 6+7+1, on the other, both sides being 14 in total length. Therefore a(7) = 1.
		

Crossrefs

A382268 Numbers k such that a right triangle can be formed from a chain of linked rods of lengths 1, 2, 3, ..., k, with the perimeter equal to the total length.

Original entry on oeis.org

15, 20, 24, 35, 39, 44, 48, 55, 56, 63, 75, 76, 80, 84, 91, 95, 99, 104, 111, 119, 120, 132, 135, 140, 143, 144, 152, 155, 168, 175, 176, 187, 188, 195, 203, 207, 215, 216, 219, 224, 252, 259, 260, 264, 272, 275, 279, 287, 288, 296, 299, 308, 315, 320, 324, 335, 351, 360
Offset: 1

Author

Ali Sada and Daniel Mondot, Mar 19 2025

Keywords

Comments

The corresponding perimeters T(a(n)) must be in the intersection of T = A000217 (triangular numbers) with A010814 (perimeters of integer sided right triangles). A number k is in the sequence if there exists a solution {k1, k2, k3} with k > k1 > k2 > k3 >= 0 such that for a < b < c in { T(k1) - T(k2), T(k2) - T(k3), T(k) - T(k1) + T(k3) } one has a^2 + b^2 = c^2. - M. F. Hasler, Mar 20 2025

Examples

			The first triangle is when k = 15. The segments are [6+7+8+9+10] [11+12+13+14] [15+1+2+3+4+5]. The sums of the segments are (40, 50, 30), which is 10 times the primitive right triangle (3, 4, 5).
The second term, k = 20, corresponds to 5 distinct solutions:
  S1 = {18, 16, 9}: a = 9+...+1 + 20+19 = 84, b = 18+17 = 35, c = 16+...+10 = 91,
  S2 = {17, 11, 3}: a = 20+19+18 + 3+2+1 = 63, c = 17+...+12 = 87, b = 11+...+4 = 60,
  S3 = {17, 11, 2}: a = 20+19+18 + 2+1 = 60, c = 17+...+12 = 87, b = 11+...+3 = 63,
  S4 = {16, 9, 4}: a = 20+...+17 + 4+...+1 = 84, c = 16+...+10 = 91, b = 9+...+5 = 35,
  S5 = {15, 8, 1}: c = 20+...+16 + 1 = 91, a = 15+...+9 = 84, b = 8+...+2 = 35.
We note that S2 and S3, and S1, S4 and S5, have the same side lengths, but different decompositions.
		

Crossrefs

Programs

  • PARI
    select( {is_A382268(n)=my(Tn=n*(n+1)\2,T1,T2,S); Tn%2==0 && is_A005279(Tn\2) && forstep(n1=n-1,sqrtint(Tn-1)+1,-1, T1=n1*(n1+1)\2; forstep(n2=n1-1,sqrtint(2*T1-Tn-1)+1,-1, T2=n2*(n2+1)\2; forstep(n3=n2-1,0,-1, #(S=Set([Tn-T1+S=n3*(n3+1)\2,T2-S,T1-T2]))>2 && S[3]^2 == S[1]^2+S[2]^2 && return(S))))}, [1..100])\\ M. F. Hasler, Mar 22 2025

A381843 Decimal expansion of (40320*e^9 - 322560*e^8 + 987840*e^7 - 1451520*e^6 + 1050000*e^5 - 344064*e^4 + 40824*e^3 - 1024*e^2 + e) / 40320.

Original entry on oeis.org

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

Author

Daniel Mondot, Mar 12 2025

Keywords

Comments

Expected number of picks from a uniform [0,1] distribution needed to first exceed a sum of 9.

Examples

			18.66666666527032134895552...
		

References

  • J. V. Uspensky, Introduction to Mathematical Probability, New York: McGraw-Hill, 1937.

Programs

  • Mathematica
    RealDigits[E^9 - 8*E^8 + 49*E^7/2 - 36*E^6 + 625*E^5/24 - 128*E^4/15 + 81*E^3/80 - 8*E^2/315 + E/40320, 10, 120][[1]]
  • PARI
    exp(9)-8*exp(8)+49*exp(7)/2-36*exp(6)+625*exp(5)/24-128*exp(4)/15+81*exp(3)/80-8*exp(2)/315+exp(1)/40320

Formula

Equals Sum_{k=0..n} (-1)^k * (n-k+1)^k * exp(n-k+1) / k! for n = 8 (Uspensky, 1937, p. 278).

A382020 Decimal expansion of (5040*e^8 - 35280*e^7 + 90720*e^6 - 105000*e^5 + 53760*e^4 - 10206*e^3 + 448*e^2 - e) / 5040.

Original entry on oeis.org

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

Author

Daniel Mondot, Mar 12 2025

Keywords

Comments

Expected number of picks from a uniform [0,1] distribution needed to first exceed a sum of 8.

Examples

			16.6666666704268878236623470...
		

References

  • J. V. Uspensky, Introduction to Mathematical Probability, New York: McGraw-Hill, 1937.

Programs

  • Mathematica
    RealDigits[E^8 - 7*E^7 + 18*E^6 - 125*E^5/6 + 32*E^4/3 - 81*E^3/40 + 4*E^2/45 - E/5040, 10, 120][[1]]
  • PARI
    exp(8)-7*exp(7)+18*exp(6)-125*exp(5)/6+32*exp(4)/3-81*exp(3)/40+4*exp(2)/45-exp(1)/5040

Formula

Equals Sum_{k=0..n} (-1)^k * (n-k+1)^k * exp(n-k+1) / k! for n = 7 (Uspensky, 1937, p. 278).

A382026 Decimal expansion of (362880*e^10 - 3265920*e^9 + 11612160*e^8 - 20744640*e^7 + 19595520*e^6 - 9450000*e^5 + 2064384*e^4 - 157464*e^3 + 2304*e^2 - e) / 362880.

Original entry on oeis.org

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

Author

Daniel Mondot, Mar 12 2025

Keywords

Comments

Expected number of picks from a uniform [0,1] distribution needed to first exceed a sum of 10.

Examples

			20.666666666476318800614163...
		

References

  • J. V. Uspensky, Introduction to Mathematical Probability, New York: McGraw-Hill, 1937.

Programs

  • Mathematica
    RealDigits[E^10 - 9*E^9 + 32*E^8 - 343*E^7/6 + 54*E^6 - 625*E^5/24 + 256*E^4/45 - 243*E^3/560 + 2*E^2/315 - E/362880, 10, 120][[1]]
  • PARI
    exp(10)-9*exp(9)+32*exp(8)-343*exp(7)/6+54*exp(6)-625*exp(5)/24+256*exp(4)/45-243*exp(3)/560+2*exp(2)/315-exp(1)/362880

Formula

Equals Sum_{k=0..n} (-1)^k * (n-k+1)^k * exp(n-k+1) / k! for n = 9 (Uspensky, 1937, p. 278).

A381673 Decimal expansion of (720*e^7 - 4320*e^6 + 9000*e^5 - 7680*e^4 + 2430*e^3 - 192*e^2 + e) / 720.

Original entry on oeis.org

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

Author

Daniel Mondot, Mar 03 2025

Keywords

Comments

Expected number of picks from a uniform [0,1] needed to first exceed a sum of 7.

Examples

			14.6666667815221434498094600315049...
		

References

  • J. V. Uspensky, Introduction to Mathematical Probability, New York: McGraw-Hill, 1937.

Programs

  • Mathematica
    RealDigits[E^7 - 6*E^6 + 25*E^5/2 - 32*E^4/3 + 27*E^3/8 - 4*E^2/15 + E/720, 10, 120][[1]]
  • PARI
    exp(7)-6*exp(6)+25*exp(5)-32*exp(4)/3+27*exp(3)/8-4*exp(2)/15+exp(1)/720
    
  • PARI
    subst(Pol([1,-6,25/2,-32/3,27/8,-4/15,1/720,0]),x,exp(1)) \\ Charles R Greathouse IV, Aug 19 2025

Formula

Equals Sum_{k=0..n} (-1)^k * (n-k+1)^k * exp(n-k+1) / k! for n = 6 (Uspensky, 1937, p. 278).

A381266 a(n) = least positive integer m such that when m*(m+1) is written in base n, it contains every single digit exactly once, or 0 if no such number exists.

Original entry on oeis.org

1, 0, 12, 34, 134, 0, 1477, 6891, 38627, 0, 891230, 4874690, 28507439, 0, 1078575795, 7002987575, 46916000817, 0, 2295911609450, 16720559375850, 124852897365573, 0, 7468470450367652, 59705969514613035, 487357094495846175, 0, 34452261762372201726, 297930994005481958694
Offset: 2

Author

Daniel Mondot and Ali Sada, Feb 18 2025

Keywords

Comments

It appears that for each base of the form 4k+3, no number can be found that satisfies the requirement.
From Chai Wah Wu, Mar 13 2025: (Start)
The above observation is true.
Theorem: if n==3 (mod 4), then a(n) = 0.
Proof: Since n^a == 1 (mod n-1), k == the digit sum of k in base n (mod n-1). Thus for a number k with every digit exactly once, k == n(n-1)/2 (mod n-1).
Suppose n==3 (mod 4), i.e. n=2q+1 for some odd q. Then n(n-1)/2 = 2q^2+q. Since n-1 = 2q, this means that n(n-1)/2 == q (mod n-1). As q is odd, m(m+1) is even and n-1 is even, this implies that m(m+1) <> q (mod n-1) and thus m(m+1) is not a number with every digit exactly once and the proof is complete.
Conjecture: a(n) = 0 if and only if n==3 (mod 4).
(End)

Examples

			1477 is 2705 in octal. 2705 * 2706 = 10247536 (base 8)
38627 * 38628 = 1492083756 (base 10)
see a381266.txt for more
		

Crossrefs

Cf. A381248.

Programs

  • Python
    from itertools import count
    from math import isqrt
    from sympy.ntheory import digits
    def A381266(n):
        k, l, d = (n*(n-1)>>1)%(n-1), n**n-(n**n-n)//(n-1)**2, tuple(range(n))
        clist = [i for i in range(n-1) if i*(i+1)%(n-1)==k]
        if len(clist) == 0:
            return 0
        s = (n**n-n)//(n-1)**2+n**(n-2)*(n-1)-1
        s = isqrt((s<<2)+1)-1>>1
        s += n-1-s%(n-1)
        if s%(n-1) <= max(clist):
            s -= n-1
        for a in count(s,n-1):
            if a*(a+1)>l:
                break
            for c in clist:
                m = a+c
                if m*(m+1)>l:
                    break
                if tuple(sorted(digits(m*(m+1),n)[1:]))==d:
                    return m
        return 0 # Chai Wah Wu, Mar 17 2025

Formula

a(n) = 0 if n == 3 (mod 4). - Chai Wah Wu, Mar 13 2025

Extensions

a(19)-a(29) from Chai Wah Wu, Mar 12 2025

A379601 Decimal expansion of (120e^6 - 600e^5 + 960e^4 - 540e^3 + 80e^2 - e) / 120.

Original entry on oeis.org

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

Author

Daniel Mondot, Feb 27 2025

Keywords

Comments

Expected number of picks from a uniform [0,1] needed to first exceed a sum of 6.

Examples

			12.6666671413781214013719357626849111...
		

References

  • J. V. Uspensky, Introduction to Mathematical Probability, New York: McGraw-Hill, 1937.

Programs

  • Mathematica
    RealDigits[E^6 - 5*E^5 + 8*E^4 - 9*E^3/2 + 2*E^2/3 - E/120, 10, 120][[1]]
  • PARI
    exp(6)-5*exp(5)+8*exp(4)-9*exp(3)/2+2*exp(2)/3-exp(1)/120

Formula

Equals Sum_{k=0..n} (-1)^k * (n-k+1)^k * exp(n-k+1) / k! for n = 5 (Uspensky, 1937, p. 278).

A381769 a(n) is the area of the largest rectangle that can be formed from n sticks whose lengths are 1, 2, ..., n.

Original entry on oeis.org

0, 0, 0, 0, 3, 12, 25, 49, 81, 121, 182, 272, 380, 506, 676, 900, 1156, 1444, 1806, 2256, 2756, 3306, 3969, 4761, 5625, 6561, 7656, 8930, 10302, 11772, 13456, 15376, 17424, 19600, 22052, 24806, 27722, 30800, 34225, 38025, 42025, 46225, 50850, 55932, 61256, 66822, 72900, 79524, 86436, 93636
Offset: 0

Author

Ali Sada and Daniel Mondot, Mar 06 2025

Keywords

Comments

For k >= 0 and n = 8k, 8k+1, 8k+6, or 8k+7, a(n) is a square.
For k >= 1 and n = 8k+2, 8k+3, 8k+4, or 8k+5 , a(n) is a rectangular number of the form m*(m+1) for some m.
The cases not covered are n = 2, 3, 4, and 5.
For n >= 5 the solutions follow a predictable pattern.
For n >= 5 and (n≡0 mod 4 or n≡3 mod 4) all sticks contribute to the rectangle.
For n >= 5 and (n≡1 mod 4 or n≡2 mod 4) there is portion of length 1 that does not contribute to the rectangle, as in the example below.
Theorem 1: For n >= 13, a(n) = (floor(sqrt(a(n-8)))+2*n-7)*(ceiling(sqrt(a(n-8)))+2*n-7). For proof see link.
From M. F. Hasler, Mar 10 2025: (Start)
Theorem 2: Let n = 8k + r > 4 with k = round(n/8), and let L = k*(n + r + 1) = k*(8k + 2r + 1). Then
a(n) = L^2 if -3 < r < 2 or else L*(L+1) if r = 2 or -3, or else (L+1)*(L+2).
Proof: If n = 8k, we can form 4 sets of equal sum by adding the numbers from n down to 1 one after the other to one of the sets that has the lowest sum. For example, put 8 through 5 into sets A, B, C, D, then 4 through 1 must go into D, C, B and finally A. That way, after every 8 additions, the sum of the elements of each set will be the same. The average number added is (n+1)/2, and each set receives 2*k numbers, so the common sum is L = k*(n+1) = k*(8k + 1), and we can form a square of area a(n) = L^2.
Similarly, if n = 8k + r with r < 8, we proceed in the same way, starting with n and doing k iterations of 8 "additions", the last of which is r+1, when {1, ..., r} remain. Thus, so far, the average of the added numbers is (n + r+1)/2, and the common sum is now L = k*(n + r+1) = k*(8k + 2r+1).
If r = 1, then there remains only {1}. This "unit stick" can be added to any set but won't help for making a larger square, so still a(n) = L^2, with L = k*(8k + 3).
If r = 2, there remains {1, 2}. Adding these to two distinct sets allows to make a rectangle of area a(n) = L*(L+1) where now L = k*(n + 3) = k*(8k + 5).
The reasoning also applies for r = -1: For example, when n = 7, the sets will be {7}, {6, 1}, {5, 2}, {4, 3}. We can actually imagine a 0 added in the last step, to explain the average value (n+0)/2 of the 2k numbers that each set receives, for a common sum of L = k*n. The four sets of equal sum L correspond to a square of area a(n) = L^2, L = k*n = k*(8k - 1).
Now consider r = -2, for example n = 6: The sets will be {6}, {5}, {4, 1}, {3, 2} when nothing is left. We see that three sets again have the usual sum L = k*(n - 1) = k*(8k - 3), and one set has a sum of L+1, which doesn't help to make a larger area: again, a(n) = L^2 in this case.
For n = 8k - 3, two sets will still have the usual sum L = k*(n - 2) = k*(8k - 5), but two sets will have a sum of L+1 and L+2, respectively. (For n = 5, we get {5}, {4}, {3}, {2+1}.) So we can make a rectangle of area a(n) = L(L+1).
For n = 8k - 4, if we distribute all numbers, we have one set with the usual sum L = k*(n-3) = k*(8k-7), but the others have a sum of L+1, L+2 and L+3, respectively. For n = 4, we have {4}, {3}, {2}, {1}, and the best we can make is a rectangle of area a(4) = 1*3 = 3. But if k > 1, we can rearrange the terms to get a larger area: When only {4, 3, 2, 1} remain, we exchange 5 and 6 and add 4, 3, 2, 1 in turn to the set with smallest sum. For example, {12, 5}, {11, 6}, {10, 7}, {9, 8} becomes {12, 6, 1}, {11, 5, 4}, {10, 7, 3}, {9, 8, 2} with sums 19, 20, 20, 19. This way we get an area of a(n) = (L+1)(L+2) for all k > 1.
For n = 8k + 3, after k iterations, the sets have the sum L = k*(n + 4) = k*(8k + 7), and {1, 2, 3} remains. For example, when n = 11, L = 11+4 = 10+5 = 9+6 = 8+7 = 15. If we exchange again 5 and 6 and distribute 1, 2 and 3 to the sets with sums L and L-1, we get two sets with sum L+1 and two with sum L+2. Thus, a(n) = (L+1)(L+2).
(End)

Examples

			For n = 5, the five sticks can be arranged to form a 4 X 3 rectangle, so a(5) = 12. Clockwise from top, the sticks have lengths 5, 3, 4, 2 + 1.
 _ _ _ _ _
|       |
|       |
|_ _ _ _|
		

Programs

  • Mathematica
    a381769[n_] := Which[n < 4, 0, n == 4, 3, True, Module[{k = Quotient[n+4, 8], r}, k *= n + (r = n - 8*k) + 1; Which[-3 < r < 2, k^2, r == 2 || r == -3, k*(k+1), True, (k+1)*(k+2)]]];
    Array[a381769, 50, 0] (* Paolo Xausa, Jul 23 2025, after M. F. Hasler *)
  • PARI
    A381769(n)=if(n>4, my(k=n\/8, r=n-k*8); ((r<-3||r>2)*2+k*=n+1+r)*(k+(r>1 || r<-2)), n==4, 3)
    apply(A381769, [0..55]) \\ M. F. Hasler, Mar 10 2025
    
  • Python
    def A381769(n): k=(n+4)//8; r=n-k*8; k*=n+r+1; return(k if -44 else (n==4)*3 # M. F. Hasler, Mar 11 2025

Extensions

Edited by N. J. A. Sloane, Mar 10 2025