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.

A256244 a(n) = sqrt(n + 2*A256243(n)).

Original entry on oeis.org

3, 2, 3, 4, 3, 4, 3, 4, 5, 4, 5, 4, 5, 4, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 12
Offset: 1

Views

Author

Zak Seidov, Mar 20 2015

Keywords

Crossrefs

Programs

  • Mathematica
    Table[m = 1; While[! IntegerQ[Sqrt[n + 2*m]], m++]; Sqrt[n + 2 m], {n, 100}] (* Michael De Vlieger, Mar 20 2015 *)
  • PARI
    a(n)=m=1;while(!issquare(n+2*m),m++);sqrt(n+2*m)
    vector(100,n,round(a(n))) \\ Derek Orr, Mar 22 2015
    
  • PARI
    a(n)=my(s=sqrtint(n)); if((s-n)%2,s+1,s+2) \\ Charles R Greathouse IV, Mar 23 2015

Formula

sqrt(n) < a(n) <= sqrt(n) + 2. - Charles R Greathouse IV, Mar 23 2015

A253203 The least square larger than n with same parity as n.

Original entry on oeis.org

9, 4, 9, 16, 9, 16, 9, 16, 25, 16, 25, 16, 25, 16, 25, 36, 25, 36, 25, 36, 25, 36, 25, 36, 49, 36, 49, 36, 49, 36, 49, 36, 49, 36, 49, 64, 49, 64, 49, 64, 49, 64, 49, 64, 49, 64, 49, 64, 81, 64, 81, 64, 81, 64, 81, 64, 81, 64, 81, 64, 81, 64, 81, 100, 81, 100, 81, 100, 81, 100, 81, 100, 81, 100, 81, 100, 81, 100, 81, 100
Offset: 1

Views

Author

Tom Edgar and Zak Seidov, Mar 25 2015

Keywords

Examples

			9 is the least odd square > 1;
4 is the least even square > 2;
9 is the least odd square > 3.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{s = If[n == 1, Range[3]^2, Range[2 Ceiling@ Sqrt@ n]^2]}, If[EvenQ@ n, SelectFirst[s, EvenQ@ # && # > n &], SelectFirst[s, OddQ@ # && # > n &]]]; Array[f, 120] (* Michael De Vlieger, Mar 25 2015 *)
  • Sage
    A = []
    for i in [1..100]:
        for y in [1..100]:
            x = y**2
            if x>i and (x-i)%2==0:
                A.append(x)
                break
    A

Formula

a(n) = A256244(n)^2 = n + 2*A256243(n).

A256245 a(n) is the smallest positive number m such that n+3*m is a square, or 0 if no such m exists.

Original entry on oeis.org

1, 0, 2, 4, 0, 1, 3, 0, 9, 2, 0, 8, 1, 0, 7, 3, 0, 6, 2, 0, 5, 1, 0, 4, 8, 0, 3, 7, 0, 2, 6, 0, 1, 5, 0, 15, 4, 0, 14, 3, 0, 13, 2, 0, 12, 1, 0, 11, 5, 0, 10, 4, 0, 9, 3, 0, 8, 2, 0, 7, 1, 0, 6, 12, 0, 5, 11, 0, 4, 10, 0, 3, 9, 0, 2, 8, 0, 1, 7, 0, 21, 6, 0, 20, 5, 0, 19, 4, 0, 18, 3, 0, 17, 2
Offset: 1

Views

Author

Zak Seidov, Mar 20 2015

Keywords

Examples

			1 + 3*1 = 4 = 2^2, 3 + 3*2 = 9 = 3^2, 4 + 3*4 = 16 = 4^2.
		

Crossrefs

Cf. A256243.

Programs

  • Mathematica
    Table[m = 1; If[Mod[n, 3] == 2, m = 0, While[! IntegerQ[Sqrt[n + 3*m]], m++]]; m, {n, 100}] (* Michael De Vlieger, Mar 20 2015 *)
  • PARI
    a(n)=if(n==Mod(2,3),return(0));m=1;while(!issquare(n+3*m),m++);m
    vector(100,n,a(n)) \\ Derek Orr, Mar 22 2015

Formula

a(n)=0 iff n==2 mod 3 because 2 is quadratic nonresidue of 3.
Showing 1-3 of 3 results.