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 11-14 of 14 results.

A245552 G.f.: Sum_{n>=0} (2*n+1)*x^(n^2+n+1).

Original entry on oeis.org

0, 1, 0, 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19
Offset: 0

Views

Author

N. J. A. Sloane, Aug 02 2014

Keywords

Comments

Related to g.f. for A053187.
Apart from signs and a factor of 2, this is the classical Jacobi theta-function theta'_1(q), see A002483.

Crossrefs

Programs

Formula

a(2*n+1) = A198954(n), a(2*n) = 0.- Robert Israel, Aug 05 2014

A353295 Square nearest to the sum of the first n positive squares.

Original entry on oeis.org

0, 1, 4, 16, 25, 49, 100, 144, 196, 289, 400, 484, 625, 841, 1024, 1225, 1521, 1764, 2116, 2500, 2916, 3364, 3844, 4356, 4900, 5476, 6241, 6889, 7744, 8464, 9409, 10404, 11449, 12544, 13689, 14884, 16129, 17689, 19044, 20449, 22201, 23716, 25600, 27556, 29241
Offset: 0

Views

Author

Paolo Xausa, Jun 04 2022

Keywords

Examples

			a(4) = 25 because the sum of the first 4 positive squares is 1 + 4 + 9 + 16 = 30, and the nearest square is 25.
		

Crossrefs

Programs

  • Mathematica
    nterms=100;Array[Round[Sqrt[#(#+1)(2#+1)/6]]^2&,nterms,0]
  • Python
    from math import isqrt
    def a(n):
        s = n*(n+1)*(2*n+1)//6
        r = isqrt(s)
        d1, d2 = s-r**2, (r+1)**2-s
        return r**2 if d1 <= d2 else (r+1)**2
    print([a(n) for n in range(45)]) # Michael S. Branicky, Jun 05 2022

Formula

a(n) = A053187(A000330(n)).

A351319 a(n) = floor(n/k), where k is the nearest square to n.

Original entry on oeis.org

1, 2, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Joelle H. Kassir, Mar 18 2022

Keywords

Comments

For all n != 2, a(n) is 0 when less than the nearest square, A053187(n), and is 1 otherwise.
From Jon E. Schoenfield, Mar 22 2022: (Start)
After the first two terms, the sequence consists of runs of 0's and 1's, with run lengths 1,3,2,4,3,5,4,6,5,7,6,8,... = A028242.
For m >= 1, there are 2m integers k whose nearest square is m^2, namely, the m-1 integers (in the interval [m^2-m+1, m^2-1]) for which k < m^2 (hence a(k) = 0), followed by the m+1 integers (in the interval [m^2, m^2+m]) for which k >= m^2 (hence a(k) = 1). (End)

Examples

			a(5) = floor(5/4) = 1.
		

Crossrefs

Cf. A000194, A053187 (nearest square), A028242 (run lengths).
Cf. A267708 (essentially the same).

Programs

  • Mathematica
    Table[Floor[n/Round[Sqrt[n]]^2], {n, 100}] (* Wesley Ivan Hurt, Mar 18 2022 *)
  • PARI
    a(n) = if(n==2,2, my(r,s=sqrtint(n,&r)); r<=s); \\ Kevin Ryde, Mar 23 2022
  • Python
    import math
    def a(n):
        k = math.isqrt(n)
        if n - k**2 > k: k += 1
        return n // k**2;
    for n in range(1, 101):
        print("{}, ".format(a(n)), end="")
    
  • Python
    from math import isqrt
    def A351319(n): return n if n <= 2 else int((k:=isqrt(n))**2+k-n+1 > 0) # Chai Wah Wu, Mar 26 2022
    

Formula

a(n) = floor(n/k), where k = round(sqrt(n))^2 = A053187(n).
a(n) = A267708(n) for n != 2.

A249077 Primes of the form n^2 + k such that n^2 - k is also prime, where -n < k < n.

Original entry on oeis.org

3, 5, 7, 11, 13, 19, 31, 41, 61, 67, 73, 79, 83, 89, 97, 103, 137, 139, 149, 151, 157, 181, 193, 199, 211, 223, 227, 239, 241, 271, 311, 317, 331, 337, 349, 373, 421, 433, 439, 443, 449, 461, 607, 619, 631, 643, 661, 691, 719, 739, 757, 811, 823, 829, 853, 859
Offset: 1

Views

Author

Arkadiusz Wesolowski, Oct 20 2014

Keywords

Comments

Members of a pair (a, b) of primes such that a < b and the distances from a and b to the nearest square above a (or below b) are equal.
The only prime of the form n^2 + 1 (A002496) in the sequence is 5.
Is this sequence infinite?

Examples

			2^2-1=3, 2^2+1=5, both prime.
8^2-3=61, 8^2+3=67, both prime.
		

Crossrefs

Programs

  • Magma
    lst:=[]; for m in [1..28] do r:=m*(m+1)+1; s:=(m+1)^2; for a in [r..s-1] do if IsPrime(a) then b:=2*s-a; if IsPrime(b) then Append(~lst, a); Append(~lst, b); end if; end if; end for; end for; Sort(lst);
    
  • Maple
    g:= proc(t,m) if isprime(m+t) and isprime(m-t) then (m+t,m-t) else NULL fi end proc:
    `union`(seq(map(g,{$1..n-1},n^2),n=2..100));
    # if using Maple 11 or earlier, uncomment the next line
    # sort(convert(%,list));
    # Robert Israel, Oct 31 2014
  • PARI
    for(n=1, 859, if(issquare(n), x=ps=n; until(issquare(x), x++); ns=x); if(isprime(n), if(n-ps
    				

Formula

A prime p is in the sequence if and only if 2*A053187(p)-p is prime.
Previous Showing 11-14 of 14 results.