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

A363499 a(n) = Sum_{k=0..n} floor(sqrt(k))^5.

Original entry on oeis.org

0, 1, 2, 3, 35, 67, 99, 131, 163, 406, 649, 892, 1135, 1378, 1621, 1864, 2888, 3912, 4936, 5960, 6984, 8008, 9032, 10056, 11080, 14205, 17330, 20455, 23580, 26705, 29830, 32955, 36080, 39205, 42330, 45455, 53231, 61007, 68783, 76559, 84335, 92111, 99887
Offset: 0

Views

Author

Hans J. H. Tuenter, Jun 05 2023

Keywords

Comments

Partial sums of the fifth powers of the terms of A000196.

Crossrefs

Sums of powers of A000196: A022554 (1st), A174060 (2nd), A363497 (3rd), A363498 (4th), this sequence (5th).

Programs

  • Mathematica
    Table[(n + 1) #^5 - (1/84) # (# + 1)*(2 # + 1)*(3 # - 1)*(10 #^3 - 7 # + 4) &[Floor@ Sqrt[n]], {n, 0, 42}] (* Michael De Vlieger, Jun 10 2023 *)
  • Python
    from math import isqrt
    def A363499(n): return (m:=isqrt(n))**5 *(n+1) - (m*(m+1)*(2*m+1)*(3*m-1)*(10*m**3-7*m+4))//84 # Karl-Heinz Hofmann, Jul 17 2023

Formula

a(n) = (n+1)*m^5 - (1/84)*m*(m+1)*(2*m+1)*(3*m-1)*(10*m^3-7*m+4), where m = floor(sqrt(n)).

A176615 Number of edges in the graph on n vertices, labeled 1 to n, where two vertices are joined just if their labels sum to a perfect square.

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 16, 17, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 49, 52, 55, 57, 59, 61, 63, 65, 68, 71, 74, 77, 80, 83, 86, 89, 91, 93, 96, 99, 102, 105, 108, 111, 114, 117, 120, 123, 127, 131, 135, 138, 141, 144, 147, 150
Offset: 1

Views

Author

Keywords

Comments

Equivalently, number of pairs of integers 0 < i < j <= n such that i + j is a square.
Suggested by R. K. Guy

Examples

			For n = 7 the graph contains the 4 edges 1-3, 2-7, 3-6, 4-5.
		

Crossrefs

Column k=2 of A281871.

Programs

  • Maple
    b:= n-> 1+floor(sqrt(2*n-1))-ceil(sqrt(n+1)):
    a:= proc(n) option remember; `if`(n=0, 0, a(n-1)+b(n)) end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 30 2017
  • Mathematica
    a[n_] := Sum[Floor[Sqrt[2k-1]] - Floor[Sqrt[k]], {k, 1, n}]; Table[a[n], {n, 1, 68}] (* Jean-François Alcover, Nov 04 2011, after Pari *)
  • PARI
    a(n)=sum(k=1,sqrtint(n+1),ceil(k^2/2)-1)+sum(k=sqrtint(n+1)+1,sqrtint(2*n -1),n-floor(k^2/2))
    
  • PARI
    a(n)=sum(k=1,n,sqrtint(2*k-1)-sqrtint(k))

Formula

Asymptotically, a(n) ~ (2*sqrt(2) - 2)/3 n^(3/2). The error term is probably O(n^(1/2)); O(n) is easily provable.

A214036 Numbers k such that floor(sqrt(1)) + floor(sqrt(2)) + floor(sqrt(3)) + ... + floor(sqrt(k)) is prime.

Original entry on oeis.org

2, 3, 4, 5, 7, 8, 10, 14, 36, 37, 39, 42, 43, 44, 46, 47
Offset: 1

Views

Author

Paolo P. Lava, Mar 06 2013

Keywords

Comments

The sequence is complete. Indeed, let s(n) be the sum of floor(sqrt(k)) for k from 1 to n. It is easy to verify that s(n^2+j), for 0 <= j < (n+1)^2-n^2, is equal to n(j+1) + n(4n+1)(n-1)/6, which is always divisible by n or by n/6 for n > 6. - Giovanni Resta, Mar 26 2014

Examples

			2 is a term because floor(sqrt(1))+floor(sqrt(2)) = 1+1 = 2 is prime;
14 is a term because floor(sqrt(1))+ ... +floor(sqrt(14)) = 1+1+1+2+2+2+2+2+3+3+3+3+3+3 = 31 is prime.
		

Crossrefs

Primes in A022554.
Cf. A220953.

Programs

  • Maple
    A214036:=proc(q)  local a,n; a:=0;
    for n from 1 to q do a:=a+floor(sqrt(n)); if isprime(a) then print(n); fi; od; end:
    A214036(10^10);
    Alternative program:
    A214036_bis:=proc(q)  local a,j,n; a:=0;
    for n from 1 to q do for j from 1 to 2*n+1 do
        a:=a+n; if isprime(a) then print(n^2+j-1); fi;
    od; od; end:
    A214036_bis(10^10);
  • Mathematica
    Position[Accumulate[Table[Floor[Sqrt[n]],{n,50}]],?PrimeQ]//Flatten (* _Harvey P. Dale, Apr 14 2017 *)
  • PARI
    sm = 0; for (n=1, 10^9, sm+=sqrtint(n); if (isprime(sm), print1(n,", ")));
    /* Joerg Arndt, Mar 07 2013 */

A270370 a(n) = Sum_{k=0..n} (-1)^k*floor(k^(1/3)).

Original entry on oeis.org

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

Views

Author

John M. Campbell, Mar 15 2016

Keywords

Examples

			a(5) = [0^(1/3)]-[1^(1/3)]+[2^(1/3)]-[3^(1/3)]+[4^(1/3)]-[5^(1/3)] = 0-1+1-1+1-1 = -1, letting [] denote the floor function.
		

Crossrefs

Programs

  • Mathematica
    Print[Table[Sum[(-1)^i*Floor[i^(1/3)],{i,0,n}],{n,0,100}]]
  • PARI
    a(n)=sum(i=0,n,(-1)^i*sqrtnint(i,3))
    
  • PARI
    a(n)=sqrtnint(n,3)*(-1)^n/2-((-1)^(sqrtnint(n,3)+1)+1)/4

Formula

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

A327672 a(n) = Sum_{k=0..n} ceiling(sqrt(k)).

Original entry on oeis.org

0, 1, 3, 5, 7, 10, 13, 16, 19, 22, 26, 30, 34, 38, 42, 46, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 101, 107, 113, 119, 125, 131, 137, 143, 149, 155, 161, 168, 175, 182, 189, 196, 203, 210, 217, 224, 231, 238, 245, 252, 260, 268, 276, 284, 292, 300, 308, 316
Offset: 0

Views

Author

Peter Kagey, Sep 21 2019

Keywords

Comments

Partial sums of A003059.
Given a digraph whose vertices are numbered from 0 to n and in which an edge (u,v) exists iff u < v, a(n) is the maximum number of arcs that can be chosen so that for each vertex j other than 0 and n, the number of chosen arcs whose tail is vertex j equals the number of chosen arcs whose head is vertex j. - Xutong Ding, Dec 12 2023

Crossrefs

Programs

  • Mathematica
    Accumulate[Ceiling[Sqrt[Range[0, 60]]]]
    Table[(1 + Floor[Sqrt[n]])*(6*n - Floor[Sqrt[n]] - 2*Floor[Sqrt[n]]^2)/6, {n, 0, 100}] (* Vaclav Kotesovec, Dec 26 2023 *)

Formula

a(n) = (1 + floor(sqrt(n)))*(6*n - floor(sqrt(n)) - 2*floor(sqrt(n))^2)/6. - Vaclav Kotesovec, Dec 26 2023

A262352 a(n) = Sum_{k=0..n} (-1)^k*floor(k^(1/4)).

Original entry on oeis.org

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

Views

Author

John M. Campbell, Mar 24 2016

Keywords

Examples

			Letting [] denote the floor function, a(7) = [0^(1/4)] - [1^(1/4)] + [2^(1/4)] - [3^(1/4)] + [4^(1/4)] - [5^(1/4)] + [6^(1/4)] - [7^(1/4)] = 0 - 1 + 1 - 1 + 1 - 1 + 1 - 1 = -1.
		

Crossrefs

Programs

  • Mathematica
    Print[Table[Sum[(-1)^k*Floor[k^(1/4)],{k,0,n}],{n,0,100}]] ;
  • PARI
    a(n)=floor(n^(1/4))*(-1)^n/2-((-1)^(floor(n^(1/4))+1)+1)/4
    
  • PARI
    a(n)=sum(k=0,n,(-1)^k*floor(k^(1/4)))
    
  • PARI
    A262352(n) = sum(k=0,n,((-1)^k)*sqrtnint(k, 4)); \\ Antti Karttunen, Nov 06 2018

Formula

a(n) = floor(n^(1/4))*(-1)^n/2-((-1)^(floor(n^(1/4))+1)+1)/4.

Extensions

More terms from Antti Karttunen, Nov 06 2018

A331478 Irregular triangle T(n,k) = n - (s - k + 1)^2 for 1 <= k <= s, with s = floor(sqrt(n)).

Original entry on oeis.org

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

Views

Author

Michael De Vlieger, Jan 17 2020

Keywords

Comments

Row n begins with n - floor(sqrt(n)).
Zero appears in row n for n that are perfect squares. Let r = sqrt(n). For perfect square n, there exists a partition of n that consists of a run of r parts that are each r themselves; e.g., for n = 4, we have {2, 2}, for n = 9, we have {3, 3, 3}. It is clear through the Ferrers diagram of these partitions that they are equivalent to their Durfee square, thus n - s^2 = 0.
Since the partitions of any n contain Durfee squares in the range of 1 <= s <= floor(sqrt(n)) (with perfect square n also including k = 0), the distinct Durfee square excesses must be the differences n - s^2 for 1 <= s <= floor(sqrt(n)).
We borrow the term "square excess" from A053186(n), which is simply the difference n - floor(sqrt(n)).
Row n of this sequence contains distinct Durfee square excesses among all integer partitions of n (see example below).

Examples

			Table begins:
   1:  0;
   2:  1;
   3:  2;
   4:  0,  3;
   5:  1,  4;
   6:  2,  5;
   7:  3,  6;
   8:  4,  7;
   9:  0,  5,  8;
  10:  1,  6,  9;
  11:  2,  7, 10;
  12:  3,  8, 11;
  13:  4,  9, 12;
  14:  5, 10, 13;
  15:  6, 11, 14;
  16:  0,  7, 12, 15;
  ...
For n = 4, the partitions are {4}, {3, 1}, {2, 2}, {2, 1, 1}, {1, 1, 1, 1}. The partition {2, 2} has Durfee square s = 2; for all partitions except {2, 2}, we have Durfee square with s = 1. Therefore we have two unique solutions to n - s^2 for n = 4, i.e., {0, 3}, so row 4 contains these values.
		

Crossrefs

Programs

  • Mathematica
    Array[# - Reverse@ Range[Sqrt@ #]^2 &, 625] // Flatten

Formula

Let s = floor(sqrt(n));
T(n,1) = A053186(n) = n - s;
T(n,k) = T(n,1) + partial sums of 2(s - k + 1) + 1 for 2 <= k <= s + 1.
A000196(n) = Length of row n.
A022554(n) = Sum of row n.
Last term in row n = T(n, A000196(n)) = n - 1.

A270103 Array read by antidiagonals: T(n, k) is the sum of the integer part of the n-th roots of natural numbers less than k.

Original entry on oeis.org

1, 3, 1, 6, 2, 1, 10, 3, 2, 1, 15, 5, 3, 2, 1, 21, 7, 4, 3, 2, 1, 28, 9, 5, 4, 3, 2, 1, 36, 11, 6, 5, 4, 3, 2, 1, 45, 13, 7, 6, 5, 4, 3, 2, 1, 55, 16, 9, 7, 6, 5, 4, 3, 2, 1, 66, 19, 11, 8, 7, 6, 5, 4, 3, 2, 1
Offset: 1

Views

Author

John M. Campbell, Mar 11 2016

Keywords

Examples

			The fifth entry in the second row of this array is 7, since 7 = floor(sqrt(1)) + floor(sqrt(2)) + floor(sqrt(3)) + floor(sqrt(4)) + floor(sqrt(5)).
The table array begins:
  1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
  1, 2, 3,  5,  7,  9, 11, 13, 16, 19, ...
  1, 2, 3,  4,  5,  6,  7,  9, 11, 13, ...
  1, 2, 3,  4,  5,  6,  7,  8,  9, 10, ...
  ...
		

References

  • R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete Mathematics, 2nd Edition, Addison-Wesley, 1994, Eq. 3.27 on page 87.
  • D. E. Knuth, The Art of Computer Programming, Vol. 1, 3rd Edition, Addison-Wesley, 1997, Ex. 43 of section 1.2.4.

Crossrefs

Main diagonal and each diagonal below the main diagonal: A000027.

Programs

  • Mathematica
    T[n_, k_] := (1 + k) Floor[k^(1/n)] - HarmonicNumber[Floor[k^(1/n)], -n] (* Daniel Hoying, Jun 11 2020 *)
  • PARI
    T(n, k) = sum(j=0, k, sqrtnint(j, n)); \\ Michel Marcus, Mar 12 2016

Formula

T(n,k) = Sum_{j=0..k} floor(j^(1/n)).
T(n,k) = (1+k)*floor(k^(1/n)) - (1/(n+1))*Sum_{j=1..n+1} (1 + floor(k^(1/n)))^j*binomial(n+1, j)*Bernoulli(n+1-j).
T(n,k) = (1+k)*floor(k^(1/n)) - Sum_{j=1..floor(k^(1/n))} j^n. - Daniel Hoying, Jun 11 2020

A270825 a(n) = Sum_{i=0..n} (-1)^floor(i/2)*floor(sqrt(i)).

Original entry on oeis.org

0, 1, 0, -1, 1, 3, 1, -1, 1, 4, 1, -2, 1, 4, 1, -2, 2, 6, 2, -2, 2, 6, 2, -2, 2, 7, 2, -3, 2, 7, 2, -3, 2, 7, 2, -3, 3, 9, 3, -3, 3, 9, 3, -3, 3, 9, 3, -3, 3, 10, 3, -4, 3, 10, 3, -4, 3, 10, 3, -4, 3, 10, 3, -4, 4, 12, 4, -4, 4, 12, 4, -4, 4, 12, 4, -4, 4
Offset: 0

Views

Author

John M. Campbell, Mar 23 2016

Keywords

Examples

			Letting [] denote the floor function, a(7) = [sqrt(0)]+[sqrt(1)]-[sqrt(2)]-[sqrt(3)]+[sqrt(4)]+[sqrt(5)]-[sqrt(6)]-[sqrt(7)] = 0+1-1-1+2+2-2-2 = -1.
		

Crossrefs

Programs

  • Mathematica
    Print[Table[Sum[(-1)^(Floor[i/2])*Floor[Sqrt[i]],{i,0,n}],{n,0,100}]]
  • PARI
    a(n)=sum(i=0,n,(-1)^(floor(i/2))*floor(sqrt(i)))

Formula

a(4m)=floor(sqrt(m)), a(4m+1)=floor(3/2*floor(sqrt(4m+1))), a(4m+2)=floor(sqrt(m)), a(4m+3)=-floor((1+sqrt(4m+3))/2).
Previous Showing 11-19 of 19 results.