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: Mike Sheppard

Mike Sheppard's wiki page.

Mike Sheppard has authored 10 sequences.

A382131 Complement of A381767.

Original entry on oeis.org

2, 3, 5, 15, 46, 136, 385, 1072, 2949, 8063, 21977, 59814, 162683, 442329, 1202507, 3268905, 8885983, 24154809, 65659808, 178482121, 485164996, 1318815514, 3584912605, 9744803182, 26489121842, 72004899025, 195729609091, 532048240238, 1446257063900, 3931334296724, 10686474581075
Offset: 1

Author

Mike Sheppard, Mar 16 2025

Keywords

Crossrefs

Cf. A381767.

Formula

a(n) ~ e^(n-1) (conjectured)
e^(n-1) - 2*n^2 < a(n) < e^(n-1). - Yifan Xie, May 20 2025

Extensions

More terms from David A. Corneth, May 20 2025

A381767 a(n) = ceiling(n^(n/(n-1))) with a(1)=1.

Original entry on oeis.org

1, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71
Offset: 1

Author

Mike Sheppard, Mar 06 2025

Keywords

Comments

a(n) is the smallest positive integer expressible as both the sum and product of the same set of n positive real numbers.
For a given n>1, the smallest possible sum (which is also the product) is achieved when all n real numbers are equal. Restricting to positive real numbers, let each number be c, then: n*c = c^n. Solving for c, we get: c=n^(1/(n-1)). Substituting this back into the sum (product) equation, n*c=c^n = n^(n/(n-1)). Thus, the smallest integer satisfying this condition is a(n) = ceiling(n^(n/(n-1))).
The growth of n^(n/(n-1)) means some integers are skipped in the sequence, see A382131 for those.

Examples

			For n=1 the equation 1*c=c^1 is true for all values of c. We define a(1)=1 as for any positive integer equal to or greater than 1 we have x=x (singular sum equals singular product).
For n=4, solving 4*c=c^4 with positive c yields c~1.5874, giving 4*c=c^4~6.3496. Any integer greater than 6.3496 allows for a multiset of n positive real numbers that sum to and multiply to that integer. Hence, the smallest integer satisfying the condition is a(4)=7.
A constructive procedure is to let {c1,c2} be two numbers such that c1 appears once and c2 appears (n-1) times, then c1+(n-1)*c2 = c1*c2^(n-1)=d can be solved numerically for {c1,c2} for a given {n,d}. Multiple real solutions appear.
a(4)=7
7 : {3.0373, 1.3209, 1.3209, 1.3209} or {0.788707, 2.07043, 2.07043, 2.07043}
100 : {96.9691, 1.01031, 1.01031, 1.01031} or {0.00270022, 33.3324, 33.3324, 33.3324}
		

Crossrefs

Cf. A382131 (complement).

Programs

  • Mathematica
    Prepend[Table[Ceiling[n^(n/(n - 1))], {n, 2, 100}], 1]
  • PARI
    a(n) = if (n==1, 1, ceil(n^(n/(n-1)))); \\ Michel Marcus, Apr 05 2025
  • Python
    from sympy import integer_nthroot
    def A381767(n): return (lambda x: x[0]+(not x[1]))(integer_nthroot(n**n,n-1)) if n>1 else 1 # Chai Wah Wu, Apr 01 2025
    

Formula

n^(n/(n-1)) = n + log(n) + O(log(n)^2)/n. - Yifan Xie, May 20 2025

A381737 Orders k of Hermite polynomials whose maximal coefficient in absolute value appears twice.

Original entry on oeis.org

8, 13, 34, 43, 76, 89, 134, 151, 208, 229, 298, 323, 404, 433, 526, 559, 664, 701, 818, 859, 988, 1033, 1174, 1223, 1376, 1429, 1594, 1651, 1828, 1889, 2078, 2143, 2344, 2413, 2626, 2699, 2924, 3001, 3238, 3319, 3568, 3653, 3914, 4003, 4276, 4369, 4654, 4751, 5048
Offset: 1

Author

Mike Sheppard, Mar 05 2025

Keywords

Examples

			H_8(x) = 1680 - 13440 x^2 + 13440 x^4 - 3584 x^6 + 256 x^8, maximum coefficient in absolute value is 13440, which appears twice. Hence 8 is a term.
