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-3 of 3 results.

A081230 a(n) is the Levenshtein distance between n and n^n (where each is treated as a string).

Original entry on oeis.org

0, 1, 2, 3, 3, 4, 6, 8, 8, 9, 10, 11, 13, 16, 17, 18, 19, 22, 23, 26, 26, 28, 30, 32, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 86, 88, 90, 92, 94, 96, 99, 101, 103, 105, 107, 110, 112, 114, 116, 119, 121, 123, 125
Offset: 1

Views

Author

Francois Jooste (pin(AT)myway.com), Mar 11 2003

Keywords

Examples

			a(9)=8 since we can transform 9 into 9^9=387420489 by 8 insertions, namely inserting 3,8,7,4,2,0,4 and 8 in front of 9. a(2)=1 since we can transform 2 into 2^2=4 by one substitution, namely 4 for 2.
		

Crossrefs

Programs

  • Mathematica
    levenshtein[s_List, t_List] := Module[{d, n = Length@s, m = Length@t}, Which[s === t, 0, n == 0, m, m == 0, n, s != t, d = Table[0, {m + 1}, {n + 1}]; d[[1, Range[n + 1]]] = Range[0, n]; d[[Range[m + 1], 1]] = Range[0, m]; Do[ d[[j + 1, i + 1]] = Min[d[[j, i + 1]] + 1, d[[j + 1, i]] + 1, d[[j, i]] + If[ s[[i]] === t[[j]], 0, 1]], {j, m}, {i, n}]; d[[ -1, -1]] ]];
    f[n_] := levenshtein[IntegerDigits[n], IntegerDigits[n^n]]; Array[f, 69] (* Robert G. Wilson v *)

Extensions

Corrected by Robert G. Wilson v, Jan 25 2006

A082394 Let p = n-th prime of the form 4k+3, take the solution (x,y) to the Pellian equation x^2 - p*y^2 = 1 with x and smallest y >= 1; sequence gives value of y.

Original entry on oeis.org

1, 3, 3, 39, 5, 273, 531, 7, 69, 5967, 413, 9, 9, 22419, 93, 419775, 927, 6578829, 140634693, 5019135, 13, 313191, 650783, 1153080099, 19162705353, 15, 15, 400729, 231957, 8579, 7044978537, 8219541, 5052633, 957397, 153109862634573, 34443, 19
Offset: 1

Views

Author

Cino Hilliard, Apr 14 2003

Keywords

Examples

			For n=3, p = 11, x=10, y=3 since we have 10^2 = 11*3^2 + 1, so a(3) = 3.
		

References

  • C. Stanley Ogilvy, Tomorrow's Math, 1972, p. 119.

Crossrefs

Values of x are in A081231. Equals A002349(p). Cf. A082393.

Programs

  • Mathematica
    PellSolve[(m_Integer)?Positive] := Module[{cf, n, s}, cf = ContinuedFraction[ Sqrt[m]]; n = Length[ Last[cf]]; If[ OddQ[n], n = 2*n]; s = FromContinuedFraction[ ContinuedFraction[ Sqrt[m], n]]; {Numerator[s], Denominator[s]}]; Transpose[ PellSolve /@ Select[ Prime[ Range[72]], Mod[ #, 4] == 3 &]][[2]] (* Robert G. Wilson v, Sep 02 2004 *)
  • PARI
    p4xp3(n,m) = { forstep(p=3,m,4, for(y=1,n, if(isprime(p), x=y*y*p+1; if(issquare(x), print1(y" "); break; ) ) ) ) }

Extensions

More terms from Robert G. Wilson v, Apr 15 2003; recomputed Sep 03 2004

A173202 Solutions y of the Mordell equation y^2 = x^3 - 3a^2 + 1 for a = 0,1,2, ... (solutions x are given by the sequence A000466).

Original entry on oeis.org

0, 5, 58, 207, 500, 985, 1710, 2723, 4072, 5805, 7970, 10615, 13788, 17537, 21910, 26955, 32720, 39253, 46602, 54815, 63940, 74025, 85118, 97267, 110520, 124925, 140530, 157383, 175532, 195025, 215910, 238235, 262048, 287397, 314330, 342895
Offset: 1

Views

Author

Michel Lagneau, Feb 12 2010

Keywords

Comments

For many values of k for the equation y^2 = x^3 + k, all the solutions are known. For example, we have solutions for k=-2: (x,y) = (3,-5) and (3,5). A complete resolution for all integers k is unknown. Theorem: Let k be < -1, free of square factors, with k == 2 or 3 (mod 4). Suppose that the number of classes h(Q(sqrt(k))) is not divisible by 3. Then the equation y^2 = x^3 + k admits integer solutions if and only if k = 1 - 3a^2 or 1 - 3a^2 where a is an integer. In this case, the solutions are x = a^2 - k, y = a(a^2 + 3k) or -a(a^2 + 3k) (the first reference gives the proof of this theorem). With k = -1 - 3a^2, we obtain the solutions x = 4a^2 + 1, y = a(8a^2 + 3) or -a(8a^2 + 3). For the case k = 1 - 3a^2, we obtain the solution x = 4a^2 - 1 given by the sequence A000466.

Examples

			With a=3, x = 35 and y = 207, and then 207^2 = 35^2 - 26.
		

References

  • T. Apostol, Introduction to Analytic Number Theory, Springer, 1976
  • D. Duverney, Theorie des nombres (2e edition), Dunod, 2007, p.151

Crossrefs

Diophantine equations: see also Pellian equation: (A081233, A081234), (A081231, A082394), (A081232, A082393); Mordell equation: A053755, A173200; Diophantine equations: A006452, A006451, A006454.

Programs

  • Magma
    I:=[0, 5, 58, 207]; [n le 4 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3)-Self(n-4): n in [1..40]]; // Vincenzo Librandi, Jul 02 2012
  • Maple
    for a from 0 to 100 do : z := evalf(a*(8*a^2 - 3)) : print (z) :od :
  • Mathematica
    CoefficientList[Series[x*(5+38*x+5*x^2)/(1-x)^4,{x,0,40}],x] (* Vincenzo Librandi, Jul 02 2012 *)
    CoefficientList[Series[E^x (5 x + 24 x^2 + 8 x^3), {x, 0, 40}], x]*Table[n!, {n, 0, 40}] (* Stefano Spezia, Dec 04 2018 *)

Formula

y = a*(8*a^2 - 3).
a(n) = sqrt(A000466(n)^3 - A080663(n)). - Artur Jasinski, Nov 26 2011
From Colin Barker, Apr 26 2012: (Start)
a(n) = 8*n^3 - 24*n^2 + 21*n - 5.
G.f.: x^2*(5 + 38*x + 5*x^2)/(1 - x)^4. (End)
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). - Vincenzo Librandi, Jul 02 2012
E.g.f.: exp(x)*(5*x + 24*x^2 + 8*x^3). - Stefano Spezia, Dec 04 2018
Showing 1-3 of 3 results.