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.

Showing 1-7 of 7 results.

A022405 a(n) = a(n-1)*a(n-2) - a(n-3), with a(1) = 0, a(2) = 1, a(3) = 2.

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 10, 37, 366, 13532, 4952675, 67019597734, 331926286207224918, 22245566178948766568816183137, 7383888166355511098764350563784314022618210032
Offset: 1

Views

Author

Robert G. Wilson v, Jul 05 2000

Keywords

Comments

Theorem 1.1 of Hare et al. (2010, 2011) involves a shifted version of this sequence and the Fibonacci sequence A000045. (The program by Alonso del Arte below does involve a shifted version of this sequence.) - Petros Hadjicostas, May 11 2019

Crossrefs

Programs

  • Magma
    I:=[0,1,2]; [n le 3 select I[n] else Self(n-1)*Self(n-2) - Self(n-3): n in [1..15]];  // G. C. Greubel, Mar 01 2018
  • Mathematica
    a[1] = 0; a[2] = 1; a[3] = 2; a[n_] := a[n] = a[n - 1] a[n - 2] - a[n - 3]; Table[a[n], {n, 1, 15}] (* Alonso del Arte, Jan 31 2011 *)
    nxt[{a_,b_,c_}]:={b,c,c*b-a}; NestList[nxt,{0,1,2},15][[;;,1]] (* Harvey P. Dale, Mar 23 2025 *)

Formula

It appears that lim_{n->infinity} log(a(n))/phi^n = 0.07743008049000107520747623421744398272089261907514..., where phi = (1 + sqrt(5))/2 is the golden ratio A001622. - Petros Hadjicostas and Jon E. Schoenfield, May 11 2019

Extensions

Name clarified by Michel Marcus, May 10 2019

A072877 a(1) = a(2) = a(3) = a(4) = 1; a(n) = (a(n-1)*a(n-3) + a(n-2)^4)/a(n-4).

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 19, 119, 65339, 67258454, 959259994615659593, 171965197021698738644442682357, 12959040525296547835480490169418622922155526267774117749963303914461
Offset: 1

Views

Author

Benoit Cloitre, Jul 28 2002

Keywords

Comments

A variation of a Somos-4 sequence with a(n-2)^4 in place of a(n-2)^2.

Crossrefs

Programs

  • Maple
    L[0]:=0; L[1]:=0; L[2]:=0; L[3]:=0; for n from 0 to 4000 do L[n+4]:=evalf(ln(1+exp(L[n+3]+L[n+1]-4*L[n+2]))+4*L[n+2]-L[n]): od: for n from 3990 to 4000 do print(evalf(ln(L[n+4])/(n+4))): od: #Note: L[n] is log(a[n]) # Andrew Hone, Nov 15 2005
  • Mathematica
    nxt[{a_,b_,c_,d_}]:={b,c,d,(d*b+c^4)/a}; NestList[nxt,{1,1,1,1},15][[All,1]] (* Harvey P. Dale, Jun 01 2022 *)

Formula

Lim_{n->infinity} (log(log(a(n))))/n = log(2+sqrt(3))/2 = A065918/2 or about 0.658. - Andrew Hone, Nov 15 2005; corrected by Michel Marcus, May 12 2019
From Jon E. Schoenfield, May 12 2019: (Start)
It appears that, for n >= 1,
a(n) = ceiling(e^(c0*x^n + d0/x^n)) if n is even,
ceiling(e^(c1*x^n + d1/x^n)) if n is odd,
where
x = sqrt(2 + sqrt(3)) = (sqrt(2) + sqrt(6))/2
c0 = 0.024915247166055931001426396817534982995670642690...
c1 = 0.029604794868229453467890216788323427656809346011...
d0 = -10.535089427608481105514469573411011428431309483956...
d1 = -2.856773870202800001336732759121362374871088274450...
(End)

Extensions

Definition corrected by Matthew C. Russell, Apr 24 2012

