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.

Previous Showing 31-40 of 80 results. Next

A175577 Decimal expansion of the sum of the reciprocals of the octahedral numbers (A005900).

Original entry on oeis.org

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

Views

Author

R. J. Mathar, Jul 15 2010

Keywords

Comments

Defined by Sum_{n>=1} 1/A005900(n) = 1/1 + 1/6 + 1/19 + 1/44 + ...
Equals 3*(gamma + Re psi(i/sqrt 2) ) = 3* Re(A001620 + psi(i*A010503)) where psi(i*A010503) = -0.1511539... + i*2.3152942... is a digamma function and i the imaginary unit.

Examples

			1.2781851590909461795403909483...
		

Crossrefs

Cf. A005900 (octahedral numbers).
Cf. sums of inverses: A152623 (tetrahedral numbers), A002117 (cubes), A295421 (dodecahedral numbers), A175578 (icosahedral numbers).

Programs

  • Maple
    Digits := 120 : 3*(gamma+Psi(I/sqrt(2))); evalf(Re(%)) ;
  • Mathematica
    RealDigits[ 3/2*(2*EulerGamma + Re[PolyGamma[0, 1 - I/Sqrt[2]] + PolyGamma[0, 1 + I/Sqrt[2]]]), 10, 105] // First (* Jean-François Alcover, Feb 11 2013 *)
  • PARI
    3*Euler+3*real(psi(I/sqrt(2))) \\ Charles R Greathouse IV, Jul 19 2013
    
  • PARI
    sumnumrat(3/n/(2*n^2 + 1),1) \\ Charles R Greathouse IV, Feb 08 2023

A228497 Decimal expansion of the fourth root of 1/2.

Original entry on oeis.org

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

Views

Author

R. J. Mathar, Aug 23 2013

Keywords

Comments

Height of a equilateral square antiprism of edge length 1. - R. J. Mathar, Mar 06 2025

Examples

			0.8408964152537145430311254762...
		

Crossrefs

Programs

Formula

One divided by A010767.
Square root of A010503.
Equals Product_{k>=1} (1 + (-1)^k/(4*k+1)). - Amiram Eldar, Aug 10 2020

A232735 Decimal expansion of the real part of I^(1/7), or cos(Pi/14).

Original entry on oeis.org

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

Views

Author

Stanislav Sykora, Nov 29 2013

Keywords

Comments

The corresponding imaginary part is in A232736.
Root of the equation -7 + 56*x^2 - 112*x^4 + 64*x^6 = 0. - Vaclav Kotesovec, Apr 04 2021

Examples

			0.974927912181823607018131682993931217232785800619997437648...
		

Crossrefs

Cf. A232736 (imaginary part), A010503 (real(I^(1/2))), A010527 (real(I^(1/3))), A144981 (real(I^(1/4))), A019881 (real(I^(1/5))), A019884 (real(I^(1/6))), A232737 (real(I^(1/8))), A019889 (real(I^(1/9))), A019890 (real(I^(1/10))).

Programs

  • Magma
    R:= RealField(100); Cos(Pi(R)/14); // G. C. Greubel, Sep 19 2022
    
  • Mathematica
    RealDigits[Cos[Pi/14],10,120][[1]] (* Harvey P. Dale, Dec 15 2018 *)
  • SageMath
    numerical_approx(cos(pi/14), digits=120) # G. C. Greubel, Sep 19 2022

Formula

2*this^2 -1 = A073052. - R. J. Mathar, Aug 29 2025
Equals 2F1(-1/14,1/14;1/2;1) . - R. J. Mathar, Aug 31 2025

A232738 Decimal expansion of the imaginary part of I^(1/8), or sin(Pi/16).

Original entry on oeis.org

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

Views

Author

Stanislav Sykora, Nov 29 2013

Keywords

Comments

The corresponding real part is in A232737.

Examples

			0.195090322016128267848284868477022240927691617751954807754502...
		

Crossrefs

