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: Joseph Wheat

Joseph Wheat's wiki page.

Joseph Wheat has authored 11 sequences. Here are the ten most recent ones:

A330285 The maximum number of arithmetic progressions in a sequence of length n.

Original entry on oeis.org

0, 0, 1, 3, 7, 12, 20, 29, 41, 55, 72, 90, 113, 137, 164, 194, 228, 263, 303, 344, 390, 439, 491, 544, 604, 666, 731, 799, 872, 946, 1027, 1109, 1196, 1286, 1379, 1475, 1579, 1684, 1792, 1903, 2021, 2140, 2266, 2393, 2525, 2662, 2802, 2943, 3093, 3245, 3402, 3562, 3727
Offset: 1

Author

Joseph Wheat, Dec 21 2019

Keywords

Comments

The partial arithmetic density D_n(A) up to n is merely the number of arithmetic progressions, A(s(n)), divided by the total number of nonempty subsets of {s(1), s(2), ..., s(n)}, i.e., A(s(n))/(2^n - 1). As n approaches infinity, D_n(A) converges to zero. Furthermore, the infinite sum of the partial densities for any sequence always converges to the total density D(A). Every infinite arithmetic progression has the same total density, Sum_{n >= 1} a(n)/(2^n - 1) = alpha ~ 1.25568880818612911696845537; sequences with a finite number of progressions have D(A) < alpha; and sequences without any arithmetic progressions have D(A) = 0.

Crossrefs

Partial sums of A002541.

Programs

  • PARI
    a(n) = sum(i=1, n, sum(j=1, i, floor((i - 1)/(j + 1))))

Formula

a(n) = Sum_{i=1..n} Sum_{j=1..i} floor((i - 1)/(j + 1)).

A316261 The number of ways to induce a single pinch on a compact 2-manifold with n handles. (Note: The manifold is embedded in Euclidean 2-space, and each pinch partitions it into at most two submanifolds.)

Original entry on oeis.org

1, 3, 9, 15, 26, 37, 55, 73, 100, 127, 165, 203, 254, 305, 371, 437, 520, 603, 705, 807, 930, 1053, 1199, 1345, 1516, 1687, 1885, 2083, 2310, 2537, 2795, 3053, 3344, 3635, 3961, 4287, 4650, 5013, 5415, 5817, 6260
Offset: 0

Author

Joseph Wheat, Jun 27 2018

Keywords

Comments

The formula for this sequence can be derived by separating the conformed manifolds into three sets. The first set consists of those conformations where the handles of the manifold are pinched at the boundary, the second set have two or more handles pinched at the interior of the manifold, and the third set are pinched at the boundary and may or may not have handles drawn into this pinch. The order of the first set is n, the order of the second is n - 1, and the order of the third set is given by the following series: (Sum_{k mod 2 = 0..n} (k/2)*(n - k + 1) + (2*(n - k) + (-1)^(n - k) + 3)/4) + (Sum_{j mod 2 = 1..n} ((j + 1)/2)*(n - j + 1)). These can then be combined into a single expression, Sum_{i = 0..n} ((2*i + (-1)^(i + 1) + 1)/4)*(n - i + 1) + ((2*(n - i) + (-1)^(n - i) + 3)/4)*(((-1)^i + 1)/2). The i in this series can be thought of as the number of handles drawn into the central pinch. If one factors out the expressions in the series and simplifies each term individually, the resulting functions can then be combined into a single formula. However, when we add 2n - 1 to this we find that for n = 0 the formula also equals zero. This cannot be, because there is one way to pinch a compact 2-manifold with 0 handles. Therefore, ((-1)^(2^n - 1) + 1)/2 is added as a corrective term for this one case.

Examples

			For a visual example see links.
		

References

  • Jonathan L. Gross, Jay Yellen, and Ping Zhang, The Handbook of Graph Theory (Second Edition), CRC Press, 2013, pp. 730-806.
  • Ana Claudia Nabarro, Juan J. Nuño-Ballesteros, Raúl Oset Sinha, Maria Aparecida Soares Ruas, Contemporary Mathematics: Real and Complex Singularities, American Mathematical Soc., 2014, pp. 50-51.

Crossrefs

Cf. A087811.