A061021 a(n) = a(n-1)*a(n-2) - a(n-3) with a(0) = a(1) = a(2) = 3.

Original entry on oeis.org

3, 3, 3, 6, 15, 87, 1299, 112998, 146784315, 16586334025071, 2434613678231239448367, 40381315689150066251526220641224742, 98312903521778500654864668915856114278134197773017871243
Offset: 0

Views

Author

Stephen G Penrice, May 23 2001

Keywords

Comments

Any three consecutive terms are a solution to the Diophantine equation x^2 + y^2 + z^2 = xyz.

Crossrefs

Programs

  • Haskell
    a061021 n = a061021_list !! n
    a061021_list = 3 : 3 : 3 : zipWith (-)
    (tail $ zipWith (*) (tail a061021_list) a061021_list) a061021_list
    -- Reinhard Zumkeller, Mar 25 2015
  • Mathematica
    RecurrenceTable[{a[n] == a[n - 1] a[n - 2] - a[n - 3], a[0] == a[1] == a[2] == 3}, a, {n, 0, 12}] (* Michael De Vlieger, Aug 21 2016 *)
  • PARI
    for (n=0, 17, if (n>2, a=a1*a2 - a3; a3=a2; a2=a1; a1=a, if (n==0, a=a3=3, if (n==1, a=a2=3, a=a1=3))); write("b061021.txt", n, " ", a)) \\ Harry J. Smith, Jul 16 2009
    

Formula

From Jon E. Schoenfield, May 12 2019: (Start)
It appears that, for n >= 1,
a(n) = ceiling(e^(c0*phi^n - c1/(-phi)^n))
where
phi = (1 + sqrt(5))/2,
c0 = 0.4004033011137849744572073756789830081726425559860...
c1 = 0.2798639753144007577581523025628820390768226527315...
(End)

Extensions

More terms from Erich Friedman, Jun 03 2001
Name clarified by Petros Hadjicostas, May 11 2019

A380462 a(n) is the number of positive solutions to the Diophantine equation w^2 + x^2 + y^2 + z^2 = w*x*y*z such that x,y,z,w < e^n.

Original entry on oeis.org

1, 2, 2, 3, 4, 6, 6, 7, 10, 12, 16, 17, 18, 23, 25, 32, 35, 39, 43, 47, 55, 60, 64, 73, 76, 86, 94, 101, 111, 118, 132, 141, 150, 159, 168, 180, 192, 203, 220, 235, 247, 261, 275, 289, 302, 324, 340, 361, 376, 394, 413, 433, 454, 472, 498, 518, 536, 560, 584, 606, 632, 658, 684
Offset: 1

Views

Author

Bence Bernáth, Jun 22 2025

Keywords

Comments

The trivial x=y=z=w=0 solution is not included. The solutions are generated by the Vieta jumping discussed in the Numberphile video.

Examples

			a(3)=2 because the solutions below e^3=20.085... are [2,2,2,2] and [2,2,2,6]. One quadruplet solution is counted only once.
		

Crossrefs

Cf. A061292.