Cf. A232737 (real part), A010503 (imag(I^(1/2))), A182168 (imag(I^(1/4))), A019827 (imag(I^(1/5))), A019824 (imag(I^(1/6))), A232736 (imag(I^(1/7))), A019819 (imag(I^(1/9))), A019818 (imag(I^(1/10))).

Programs

Formula

Equals (1/2) * sqrt(2-sqrt(2+sqrt(2))). - Seiichi Manyama, Apr 04 2021
This^2 + A232737^2 = 1.
Smallest positive of the 8 real-valued roots of 128*x^8-256*x^6+160*x^4-32*x^2+1=0.
Equals A182168/(2*A232737). - R. J. Mathar, Sep 05 2025

A229118 Distance from the n-th triangular number to the nearest square.

Original entry on oeis.org

0, 1, 2, 1, 1, 4, 3, 0, 4, 6, 2, 3, 9, 5, 1, 8, 9, 2, 6, 14, 6, 3, 13, 11, 1, 10, 17, 6, 6, 19, 12, 1, 15, 19, 5, 10, 26, 12, 4, 21, 20, 3, 15, 29, 11, 8, 28, 20, 0, 21, 30, 9, 13, 36, 19, 4, 28, 30, 6, 19, 42, 17, 9, 36, 29, 2, 26, 42, 14, 15, 45, 27, 3, 34, 41, 10, 22, 55, 24, 9, 43, 39, 5, 30, 55, 20, 16, 53, 36, 1
Offset: 1

Views

Author

Ralf Stephan, Sep 14 2013

Keywords

Comments

The maximum of a(n)/n appears to converge to sqrt(2)/2 (A010503), i.e. n*(n+1)/2 seems not more than n*sqrt(2)/2 distant from a square.
Some values don't seem to be in the sequence (checked up to n=10^7): 7,18,23,31,37,38...
Those values k are not in the sequence because the Pell-type equations x^2 - 8*y^2 = 8*k+1 and x^2 - 8*y^2 = -8*k+1 have no solutions. - Robert Israel, Apr 08 2019
a(A001108(n)) = 0, a(A229131(n)) = 1, a(A229083(n)) <= 1, a(A229133(n)) is square.

Crossrefs

Programs

  • Mathematica
    dns[n_]:=Module[{a=Floor[Sqrt[n]]^2,b=Ceiling[Sqrt[n]]^2},Min[n-a, b-n]]; dns/@Accumulate[Range[90]] (* Harvey P. Dale, Nov 07 2016 *)
  • PARI
    m=0;for(n=1, 100, t=n*(n+1)/2;s=sqrtint(t);d=min(t-s^2,(s+1)^2-t);print1(d, ","))

A229962 Decimal expansion of 149896229*sqrt(2).

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Nov 10 2013

Keywords

Comments

