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: Pablo Hueso Merino

Pablo Hueso Merino's wiki page.

Pablo Hueso Merino has authored 5 sequences.

A343515 a(n) is the number of real solutions to the equation sin(x) = x/n.

Original entry on oeis.org

1, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 11, 11, 11, 11, 11, 11, 15, 15, 15, 15, 15, 15, 19, 19, 19, 19, 19, 19, 23, 23, 23, 23, 23, 23, 23, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 35, 35, 35, 35, 35, 35, 35, 39, 39, 39, 39, 39, 39, 43, 43, 43, 43, 43
Offset: 1

Author

Pablo Hueso Merino, Apr 17 2021

Keywords

Comments

All terms are odd.
All terms are congruent to 3 modulo 4 after the first term. Proof: define sin(x)/x to be 1 at x = 0. If a(n) == 1 (mod 4), then the horizontal line y = 1/n is tangent to the curve y = sin(x)/x at (x_n, sin(x_n)/x_n) for some x_n >= 0. We have tan(x_n) = x_n and sin(x_n)/x_n = 1/n, so cos(x_n) = 1/n. By the Lindemann-Weierstrass theorem, we have either x_n = 0 or x_n must be transcendental (if x is a nonzero algebraic number, then exp(x) is transcendental). On the other hand, x_n = tan(x_n) = sqrt(n^2-1) is algebraic, so the only possibility is n = 1. - Jianing Song, Jul 13 2021

Examples

			a(3) = 3 because the equation sin(x) = x/3 has 3 real solutions: {-2.27886..., 0, 2.27886...}.
		

Programs

  • Mathematica
    Join[{1}, Table[CountRoots[n*Sin[x] - x, {x, -n, n}], {n, 2, 100}]] (* Vaclav Kotesovec, Jun 25 2021 *)

Formula

a(n) ~ 4*(floor((n-Pi/2)/(2*Pi))+1)-1.
For n > 1, a(n) = 4*(floor((n-Pi/2)/(2*Pi))+1)-1 + r(n), where r(n) is an error term defined as follows: let E be the system of equations given by cos(sqrt(n^2-1)) = 1/n and sin(sqrt(n^2-1)) = sqrt(n^2-1)/n; r(n) = 4 if the closest solution of E from the left to Pi/2 + 2*Pi*(floor((n-Pi/2)/2*Pi)+1) is smaller than n; r(n) = 0 otherwise.
From Jianing Song, Jul 13 2021: (Start)
Define x_k to be root of tan(x) = x in [k*Pi, (k+1)*Pi), k >= 0. For n > 1, if sec(x_(2*k)) < n < sec(x_(2*k+2)) (or equivalently, x_(2*k) < sqrt(n^2-1) < x_(2*k+2)), then a(n) = 4*k + 3.
For n >= 2, a(n+1) - a(n) is either 0 or 4. a(n+1) - a(n) = 4 if n is of the form floor(sec(x_(2*k))) = floor(sqrt((x_(2*k))^2+1)) for some k > 0. (End)

A339310 a(n) = a(n-1-a(n-1)) + a(n-a(n-2)) for n>2; starting with a(1) = a(2) = 1.

Original entry on oeis.org

1, 1, 2, 3, 3, 3, 5, 4, 6, 5, 6, 8, 8, 6, 9, 8, 8, 11, 11, 10, 10, 14, 12, 11, 16, 15, 12, 17, 14, 17, 16, 18, 14, 19, 19, 16, 21, 22, 19, 21, 25, 18, 22, 25, 23, 24, 25, 25, 23, 31, 28, 22, 33, 28, 29, 32, 28, 29, 30, 30, 33, 35, 29, 33, 32, 28, 41, 36, 35
Offset: 1

Author

Pablo Hueso Merino, Dec 02 2020

Keywords

Comments

{a(n)} is the Pinn F 1,0(n) sequence (see link section).

Examples

			a(3)=2 because a(3) = a(3-1-a(3-1))+a(3-a(3-2)) = a(2-1)+a(3-1) = 1+1 = 2.
		

Crossrefs

Programs

  • Mathematica
    a[1] = a[2] = 1; a[n_] := a[n] = a[n - 1 - a[n - 1]] + a[n - a[n - 2]]; Table[ a[n], {n, 1, 40}]
  • PARI
    lista(nn) = {my(va = vector(nn)); va[1] = 1; va[2] = 1; for (n=3, nn, va[n]=va[n-1-va[n-1]]+va[n-va[n-2]];); va;} \\ Michel Marcus, Dec 07 2020
  • Python
    a=[1,1]
    for n in range(100):
        i1=len(a)-1-a[len(a)-1]
        i2=len(a)-a[len(a)-2]
        if i1>=0 and i2>=0 :
            a.append(a[i1]+a[i2])
        else :
            print("Sequence dies. Contains ", n+2, " terms.")
            break
    print(a)
    

A331028 Partition the terms of the harmonic series into groups sequentially so that the sum of each group is equal to or minimally greater than 1; then a(n) is the number of terms in the n-th group.

Original entry on oeis.org

1, 3, 8, 22, 60, 163, 443, 1204, 3273, 8897, 24184, 65739, 178698, 485751, 1320408, 3589241, 9756569, 26521104, 72091835, 195965925, 532690613, 1448003214, 3936080824, 10699376979, 29083922018, 79058296722, 214902731368, 584166189564, 1587928337892, 4316436745787
Offset: 1