Programs

  • Mathematica
    a[n_] := (2 n^3 + 12 n^2 + 73 n + 3 (n + 2)*(-1)^n - 6)/24 + ((-1)^(2^n - 1) + 1)/2; Array[a, 50, 0] (* or *)
    CoefficientList[ Series[(x^6 + x^5 - 2x^4 - 2x^3 + 2x^2 + x + 1)/((x - 1)^4 (x + 1)^2), {x, 0, 50}], x] (* Robert G. Wilson v, Jul 23 2018 *)
  • PARI
    Vec((1 + x + 2*x^2 - 2*x^3 - 2*x^4 + x^5 + x^6) / ((1 - x)^4*(1 + x)^2) + O(x^50)) \\ Colin Barker, Jul 05 2018

Formula

a(n) = (2*n^3 + 12*n^2 + 73*n + 3*(n + 2)*(-1)^n - 6)/24 + ((-1)^(2^n - 1) + 1)/2.
From Colin Barker, Jul 05 2018: (Start)
G.f.: (1 + x + 2*x^2 - 2*x^3 - 2*x^4 + x^5 + x^6) / ((1 - x)^4*(1 + x)^2).
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n>6.
(End)

A299404 a(n) = 1 + Sum_{m >= 1} (m + 1)^n/2^(m - 1).

Original entry on oeis.org

3, 7, 23, 103, 599, 4327, 37463, 378343, 4366679, 56698087, 817980503, 12981060583, 224732540759, 4214866787047, 85130743763543, 1842265527822823, 42525237455850839, 1042966136233087207, 27084277306054762583, 742412698554627289063, 21421502369955073624919
Offset: 0

Author

Joseph Wheat, Feb 20 2018

Keywords

Crossrefs

Programs

  • Mathematica
    Table[1 + LerchPhi[1/2, -n, 2], {n, 0, 20}] (* Vaclav Kotesovec, Apr 17 2018 *)
  • PARI
    a(n) = 1+ round(suminf(m=1, (m + 1)^n/2^(m - 1)));

Formula

a(n + 1) = 4*A162509(n + 1) + a(n).
a(n) = 2*A007047(n) + 1.
{a(4n - 3), a(4n - 2), a(4n - 1), a(4n)} mod 10 = {7, 3, 3, 9} for n > 0.
floor(log_2(a(n))) = A083652(n).
Lim_{n->infinity} (a(n)^(1/n))/n = 1/(e*log(2)). - Jon E. Schoenfield, Feb 24 2018
a(n)/n! ~ 4 / (log(2))^(n+1). - Vaclav Kotesovec, Apr 17 2018

A296515 Number of edges in a maximal planar graph with n vertices.

Original entry on oeis.org

0, 0, 1, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, 135, 138, 141, 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 174
Offset: 0

Author

Keywords

Comments

{a(n)} is a monotonic increasing sequence because a maximal planar graph of order n can be generated on n + 1 nodes. Therefore a(n) <= a(n + 1).
Maximal planar graphs of order n > 5 are not unique.
|E(G_2n)| = (2n - 1) + 2*Sum_{k=0..(floor(log_2(n - 1)))} floor((n - 1)/2^k) where |E(G_2n)| is the size of a minimal planar graph G of order 2n.
Number of edges of a maximal 3-degenerate graph of order n (this class includes 3-trees). The intersection of this class and maximal planar graphs is the Apollonian networks (planar 3-trees); neither class contains the other. - Allan Bickle, Nov 14 2021
a(n) is the number of blocks to dig (in a staircase fashion) to get out of a hole of depth n in Minecraft. - Max R Anderson, Oct 19 2023

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(x^2 (1 + x + x^2))/(x - 1)^2, {x, 0, 60}], x] (* or *) LinearRecurrence[{2, -1}, {0, 0, 1, 3}, 60] (* Robert G. Wilson v, Mar 04 2018 *)

Formula

a(n) = floor(6/2^n) + 3n - 6 (see comments section of A008486).
G.f.: x^2 + 3*x^3/(x - 1)^2. - R. J. Mathar, Apr 14 2018
E.g.f.: 6 + x*(x + 6)/2 + 3*exp(x)*(x - 2). - Stefano Spezia, Feb 13 2023
a(n) = 3*(n - 2) for n >= 3. - Max R Anderson, Oct 19 2023

A290474 Number of fractional partitions of n where each element of a partition is a rational number r/s such that r < s, s <= n, and gcd(r,s) = 1.

Original entry on oeis.org

1, 0, 1, 12, 135, 4477, 100160, 8663934, 485380025, 80730951180, 10180011676356, 4126137351376215, 563950787766342780, 456369006693283278869, 200330760220853808357439, 335435016971402890883460861, 197675615401466868237710861644, 561969529551274362018496511765678
Offset: 0

Author

Joseph Wheat, Aug 03 2017

Keywords

Comments