Programs

  • Python
    import math
    from collections import deque
    def is_perfect_square(n):
        return (math.isqrt(n)) ** 2 == n
    def generate_all_solutions(up_to_bound):
        solutions = set()
        visited = set()
        seed = (2, 2, 2, 2)
        queue = deque([seed])
        solutions.add(seed)
        while queue:
            quad = queue.popleft()
            for ii in range(4):
                rotated = list(quad[ii:] + quad[:ii])
                x, y, z, w = rotated
                product = y * z * w
                sumsq = y**2 + z**2 + w**2
                D = product**2 - 4 * sumsq
                if D < 0 or not is_perfect_square(D):
                    continue
                sqrt_D = (math.isqrt(D))
                for sign in [+1, -1]:
                    x_new = (product + sign * sqrt_D)
                    if x_new % 2 != 0:
                        continue
                    x_new //= 2
                    if not (0 < x_new < up_to_bound):
                        continue
                    new_quad = [x_new, y, z, w]
                    if any(val >= up_to_bound for val in new_quad):
                        continue
                    new_quad_sorted = tuple(sorted(new_quad))
                    if new_quad_sorted not in visited:
                        solutions.add(new_quad_sorted)
                        queue.append(tuple(new_quad))
                        visited.add(new_quad_sorted)
        return sorted(solutions)
    # Compute all solutions up to e^100
    max_bound = math.exp(100)
    all_solutions = generate_all_solutions(max_bound)
    # Precompute max entry of each solution for fast thresholding
    solution_maxes = [max(sol) for sol in all_solutions]
    # Generate the sequence a(n) for n = 1 to 100
    a_n = []
    for n in range(1, 101):
        threshold = math.exp(n)
        count = sum(1 for m in solution_maxes if m < threshold)
        a_n.append(count)
    print(a_n)

A385713 Numbers w + x + y + z where (w,x,y,z) are nonnegative solutions to the Diophantine equation w^2 + x^2 + y^2 + z^2 = w*x*y*z.

Original entry on oeis.org

0, 8, 12, 32, 108, 292, 392, 1452, 3392, 3712, 5408, 11808, 20172, 34872, 40332, 50572, 75272, 162212, 280908, 480512, 518252, 595052, 700352, 1048352, 1639308, 3912492, 4599172, 4911172, 5725732, 6049292, 6508932, 7132608, 8279808, 9739812
Offset: 1

Views

Author

Bence Bernáth, Jul 07 2025

Keywords

Comments

The trivial sum with x=y=z=w=0 is included. The solutions are generated by the Vieta jumping discussed in the Numberphile video. The algorithm finds all the quadruplet solutions within the radius of a 4D sphere. Then the quadruplets are sorted based on their sum in increasing order.

Examples

			8 is a term because (w,x,y,z) = (2,2,2,2) is the first nontrivial solution.
12 is a term because (2,2,2,6) is a solution.
		

Crossrefs

Programs

  • Python
    import math
    def is_perfect_square(n):
        return (math.isqrt(n)) ** 2 == n
    def generate_all_solutions(radius):
        solutions = set()
        visited = set()
        # Initial known solution
        seed = (2, 2, 2, 2)
        queue = [seed]
        solutions.add(seed)
        while queue:
            quad = queue.pop(0)
            for ii in range(4):
                # Cyclically rotate variables: solve for the ii-th one
                rotated = list(quad[ii:] + quad[:ii])
                x, y, z, w = rotated
                # Use Vieta's formula: x^2 - (yzw)x + (y² + z² + w²) = 0
                product = y * z * w
                sumsq = y**2 + z**2 + w**2
                D = product**2 - 4 * sumsq
                if D < 0 or not is_perfect_square(D):
                    continue
                sqrt_D = (math.isqrt(D))
                for sign in [+1, -1]:
                    x_new = (product + sign * sqrt_D)
                    if x_new % 2 != 0:
                        continue
                    x_new //= 2
                    if not (0 < x_new < radius):
                        continue
                    new_quad = [x_new, y, z, w]
                    if any(val >= radius for val in new_quad):
                        continue
                    new_quad_sorted = tuple(sorted(new_quad))
                    if new_quad_sorted not in visited:
                        solutions.add(new_quad_sorted)
                        queue.append(tuple(new_quad))
                        visited.add(new_quad_sorted)
        # Return solutions sorted by sum of elements
        return sorted([list(sol) for sol in solutions], key=lambda tup: sum(tup))
    print([sum(sol) for sol in generate_all_solutions(10000000)])

A146974 Numbers k such that there is no nonzero integer solution for the Diophantine equation x_1^2 + x_2^2 + ... + x_k^2 = x_1*x_2*...*x_k.

Original entry on oeis.org