Also decimal expansion of the speed b = c/sqrt(2) in SI units (meter/second), where c = 299792458 (m/s) is the speed of light in vacuum (A003678).
A particle (or object) with speed b has the property that its relativistic momentum equals the momentum of a virtual photon whose energy equals the rest energy of the particle. Also its relativistic de Broglie wavelength equals the Compton wavelength for the particle and therefore equals the wavelength of the photon mentioned above.
More generally it appears that the speed b is a critical speed for several relativistic magnitudes of the particle. Explanation: consider a table of relativistic magnitudes in which every formula is written as the product of a dimensionless factor and a constant with the same dimensions as the relativistic magnitude. For instance, for the relativistic momentum we write the formula p = [1/(c^2/v^2 - 1)^(1/2)]*m_0*c instead of the standard formula p = [1/(1 - v^2/c^2)^(1/2)]*m_0*v. See below:
Table 1.
----------------------------------------------------
Relativistic
magnitude Formula
----------------------------------------------------
Speed.........: v = [v/c]*c
Group velocity: g = [v/c]*c
Length........: L = [1/γ]*L_0
Momentum......: p = [1/(c^2/v^2 - 1)^(1/2)]*m_0*c
Wavenumber....: k = [1/(c^2/v^2 - 1)^(1/2)]*m_0*c/h
Wavelength....: W = [(c^2/v^2 - 1)^(1/2)]*h/(m_0*c)
Time interval.: t = γ*t_0
Mass..........: m = γ*m_0
Energy........: E = γ*m_0*c^2
Frequency.....: f = γ*m_0*c^2/h
Phase velocity: w = [c/v]*c
Kinetic energy: K = [γ - 1]*m_0*c^2
----------------------------------------------------
Where:
v is the speed of the object or particle.
c is the speed of light in vacuum (A003678).
h is the Planck constant (A003676).
L_0 is the length at rest of the object or the length at rest of a virtual cube which contains the particle.
m_0 is the mass at rest (for the electron see A081801, for the proton see A070059).
t_0 is the time interval at rest.
W is the relativistic de Broglie wavelength assuming that W = h/p.
γ = [1/(1 - v^2/c^2)^(1/2)] is the Lorentz factor.
Then table 1 can be unified as shown below:
Table 2. Table 3.
------------------------------------ -----------------
Relativistic
magnitude Formula Formula
------------------------------------ -----------------
Speed.........: v = sin(x) * c v = sin(x) * v’
Group velocity: g = sin(x) * c g = sin(x) * g’
Length........: L = cos(x) * L_0 L = cos(x) * L’
Momentum......: p = tan(x) * m_0*c p = tan(x) * p’
Wavenumber....: k = tan(x) * 1/W_C k = tan(x) * k’
Wavelength....: W = cot(x) * W_C W = cot(x) * W’
Time interval.: t = sec(x) * t_0 t = sec(x) * t’
Mass..........: m = sec(x) * m_0 m = sec(x) * m’
Energy........: E = sec(x) * E_0 E = sec(x) * E’
Frequency.....: f = sec(x) * E_0/h f = sec(x) * f’
Phase velocity: w = csc(x) * c w = csc(x) * w’
Kinetic energy: K = ese(x) * E_0 K = ese(x) * K’
------------------------------------ -----------------
Where:
E_0 = m_0*c^2 is the energy at rest (for the electron see A081816, for the proton see A230438).
W_C = h/(m_0*c) is the Compton wavelength for the particle (for the electron see A230436, for the proton see A230845).
ese(x) = sec(x) - 1.
Table 2 is simpler than table 1 because the relativistic factors are written as trigonometric functions of the angle x assuming that sin(x) = v/c and that 0 < x < Pi/2.
Table 3 lists the simplest formulas in which the values of the constants have been interpreted as the values of the magnitudes of a virtual photon whose energy E' = h*f' is equivalent to E_0 = m_0*c^2, the rest energy of the particle.
A visualization of the relationship between the relativistic magnitudes, the quantum constants and the trigonometric functions is obtained using the first quadrant of the trigonometric circle according to the simplest table, see below:
Table 4.
-----------------------------------
sin(x) = v/v' = g/g'
cos(x) = L/L'
tan(x) = p/p' = k/k'
cot(x) = W/W'
sec(x) = t/t' = m/m' = E/E' = f/f'
csc(x) = w/w'
ese(x) = K/K'
-----------------------------------
Finally we can write that b is a critical speed because:
If v = b, for instance, we have that:
1) v/v’ = L/L’ = sin(Pi/4) = cos(Pi/4) = 2^(1/2)/2.
2) p/p’ = W/W’ = tan(Pi/4) = cot(Pi/4) = 1.
3) E/E’ = w/w’ = sec(Pi/4) = csc(Pi/4) = 2^(1/2).
Otherwise if v < b we have that:
v/v’ < L/L’ and p/p’ < W/W’ and E/E’ < w/w’.
Otherwise if v > b we have that:
v/v’ > L/L’ and p/p’ > W/W’ and E/E’ > w/w’.

Examples

			211985280.000383... m/s.
		

Crossrefs

Programs

  • Magma
    149896229*Sqrt(2); // G. C. Greubel, Jan 26 2018
  • Mathematica
    RealDigits[149896229*Sqrt[2], 10, 100][[1]] (* G. C. Greubel, Jan 26 2018 *)
  • PARI
    149896229*sqrt(2) \\ G. C. Greubel, Jan 26 2018
    