Keywords

Comments

a(n) is equal to A024581(n) through a(10), and grows very similarly for n > 10.
Let b(n) = Sum_{j=1..n} a(n); then for n >= 2 it appears that b(n) = round((b(n-1) + 1/2)*e). Cf. A331030. - Jon E. Schoenfield, Jan 14 2020

Examples

			a(1)=1 because 1 >= 1,
a(2)=3 because 1/2 + 1/3 + 1/4 = 1.0833... >= 1, etc.
		

Crossrefs

Some sequences in the same spirit as this: A002387, A004080, A055980, A115515.

Programs

  • PARI
    default(realprecision, 10^5); e=exp(1);
    lista(nn) = {my(r=1); print1(r); for(n=2, nn, print1(", ", -r+(r=floor(e*r+(e+1)/2+(e-1/e)/(24*(r+1/2)))))); } \\ Jinyuan Wang, Mar 31 2020
  • Python
    x = 0.0
    y = 0.0
    for i in range(1,100000000000000000000000):
      y += 1
      x = x + 1/i
      if x >= 1:
        print(y)
        y = 0
        x = 0
    

Formula

a(n) = min(p): Sum_{b=r+1..p+r} 1/b >= 1, r = Sum_{k=1..n-1} a(k), a(1) = 1.

Extensions

a(20)-a(21) from Giovanni Resta, Jan 14 2020
More terms from Jinyuan Wang, Mar 31 2020

A331030 Divide the terms of the harmonic series into groups sequentially so that the sum of each group is minimally greater than 1. a(n) is the number of terms in the n-th group.

Original entry on oeis.org

2, 5, 13, 36, 98, 266, 723, 1965, 5342, 14521, 39472, 107296, 291661, 792817, 2155100, 5858169, 15924154, 43286339, 117664468, 319845186, 869429357, 2363354022, 6424262292, 17462955450, 47469234471, 129034757473, 350752836478, 953445061679, 2591732385596
Offset: 1

Keywords

Comments

a(n) = A046171(n+1) through a(5), and grows similarly for n > 5.
Let b(n) = Sum_{j=1..n} a(n); then for n >= 2 it appears that b(n) = round((b(n-1) + 1/2)*e). Verified through n = 10000 (using the approximation Sum_{j=1..k} 1/j = log(k) + gamma + 1/(2*k) - 1/(12*k^2) + 1/(120*k^4) - 1/(252*k^6) + 1/(240*k^8) - ..., where gamma is the Euler-Mascheroni constant, A001620). Cf. A081881. - Jon E. Schoenfield, Jan 10 2020

Examples

			a(1)=2 because 1 + 1/2 = 1.5 > 1,
a(2)=5 because 1/3 + 1/4 + 1/5 + 1/6 + 1/7 = 1.0928... > 1,
etc.
		

Programs

  • PARI
    lista(lim=oo)={my(s=0, p=0); for(i=1, lim, s+=1/i; if(s>1, print1(i-p, ", "); s=0; p=i))} \\ Andrew Howroyd, Jan 08 2020
  • Python
    x = 0.0
    y = 0.0
    z = 0.0
    for i in range(1,100000000000000000000000):
      y += 1
      x = x + 1/i
      z = z + 1/i
      if x > 1:
        print(y)
        y = 0
        x = 0
    

Formula

a(1)=2, a(n) = (min(p) : Sum_{s=r..p} 1/s > 1)-r+1, r=Sum_{k=1..n-1} a(k).

Extensions

a(25)-a(29) from Jon E. Schoenfield, Jan 10 2020

A329547 Number of natural numbers k <= n such that k^k is a square.

Original entry on oeis.org

1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40
Offset: 1

Author

Pablo Hueso Merino, Nov 16 2019

Keywords

Comments

For even k, k^k is always a square. For odd k, k^k is a square if and only if k is a square.
It seems the unrepeated terms form A266304 \ {0}. - Ivan N. Ianakiev, Nov 21 2019
Indices of unrepeated terms are A081349. - Rémy Sigrist, Dec 07 2019

Examples

			a(5) = 3 because among 1^1, 2^2, ..., 5^5 there are 3 squares: 1^1, 2^2, and 4^4.
		

Crossrefs

Programs

  • Mathematica
    Table[Floor[n/2] + Ceiling[Floor[Sqrt[n]]/2], {n, 1, 100}]
  • PARI
    a(n) = sum(k=1, n, issquare(k^k)); \\ Michel Marcus, Nov 17 2019
    
  • PARI
    first(n) = my(res=vector(n), inc); res[1] = 1; for(i=2, n, inc = (1-(i%2)) || issquare(i); res[i] = res[i-1] + inc); res \\ David A. Corneth, Dec 07 2019
    
  • PARI
    a(n) = n\2 + (sqrtint(n)+1)\2 \\ David A. Corneth, Dec 07 2019
    
  • Python
    from math import isqrt
    def A329547(n): return (n>>1)+(isqrt(n)+1>>1) # Chai Wah Wu, Sep 18 2024

Formula

a(n) = floor(n/2) + ceiling(floor(sqrt(n))/2).