2, 6, 9, 11, 12, 15, 16, 18, 20, 21, 24, 29, 32, 33, 36, 41, 42, 45, 48, 50, 51, 56, 57, 60, 66, 72, 76, 77, 81, 82, 84, 90, 96, 99, 101, 102, 105, 106, 108, 113, 114, 120, 122, 123, 126, 132, 136, 137, 140, 141, 144, 146, 156, 162, 164, 168, 171, 176, 177, 180
Offset: 1

Views

Author

Zhao Hui Du, Nov 04 2008

Keywords

Comments

In the link, a C++ program calling the GMP library is provided to solve such kinds of equations.
If the equation has nonzero solutions and k > 2, then there is a positive integer solution (x_1, x_2, ..., x_k) such that 3 <= x_1*x_2*...*x_(k-2) <= n and x_(k-1) <= sqrt((x_1^2 + x_2^2 + ... + x_(k-2)^2)/(x_1*x_2*...*x_(k-2) - 2)).

Examples

			For k=3, there are nonzero integer solutions 3^2 + 3^2 + 3^2 = 3*3*3; 3^2 + 6^2 + 15^2 = 3*6*15.
For k=4, there are nonzero integer solutions 2^2 + 2^2 + 2^2 + 2^2 = 2*2*2*2; 2^2 + 6^2 + 22^2 + 262^2 = 2*6*22*262.
However, for k=2, there is no nonzero integer solution for the equation a^2 + b^2 = a*b.
		

Crossrefs

Programs

  • PARI
    is(w, k) = my(p, s); for(x=w[k], sqrtint((s=sum(i=1, k, w[i]^2))\p=vecprod(w)-2), if(issquare((p^2+4*p)*x^2-4*s), return(1)))
    lista(nn) = my(b, t, v=List([])); for(n=2, nn, b=1; for(i=1, #v, if(n%vecprod(v[i])==0&&v[i][1]<=t=n\vecprod(v[i]), listput(v, concat(t, v[i])))); listput(v, [n]); for(m=2, #v, if(is(concat(vector(n-2-#v[m], i, 1), v[m]), n-2), b=0; break)); if(b, print1(n, ", "))) \\ Jinyuan Wang, Oct 04 2021

Extensions

Edited by Jon E. Schoenfield, Aug 09 2015
More terms from Jinyuan Wang, Oct 04 2021

A385121 a(n+1) = 12*a(n) - a(n-1), a(0) = a(1) = 2, a(n) = a(1-n).

Original entry on oeis.org

2, 2, 22, 262, 3122, 37202, 443302, 5282422, 62945762, 750066722, 8937854902, 106504192102, 1269112450322, 15122845211762, 180205030090822, 2147337515878102, 25587845160446402, 304906804409478722, 3633293807753298262, 43294618888630100422
Offset: 0

Views

Author

Michael Somos, Jun 18 2025

Keywords

Comments

If x = 2, y = 6, z = a(n), w = a(n+1), then x^2+y^2+z^2+w^2 = x*y*z*w.

Examples

			G.f. = 2 + 2*x + 22*x^2 + 262*x^3 + 3122*x^4 + 37202*x^5 + ...
		

Crossrefs

Programs

  • Mathematica
    a[ n_] := Which[n<1, a[1-n], n==1, 2, True, 12*a[n-1] - a[n-2]];
  • PARI
    {a(n) = if(n<1, a(1-n), n==1, 2, 12*a(n-1) - a(n-2))};

Formula

G.f.: (2 - 22*x)/(1 - 12*x + x^2).
0 = 40 + a(n)^2 - 12*a(n)*a(n+1) + a(n+1)^2 for all n in Z.
a(n) = 2 * A077417(n-1).
E.g.f.: 2*exp(6*x)*(7*cosh(sqrt(35)*x) - sqrt(35)*sinh(sqrt(35)*x))/7. - Stefano Spezia, Aug 29 2025
Showing 1-7 of 7 results.