Formula

A232737 Decimal expansion of the real part of I^(1/8), or cos(Pi/16).

Original entry on oeis.org

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

Views

Author

Stanislav Sykora, Nov 29 2013

Keywords

Comments

The corresponding imaginary part is in A232738.

Examples

			0.9807852804032304491261822361342390369739337308933360950029160885453...
		

Crossrefs

Cf. A232738 (imaginary part), A010503 (real(I^(1/2))), A010527 (real(I^(1/3))), A144981 (real(I^(1/4))), A019881 (real(I^(1/5))), A019884 (real(I^(1/6))), A232735 (real(I^(1/7))), A019889 (real(I^(1/9))), A019890 (real(I^(1/10))).

Programs

Formula

Equals (1/2) * sqrt(2+sqrt(2+sqrt(2))). - Seiichi Manyama, Apr 04 2021
Root of 128*x^8 -256*x^6 +160*x^4 -32*x^2 +1 = 0. - R. J. Mathar, Aug 29 2025
2*this^2 -1 = A144981. - R. J. Mathar, Aug 29 2025
Equals 2F1(-1/8,1/8;1/2;1/2). - R. J. Mathar, Aug 31 2025

A268683 Decimal expansion of (sqrt(2) - 1)/2.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This is the maximum increase in mass-energy a particle can carry away from a neutral rotating (Kerr) black hole via the Penrose process.
Apart from leading digits the same as A174968, A157214 and A010503. - R. J. Mathar, Feb 24 2016

Examples

			0.20710678118654752440084436210484903928483593768847403658833986899536623...
		

References

  • Subrahmanyan Chandrasekhar, The Mathematical Theory of Black Holes, Oxford (1983), pp. 368-369.

Crossrefs

Programs

Extensions

More digits from Jon E. Schoenfield, Mar 15 2018

A274540 Decimal expansion of exp(sqrt(2)).

Original entry on oeis.org

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

Views

Author

Johannes W. Meijer, Jun 27 2016

Keywords

Comments

Define P(n) = (1/n)*Sum_{k=0..n-1} x(n-k)*P(k) for n >= 1, and P(0) = 1, with x(q) = C1 and x(n) = 1 for all other n. We find that C2 = lim_{n -> infinity} P(n) = exp((C1-1)/q).
The structure of the n!*P(n) formulas leads to the multinomial coefficients A036039.
Some transform pairs: C1 = A002162 (log(2)) and C2 = A135002 (2/exp(1)); C1 = A016627 (log(4)) and C2 = A135004 (4/exp(1)); C1 = A001113 (exp(1)) and C2 = A234473 (exp(exp(1)-1)).
From Peter Bala, Oct 23 2019: (Start)
The constant is irrational: Henry Cohn gives the following proof in Todd and Vishals Blog - "By the way, here's my favorite application of the tanh continued fraction: exp(sqrt(2)) is irrational.
Consider sqrt(2)*(exp(sqrt(2))-1)/(exp(sqrt(2))+1). If exp(sqrt(2)) were rational, or even in Q(sqrt(2)), then this expression would be in Q(sqrt(2)). However, it is sqrt(2)*tanh(1/sqrt(2)), and the tanh continued fraction shows that this equals [0,1,6,5,14,9,22,13,...]. If it were in Q(sqrt(2)), it would have a periodic simple continued fraction expansion, but it doesn't." (End)

Examples

			c = 4.113250378782927517173581815140304502401663943151...
		

Crossrefs

Programs

  • Maple
    Digits := 80: evalf(exp(sqrt(2))); # End program 1.
    P := proc(n) : if n=0 then 1 else P(n) := expand((1/n)*(add(x(n-k)*P(k), k=0..n-1))) fi; end: x := proc(n): if n=1 then (1 + sqrt(2)) else 1 fi: end: Digits := 49; evalf(P(120)); # End program 2.
  • Mathematica
    First@ RealDigits@ N[Exp[Sqrt@ 2], 80] (* Michael De Vlieger, Jun 27 2016 *)
  • PARI
    my(x=exp(sqrt(2))); for(k=1, 100, my(d=floor(x)); x=(x-d)*10; print1(d, ", ")) \\ Felix Fröhlich, Jun 27 2016