a(n) = (n^2 + 1)^(-1 + Sum_{k=1..n} phi(k)) - f(n) where phi(n) is Euler's totient function, and f(n) is the number of trivial solutions which do not satisfy the equation q_1*x_1 + q_2*x_2 + ... + q_m*x_m = n. Each coefficient is a rational number satisfying the criteria given in the definition, and m = -1 + Sum_{k=1..n} phi(k).

Examples

			For n=3, the number of partitions is equal to the number of nonnegative integer solutions for the equation: (1/2)*x_1 + (1/3)*x_2 + (2/3)*x_3 = 3. The set S of solutions is {[0,1,4], [0,3,3], [0,5,2], [0,7,1], [0,9,0], [2,0,3], [2,2,2], [2,4,1], [2,6,0], [4,1,1], [4,3,0], [6,0,0]}. Therefore, |S| = a(3) = 12.
		

Crossrefs

Programs

  • PARI
    s(v, n, t) = {if(t==#v, f = n\v[t]; v[t]*f == n, sum(i=0, n\v[t], s(v, n-v[t]*i, t+1)))}
    a(n) = {if(n<=2, return(n-1)); my(fractions = List(), q = 0); for(i=2, n, for(j=1, i-1, if(gcd(i, j)==1, listput(fractions, j/i)))); s(fractions, n, 1)} \\ David A. Corneth, Aug 03 2017

Extensions

a(7)-a(17) from Alois P. Heinz, Aug 03 2017

A290025 The partial sums of 2^d(n) where d(n) is the n-th digit of the concatenated triangular numbers, and d(1)=0.

Original entry on oeis.org

1, 3, 11, 75, 77, 78, 80, 112, 116, 118, 122, 378, 386, 450, 466, 498, 530, 562, 626, 690, 818, 1074, 1586, 1588, 1590, 1591, 1623, 1625, 1629, 1630, 1632, 1640, 1704, 1706, 1738, 1746, 1748, 1876, 1878, 1880, 2392, 2393, 2397, 2399, 2400, 2404, 2412, 2414, 2418, 2450
Offset: 1

Author

Joseph Wheat, Jul 17 2017

Keywords

Comments

The differences between consecutive terms are <= 2^9. So the sequence contains arbitrarily long arithmetic progressions. The sequence of powers of 2 does not contain progressions, however. This is a result of the fact that 2^n satisfies the recurrence relation a(n+1)=2a(n).

Examples

			2^d(1) + 2^d(2) + 2^d(3) = 2^0 + 2^1 + 2^3 = 11.
		

Crossrefs

Programs

  • Mathematica
    Accumulate[2^Flatten@ Map[IntegerDigits, Array[# (# + 1)/2 &, 23, 0]]] (* Michael De Vlieger, Aug 03 2017 *)
  • PARI
    lista(nn) = {print1(cur=1, ", "); for(n=1, nn, d = digits(n*(n+1)/2); for(i=1, #d, cur += 2^d[i]; print1(cur, ", ");););} \\ Michel Marcus, Jul 21 2017
    
  • PARI
    first(n) = {my(d = [0], i = 1, t = 2, res = vector(n)); res[1] = 1; while(#d < n, d = concat(d, digits(i)); i+=t; t++); for(i=2, n, res[i] = res[i-1] + 2^d[i]); res} \\ David A. Corneth, Aug 03 2017

Formula

a(n) = Sum_{k=1..n} 2^d(k) where d(k) = A034004(k).

Extensions

More terms from Michel Marcus, Jul 21 2017

A289898 a(n) = floor((2^prime(n+1))/Sum_{k=0|n,2^prime(k)}).

Original entry on oeis.org

2, 2, 2, 11, 3, 12, 3, 12, 59, 3, 51, 15, 3, 12, 59, 62, 3, 51, 15, 3, 50, 15, 60, 251, 15, 3, 12, 3, 12, 15179, 15, 60, 3, 816, 3, 51, 62, 15, 60, 62, 3, 816, 3, 12, 3, 3226, 4094, 15, 3, 12, 59, 3, 816, 63, 63, 63, 3, 51, 15, 3, 808, 16363, 15, 3, 12, 15183
Offset: 1

Author

Joseph Wheat, Jul 14 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Floor[2^Prime[n + 1]/Sum[ 2^Prime[k], {k, n}]], {n, 66}] (* Michael De Vlieger, Jul 16 2017 *)
  • PARI
    a(n) = 2^prime(n+1)\sum(k=1, n, 2^prime(k)); \\ Michel Marcus, Jul 16 2017

Formula

a(n) = floor(2^prime(n+1)/(Sum_{k=1..n} 2^prime(k))).

A289836 Numbers k such that floor(e*k + Pi) is a square.

Original entry on oeis.org

5, 17, 29, 36, 52, 71, 132, 146, 177, 211, 229, 330, 648, 744, 956, 1112, 1368, 1413, 1459, 1506, 1700, 1906, 2124, 2295, 2657, 2720, 2848, 2913, 2979, 3181, 3319, 3532, 3678, 3902, 3978, 4055, 4211, 4290, 4780, 5035
Offset: 1

Author

Joseph Wheat, Jul 13 2017

Keywords

Programs

  • Mathematica
    Select[Range@ 5040, IntegerQ@ Sqrt@ Floor[# E + Pi] &] (* Michael De Vlieger, Jul 14 2017 *)
  • PARI
    is(n)=issquare(floor(exp(1)*n+Pi)) \\ Charles R Greathouse IV, Jul 14 2017
    
  • Python
    from gmpy2 import is_square
    from mpmath import *
    mp.dps=100
    def ok(n): return is_square(int(nint(floor(exp(1)*n + pi))))
    print([n for n in range(1, 6001) if ok(n)]) # Indranil Ghosh, Jul 15 2017

Extensions

More terms from Charles R Greathouse IV, Jul 14 2017

A289830 a(n) satisfies the equation n/(n-1) + a(n)/n! = H(n), where H(n) is the n-th harmonic number.

Original entry on oeis.org

-1, 2, 18, 124, 900, 7188, 63504, 618336, 6596640, 76635360, 963895680, 13056819840, 189581333760, 2938083321600, 48416639846400, 845487698227200, 15598004134809600, 303161985274982400, 6191998554470400000, 132599321499875328000, 2970952207377960960000
Offset: 2

Author

Joseph Wheat, Jul 12 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[n!*(HarmonicNumber[n] - n/(n - 1)), {n, 2, 22}] (* Michael De Vlieger, Jul 13 2017 *)
  • Python
    from sympy import factorial, harmonic
    def a(n): return factorial(n-2)*(harmonic(n)*(n-1) - n)*n
    print([a(n) for n in range(2, 26)]) # Indranil Ghosh, Jul 14 2017

Formula

a(n) = n! * (H(n) - n/(n-1)). - Alois P. Heinz, Jul 13 2017

Extensions

More terms from Alois P. Heinz, Jul 13 2017

A289829 Perfect squares of the form prime(k+1)^2 - prime(k)^2 + 1 where prime(k) is the k-th prime number.

Original entry on oeis.org

25, 49, 121, 169, 289, 361, 841, 961, 1681, 1849, 2401, 2809, 3721, 5929, 6889, 7921, 8281, 10201, 11449, 11881, 14161, 14641, 17689, 24649, 26569, 32041, 38809, 41209, 43681, 44521, 61009, 63001, 69169, 76729, 80089, 85849, 89401, 94249, 96721, 97969, 108241
Offset: 1

Author

Joseph Wheat, Jul 12 2017

Keywords

Examples

			7^2 - 5^2 + 1 = 5^2, 17^2 - 13^2 + 1 = 11^2, 47^2 - 43^2 + 1 = 19^2, etc.
		

Programs

  • Mathematica
    TakeWhile[#, # < 110000 &] &@ Union@ Select[Array[Prime[# + 1]^2 - Prime[#]^2 + 1 &, 10^4], IntegerQ@ Sqrt@ # &] (* Michael De Vlieger, Jul 13 2017 *)
    Take[Select[#[[2]]-#[[1]]+1&/@Partition[Prime[Range[3000]]^2,2,1],IntegerQ[Sqrt[#]]&]//Union,50] (* Harvey P. Dale, Jan 19 2025 *)
  • PARI
    is(n) = if(!issquare(n), return(0), my(p=2); while(1, if(n==nextprime(p+1)^2-p^2+1, return(1)); p=nextprime(p+1); if(p > n, return(0)))) \\ Felix Fröhlich, Jul 15 2017
  • Python
    from _future_ import division
    from sympy import divisors, isprime, prevprime, nextprime
    A289829_list = []
    for n in range(10**4):
        m = n**2-1
        for d in divisors(m):
            if d*d >= m:
                break
            r = m//d
            if not r % 2:
                r = r//2
                if not isprime(r):
                    p, q = prevprime(r), nextprime(r)
                    if m == (q-p)*(q+p):
                        A289829_list.append(n**2)
                        break # Chai Wah Wu, Jul 15 2017
    

Extensions

More terms from Alois P. Heinz, Jul 13 2017