H_6(x) = -120 + 720 x^2 - 480 x^4 + 64 x^6. Absolute maximum unique. Hence 6 is not a term.
		

Crossrefs

Programs

  • Mathematica
    Flatten@Position[Table[Count[#, Max@#] &@Abs@CoefficientList[HermiteH[n, x], x], {n, 1000}], 2]
  • PARI
    isok(k) = my(vp=apply(x->abs(x), Vec(polhermite(k))), m=vecmax(vp)); #select(x->(x==m), vp) == 2; \\ Michel Marcus, Mar 09 2025

Formula

Conjecture 1: a(n) = 2*n*(n + 2) + (n + 1)*(-1)^(n+1).
Conjecture 2: a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
Conjecture 3: G.f.: (8*x + 5*x^2 + 5*x^3 - x^4 - x^5) / ((1 - x)^3 * (1 + x)^2).
Terms < 20000 consistent with conjectures. - Jinyuan Wang, Mar 09 2025.

A381524 Smallest exponent of x of maximal coefficient (ignoring signs) in Hermite polynomial of order n.

Original entry on oeis.org

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

Author

Mike Sheppard, Feb 26 2025

Keywords

Comments

Exponent is unique except for order of n within A381737, whose maximum of absolute value of coefficients appear twice. For example, H_8(x) = 1680 - 13440 x^2 + 13440 x^4 - 3584 x^6 + 256 x^8, maximum coefficient in absolute value is 13440, which appears twice. For those values a(n) and a(n)+2 both are maximums, in absolute value.
Conjecture: Differences are either +1 or -1.

Examples

			For n = 5, H_5(x) = 32*x^5 - 160*x^3 + 120*x. The maximal coefficient (ignoring signs) is 160, occurring at x^3, hence a(5) = 3.
For n = 8, H_8(x) = 1680 - 13440 x^2 + 13440 x^4 - 3584 x^6 + 256 x^8. The maximal coefficient (ignoring signs) is 13440, occurring at both x^2 and x^4, the smallest exponent being 2, hence a(8) = 2.
		

Crossrefs

Cf. A277281 (maximal coefficient ignoring signs), A381737 (non-unique exponents).

Programs

  • Mathematica
    Table[(PositionLargest@Abs[CoefficientList[HermiteH[n, x], x]])[[1]] - 1, {n, 0, 100}]
  • PARI
    a(n) = my(p=polhermite(n), m=vecmax(apply(x->abs(x), Vec(p)))); for(i=0, poldegree(p), if (abs(polcoef(p, i)) == m, return(i))); \\ Michel Marcus, Feb 26 2025

A381423 Exponent of x of maximal coefficient in Hermite polynomial of order n.

Original entry on oeis.org

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

Author

Mike Sheppard, Feb 23 2025

Keywords

Comments

The exponent is always unique. The coefficients, in absolute value, follow a unimodal pattern, and their signs alternate. If the maximum absolute coefficient appears twice due to symmetry (e.g., H_8(x)), the terms will have opposite signs, ensuring a unique exponent for the maximum signed coefficient.
Conjecture: Differences are either 1 or -3; more specifically the patterns (1,1,1,-3) or (1,1,1,1,-3), with position of those patterns appearing at linearly and quadratically spaced intervals, respectively. Seems to grow O(n^(1/2))

Examples

			For n = 5, H_5(x) = 32*x^5 - 160*x^3 + 120*x. The maximal coefficient is 120 (we take signs into account, so -160 < 120), occurring at x^1, hence a(5) = 1.
		

Crossrefs

Cf. A277280 (maximal coefficient).

Programs

  • Mathematica
    Table[(PositionLargest@CoefficientList[HermiteH[n, x], x])[[1]] - 1, {n, 0, 100}]
  • PARI
    a(n) = my(p=polhermite(n), m=vecmax(Vec(p))); for(i=0, poldegree(p), if (polcoef(p, i) == m, return(i))); \\ Michel Marcus, Feb 23 2025

A381319 Order of linear recurrence with constant coefficients of solutions of k satisfying k^(n-1) == 1 (mod n^2) for a given n.

Original entry on oeis.org

2, 3, 2, 5, 2, 7, 2, 3, 2, 11, 2, 13, 2, 5, 2, 17, 2, 19, 2, 5, 2, 23, 2, 5, 2, 3, 4, 29, 2, 31, 2, 5, 2, 5, 2, 37, 2, 5, 2, 41, 2, 43, 2, 9, 2, 47, 2, 7, 2, 5, 4, 53, 2, 5, 2, 5, 2, 59, 2, 61, 2, 5, 2, 17, 6, 67, 2, 5, 4, 71, 2, 73, 2, 5, 4, 5, 2, 79, 2, 3, 2, 83, 2, 17, 2, 5, 2, 89
Offset: 2

Author

Mike Sheppard, Feb 20 2025

Keywords

Comments

For a given n, the solutions for k have the linear recurrence with constant coefficients k(m) = k(m-1) + k(m-(a(n)-1)) - k(m-a(n)), with order a(n). If a(n)=2 then the term k(m-1) appears twice and is k(m) = 2*k(m-1) - k(m-2).
Also, k(m) - k(m-(a(n)-1)) = n^2 = k(m-1) - k(m-a(n)), so all have nonhomogeneous linear recurrence of k(m) = k(m-(a(n)-1)) + n^2. Equivalently, k(m) = k(m-A063994(n)) + n^2, with order A063994(n). Thus, k(m) ~ (n^2 / A063994(n)) * m = (n^2 / (a(n)-1)) * m.

Examples

			For n=5 the congruence equation k^4 ==1 mod (5^2) has solutions of k (A056021) which satisfy k(m) = k(m-1) + k(m-4) - k(m-5), the order being 5, a(5)=5.
For n=9, k^8==1 mod (9^2) has solutions of k with recurrence k(m) = k(m-1) + k(m-2) - k(m-3), order 3, a(9)=3.
		

Crossrefs

Cf. A063994, A056020 (n=3), A056021 (n=5), A056022 (n=7), A056024 (n=11), A056025 (n=13), A056028 (n=19), A056031 (n=23), A056034 (n=29), A056035 (n=31).

Programs

  • Mathematica
    A381319[n_] := Times @@ GCD[FactorInteger[n][[All, 1]] - 1, n - 1] + 1;
    Array[A381319, 100, 2] (* Paolo Xausa, Mar 05 2025 *)

Formula

a(n) = 1 + A063994(n).
a(p) = p if p is prime.

A380175 Greedy sums of distinct squares.

Original entry on oeis.org

0, 1, 4, 5, 9, 10, 13, 14, 16, 17, 20, 21, 25, 26, 29, 30, 34, 35, 36, 37, 40, 41, 45, 46, 49, 50, 53, 54, 58, 59, 62, 63, 64, 65, 68, 69, 73, 74, 77, 78, 80, 81, 82, 85, 86, 90, 91, 94, 95, 97, 98, 100, 101, 104, 105, 109, 110, 113, 114, 116, 117, 120, 121, 122, 125, 126, 130
Offset: 1

Author

Mike Sheppard, Jan 14 2025

Keywords

Comments

Let n be a positive integer. Suppose that s1^2 is the largest square not exceeding n, that s2^2 is the largest square not exceeding n-s1^2, and so on, so that n=s1^2+s2^2+...+sr^2 for some r. Clearly the si are weakly decreasing, but if they are strictly decreasing, s1>s2>...>sr, then we say that n is a greedy sum of distinct squares.
The set of integers for which the summands are distinct does not have a natural density, but the counting function oscillates in a predictable way (see Montgomery link).

Examples

			21 is a term since greedily taking squares is 21 = 4^2 + 2^2 + 1^2 and all are distinct.
38 is not a term since greedily 38 = 6^2 + 1^2 + 1^2 and 1^2 has repeated (it can be distinct squares 38 = 5^2 + 3^2 + 2^2 but that's not the greedy sum).
		

Crossrefs

Cf. A003995 (if not taken greedily), A380177.

Programs

  • Maple
    filter:= proc(n) local s,x;
      s:= n; x:= floor(sqrt(s));
      do
        s:= s - x^2;
        if s >= x^2 then return false fi;
        if s = 0 then return true fi;
        x:= floor(sqrt(s))
      od;
    end proc:
    filter(0):= true:
    select(filter, [$0..1000]); # Robert Israel, Feb 14 2025
  • Mathematica
    Select[Range[0,200], DuplicateFreeQ[#] &@ Differences[NestWhileList[# - Floor[Sqrt[#]]^2 &, #, # > 0 &]] &]
  • Python
    from math import isqrt
    def ok(n):
        rprev = n+1
        while 0 < (r:=isqrt(n)) < rprev: n, rprev = n-r**2, r
        return r == 0
    print([k for k in range(131) if ok(k)]) # Michael S. Branicky, Jan 15 2025

A380177 Numbers that can be written as sum of distinct squares but not if the squares are taken greedily.

Original entry on oeis.org

38, 39, 42, 51, 52, 55, 56, 57, 61, 66, 70, 71, 75, 79, 83, 84, 87, 88, 89, 93, 99, 102, 103, 106, 107, 111, 115, 118, 119, 123, 124, 127, 129, 132, 133, 136, 139, 140, 143, 146, 147, 150, 151, 152, 155, 156, 159, 162, 163, 166, 167, 168, 171, 172, 175, 176, 177, 180
Offset: 1

Author

Mike Sheppard, Jan 14 2025

Keywords

Comments

Numbers in A003995 but not in A380175.

Examples

			38 is in the list as 38 = 5^2 + 3^2 + 2^2, all distinct; but if taken greedily 38 = 6^2 + 1^2 + 1^2, not distinct. Greedily in the sense that 6^2 < 38 < 7^2 etc.
		

Crossrefs

A380129 Strong Birthday Problem: Number of people needed so that probability of everyone sharing a birthday out of n possible days is at least 1/2.

Original entry on oeis.org

2, 4, 8, 12, 16, 21, 26, 31, 36, 41, 47, 52, 58, 64, 69, 75, 81, 87, 93, 100, 106, 112, 119, 125, 131, 138, 144, 151, 158, 164, 171, 178, 184, 191, 198, 205, 212, 219, 226, 233, 240, 247, 254, 261, 268, 275, 283, 290, 297, 304, 312, 319, 326, 334, 341, 348, 356
Offset: 1

Author

Mike Sheppard, Jan 13 2025

Keywords

Comments

The answer to the strong birthday problem is 3064, that is, a(365) = 3064. This is the number of people that need to be gathered together before there is a 50% chance that everyone in the gathering shares their birthday with at least one other person.

Crossrefs

Programs

  • Mathematica
    (* a(n)=m, n number of days, m number of people *)
    p[n_, m_] :=Sum[((-1)^i*n^(-m)*((-i + n)^((-i) + m))*n!*m!)/(i!*((-i + n)!)*((-i + m)!)), {i, 0, m}];
    a[n_] := Module[{m = n + 1, prob = 0}, While[prob < 0.5, prob = p[n, m]; m++;]; m - 1];
    Table[a[n], {n, 1, 20}]
  • PARI
    p(n,m) = sum(i=0, n, (-1)^i*(n-i)^(m-i)*binomial(n,i)*m!/(m-i)!)/n^m;
    a(n) = my(ma, mb=n+1, md); while(2*p(n,mb)<1, mb<<=1); ma=mb\2; while(mb>ma, md=(ma+mb)\2; if(2*p(n,md)<1, ma=md+1, mb=md)); ma; \\ Jinyuan Wang, Jan 24 2025
  • Python
    from math import comb, factorial
    def A380129(n):
        def p(m): return sum((-1 if i&1 else 1)*comb(m,i)*comb(n,i)*factorial(i)*(n-i)**(m-i) for i in range(m+1))<<1
        kmin, kmax = n, n+1
        while p(kmax) < n**kmax: kmax<<=1
        while kmax-kmin > 1:
            kmid = kmax+kmin>>1
            if p(kmid) >= n**kmid:
                kmax = kmid
            else:
                kmin = kmid
        return kmax # Chai Wah Wu, Jan 21 2025
    

Formula

a(n) ~ -n LambertW(-1, -Log(2)/n).

A052508 Smallest number such that the largest set of positive real numbers whose sum and product equals the number falls short by n.

Original entry on oeis.org

4, 5, 10, 26, 70, 188, 510, 1384, 3760, 10220, 27779, 75510, 205256, 557941, 1516639
Offset: 0

Author

Mike Sheppard (guinness42(AT)hotmail.com), Mar 17 2000

Keywords

Comments

Let s be the number of elements in the largest set of positive real numbers whose sum and products both equal x. Define m=x-s. a(n) is the smallest x such that m=n.
Limit_{n->oo} a(n+1)/a(n) = e.

References

  • Timothy M. Hsu, Private Communication.