Formula

c = exp(sqrt(2)).
c = lim_{n -> infinity} P(n) with P(n) = (1/n)*Sum_{k=0..n-1} x(n-k)*P(k) for n >= 1, and P(0) = 1, with x(1) = (1 + sqrt(2)), the silver mean A014176, and x(n) = 1 for all other n.

Extensions

More terms from Jon E. Schoenfield, Mar 15 2018

A283962 Interspersion of the signature sequence of sqrt(1/2).

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Mar 19 2017

Keywords

Comments

Every row intersperses all other rows, and every column intersperses all other columns. The array is the dispersion of the complement of (column 1 = A022776).
R(n,m) = position of n*r + m when all the numbers k*r + h, where r = sqrt(2), k >= 1, h >= 0, are jointly ranked. - Clark Kimberling, Oct 06 2017

Examples

			Northwest corner of R:
   1   2   4   7  10  14  19  24  30
   3   5   8  12  16  21  27  33  40
   6   9  13  18  23  29  36  43  51
  11  15  20  26  32  39  47  44  64
  17  22  28  35  42  50  59  68  78
  25  31  38  46  54  63  73  83  94
		

Crossrefs

Programs

  • Mathematica
    r = Sqrt[1/2]; z = 100;
    s[0] = 1; s[n_] := s[n] = s[n - 1] + 1 + Floor[n*r];
    u = Table[n + 1 + Sum[Floor[(n - k)/r], {k, 0, n}], {n, 0, z}] (* A022775, col 1 of A283962 *)
    v = Table[s[n], {n, 0, z}] (* A022776, row 1 of A283962*)
    w[i_, j_] := u[[i]] + v[[j]] + (i - 1)*(j - 1) - 1;
    Grid[Table[w[i, j], {i, 1, 10}, {j, 1, 10}]] (* A283962, array *)
    Flatten[Table[w[k, n - k + 1], {n, 1, 20}, {k, 1, n}]] (* A283962, sequence *)
  • PARI
    r = sqrt(1/2);
    z = 100;
    s(n) = if(n<1, 1, s(n - 1) + 1 + floor(n*r));
    p(n) = n + 1 + sum(k=0, n, floor((n - k)/r));
    u = v = vector(z + 1);
    for(n=1, 101, (v[n] = s(n - 1)));
    for(n=1, 101, (u[n] = p(n - 1)));
    w(i, j) = u[i] + v[j] + (i - 1) * (j - 1) - 1;
    tabl(nn) = {for(n=1, nn, for(k=1, n, print1(w(k, n - k + 1), ", "); );print(); ); };
    tabl(10) \\ Indranil Ghosh, Mar 21 2017
    
  • Python
    r = 0.5 ** 0.5
    def s(n): return 1 if n<1 else s(n - 1) + 1 + int(n*r)
    def p(n): return n + 1 + sum([int((n - k)/r) for k in range(0, n+1)])
    v=[s(n) for n in range(0, 101)]
    u=[p(n) for n in range(0, 101)]
    def w(i,j): return u[i - 1] + v[j - 1] + (i - 1) * (j - 1) - 1
    for n in range(1, 11):
        print([w(k, n - k + 1) for k in range(1, n + 1)]) # Indranil Ghosh, Mar 21 2017
    
  • Python
    import numpy as np
    r = np.sqrt(1/2)
    x = np.arange(11)
    u = np.cumsum(np.ceil(x / r)).astype(int)
    v = np.cumsum(np.ceil(x * r)).astype(int)
    print(*[1 + u[k] + v[n-k] + k*(n-k) for n in range(11) for k in range(n+1)], sep=', ')
    # David Radcliffe, May 10 2025

Formula

R(i,j) = R(i,0) + R(0,j) + i*j - 1, for i>=1, j>=1.
Previous Showing 31-40 of 80 results. Next