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-10 of 25 results. Next

A119930 Sum of the numbers of the matrix A111490 along a boustrophedon path: a11, a11+a12, a11+a12+a21, etc.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 15, 18, 20, 21, 22, 23, 24, 27, 29, 30
Offset: 0

Views

Author

Keywords

Examples

			If we rewrite the matrix putting on the top the upper left edge and then we sum the numbers following a boustrophedon path we have:
.............1.\
..........._____\
........../1...1.
........./_________
.........1...2...1.\
......______________\
...../.1...2...1...1.
..../__________________
.....1...2...3...2...1.\
..______________________\
..1...2...3...1...1...1.
then
1, 1+1, 1+1+1, 1+1+1+1, 1+1+1+1+2, 1+1+1+1+2+1, 1+1+1+1+2+1+1, 1+1+1+1+2+1+1+1, 1+1+1+1+2+1+1+1+2, 1+1+1+1+2+1+1+1+2+1, ...
That is 1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 15, 18, 20, etc.
		

References

  • G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 60.

Crossrefs

Cf. A119931.

A119931 Sum of the numbers of the matrix A111490 along a boustrophedon path: a11, a11+a21, a11+a21+a21, etc.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 10, 11, 12, 13, 15, 18, 20, 21, 22, 24, 27, 28, 29, 30
Offset: 0

Views

Author

Keywords

Examples

			If we rewrite the matrix putting on the top the upper left edge and then we sum the numbers following a boustrophedon path we have:
.........../.1.
........../_____
...........1...1.\
........._________\
......./.1...2...1.
....../______________
.......1...2...1...1.\
....._________________\
.../.1...2...3...2...1.
../_____________________
...1...2...3...1...1...1.
then
1, 1+1, 1+1+1, 1+1+1+1, 1+1+1+1+2, 1+1+1+1+2+1, 1+1+1+1+2+1+1, 1+1+1+1+2+1+1+2, 1+1+1+1+2+1+1+2+1, 1+1+1+1+2+1+1+2+1+1, ...
That is 1, 2, 3, 4, 6, 7, 8, 10, 11, 12, 13, 15, 18, 20, etc.
		

References

  • G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 60.

Crossrefs

Cf. A119930.

A121896 Let M be the matrix defined in A111490. Sequence gives M(1,1), M(1,2)+M(1,2)+M(2,2), M(1,3)+M(2,3)+M(3,1)+M(3,2)+M(3,3), etc.

Original entry on oeis.org

1, 4, 8, 14, 20, 30, 37, 51, 61, 76, 89, 111, 120, 146, 165, 187, 205, 239, 255, 293, 312, 344, 375, 421, 434, 479, 516, 558, 587, 645, 664, 726, 760, 812, 861, 919, 937, 1011, 1066, 1128, 1159, 1241, 1272, 1358, 1407, 1465, 1532, 1626, 1647, 1738, 1796, 1878
Offset: 1

Views

Author

Keywords

Examples

			a(4) = 1+2+1+1+2+3+4 = 14.
		

Crossrefs

Cf. A111490.

Formula

a(n) = -M(n,n) + Sum_{i=1..n} (M(i,n) + M(n,i)).

A123326 Let M be the matrix defined in A111490. Sequence gives the sum of the elements of the submatrices (from the upper left element): M(1,1); M(1,1)+M(1,2)+M(1,2)+M(2,2); M(1,1)+M(1,2)+M(1,3)+M(2,1)+M(2,2)+M(2,3)+M(3,1)+M(3,2)+M(3,3), etc.

Original entry on oeis.org

1, 5, 13, 27, 47, 77, 114, 165, 226, 302, 391, 502, 622, 768, 933, 1120, 1325, 1564, 1819, 2112, 2424, 2768, 3143, 3564, 3998, 4477, 4993, 5551, 6138, 6783, 7447, 8173, 8933, 9745, 10606, 11525, 12462, 13473, 14539, 15667, 16826, 18067, 19339, 20697, 22104
Offset: 1

Views

Author

Keywords

Examples

			a(4) = 1+1+1+1 + 1+2+1+2 + 1+2+3+1 + 1+2+3+4 = 27.
		

Crossrefs

Formula

a(n) = Sum_{i=1..n} Sum_{j=1..n} M(i,j).
a(n) = a(n-1) + A121896(n) with a(0)=0.

A123329 Let M be the matrix defined in A111490. Sequence gives M(2,1)-M(1,2), M(2,1)+M(3,1)+M(3,2)-M(1,2)-M(1,3)-M(2,3), etc.

Original entry on oeis.org

0, 1, 3, 8, 14, 26, 39, 59, 83, 115, 148, 197, 247, 307, 376, 460, 545, 651, 758, 887, 1027, 1181, 1336, 1527, 1724, 1937, 2163, 2417, 2672, 2969, 3267, 3596, 3940, 4304, 4681, 5113, 5546, 6001, 6473, 6995, 7518, 8095, 8673, 9291, 9942, 10619, 11297, 12051
Offset: 0

Views

Author

Keywords

Comments

From Omar E. Pol, Jan 20 2021: (Start)
Conjectures:
1. Convolution of A001065 and A000027.
2. Partial sums of A153485.
3. a(n) is also the difference of volume (the difference of number of cells) between two polycubes: the stepped pyramid described in A245092 which has volume A175254(n) and the stepped pyramid that represents the n-th tetrahedral number which has volume A000292(n).
In the three conjectures assuming that here the offset is 1.
For more information about the first pyramid see A237593. (End)

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, [0$2], (p-> p
          +[numtheory[sigma](n)-n$2]+[0, p[1]])(b(n-1)))
        end:
    a:= n-> b(n+1)[2]:
    seq(a(n), n=0..50);  # Alois P. Heinz, Jan 21 2021
  • Mathematica
    b[n_] := b[n] = If[n == 0, {0, 0}, With[{p = b[n-1]}, p +
         DivisorSigma[1, n] - n + {0, p[[1]]}]];
    a[n_] := b[n+1][[2]];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Jul 10 2021, after Alois P. Heinz *)
  • Python
    def M(n,k): return 1 + (k-1)%n
    def a(n):
      return sum(M(i,j)-M(j,i) for i in range(2, n+3) for j in range(1, i))
    print([a(n) for n in range(48)]) # Michael S. Branicky, Jan 20 2021

Formula

a(n) = binomial(n+2,3) - A072481(n+1). - Robert Israel, Aug 13 2015
a(n) = A175254(n+1) - A000292(n+1), conjectured by Omar E. Pol, Jan 20 2021
a(n) = Sum_{i=2..(n+2)} Sum_{j=1..i-1} (M(i,j)-M(j,i)). - Michael S. Branicky, Jan 20 2021

Extensions

a(14) and beyond from Michael S. Branicky, Jan 20 2021

A123328 Let M be the matrix defined in A111490. Sequence gives M(1,1), M(1,2)+M(1,2)+M(2,2), M(1,3)+M(2,3)+M(3,1)+M(3,2)+M(3,3), etc.

Original entry on oeis.org

1, 3, 5, 9, 11, 19, 18, 33, 28, 48, 41, 70, 50, 96, 69, 118, 87, 152
Offset: 0

Views

Author

Keywords

Examples

			a(4)= 1+2+3+4+1+2+1 - (1+2+3+1+1) + (1+2+1) - 1 = 9
		

Crossrefs

Formula

a(n)= Sum_{j=1..n} |[Sum_{i=1..j} M(i,j) + Sum_{i=1..j} M(j,i) - M(j,j)](-1)^j| Let b(n) be the numbers of the sequence A123326: a(n)= b(n)+2*[(-1)^(n+1)]*Sum_{i=n-1..1} b(i) for n even a(n)= b(n)+2*[(-1)^n]*Sum_{i=n-1..1} b(i) for n odd

A174112 After correction, duplicate of A111490.

Original entry on oeis.org

1, 2, 4, 5, 9, 9, 15, 16, 21, 23, 33, 29, 41, 45, 51, 52, 68, 65, 83, 81, 91, 99, 121, 109, 128, 138, 152, 152, 180, 168, 198, 199, 217, 231, 253, 234, 270, 286, 308, 298, 338, 326, 368
Offset: 1

Views

Author

Keywords

Formula

a(n) = Sum_{i=1..n} A033879(i) = Sum_{i=1..n} (2*i - (sum of divisors of i)) = Sum_{i=1..n} (A005843(i)-A000203(i) = Sum_{i=1..n}(A005843(i) - Sum{i=1..n} A000203(i).

A004125 Sum of remainders of n mod k, for k = 1, 2, 3, ..., n.

Original entry on oeis.org

0, 0, 1, 1, 4, 3, 8, 8, 12, 13, 22, 17, 28, 31, 36, 36, 51, 47, 64, 61, 70, 77, 98, 85, 103, 112, 125, 124, 151, 138, 167, 167, 184, 197, 218, 198, 233, 248, 269, 258, 297, 284, 325, 328, 339, 358, 403, 374, 414, 420, 449, 454, 505, 492, 529, 520, 553, 578, 635, 586, 645, 672
Offset: 1

Views

Author

Keywords

Comments

Row sums of A051778, A048158. Antidiagonal sums of A051127. - L. Edson Jeffery, Mar 03 2012
Let u_m(n) = Sum_{k=1..n} (n^m mod k^m) with m integer. As n-->+oo, u_m(n) ~ (n^(m+1))*(1-(1/(m+1))*Zeta(1+1/m)). Proof: using Riemann sums, we have u_m(n) ~ (n^(m+1))*int(((1/x)[nonascii character here])*(1-floor(x^m)/(x^m)),x=1..+oo) and the result follows. - Yalcin Aktar, Jul 30 2008 [x is the real variable of integration. The nonascii character (which was illegible in the original message) is probably some form of multiplication sign. I suggest that we leave it the way it is for now. - N. J. A. Sloane, Dec 07 2014]
Also the alternating row sums of A236112. - Omar E. Pol, Jan 26 2014
If n is prime then a(n) = a(n-1) + n - 2. - Omar E. Pol, Mar 19 2014
If n is a power of 2 greater than 1, then a(n) = a(n-1). - David Morales Marciel, Oct 21 2015
It appears that if n is an even perfect number, then a(n) = a(n-1) - 1. - Omar E. Pol, Oct 21 2015
Partial sums of A235796. - Omar E. Pol, Jun 26 2016
Aside from a(n) = a(n-1) for n = 2^m, the only values appearing more than once among the first 6*10^8 terms are those at n = 38184 +- 1, 458010 +- 1, 776112 +- 1, 65675408 +- 1, and 113393280 +- 2. - Trevor Cappallo, Jun 07 2021
The off-by-1 terms in the comment above are the terms of A068077. Proof: If a(n-1) = a(n+1), then (n-1)^2 - Sum_{k=1..n-1} sigma(k) = (n+1)^2 - Sum_{k=1..n+1} sigma(k) via the formula; rearranging terms gives sigma(n)+sigma(n+1)=4n. - Lewis Chen, Sep 24 2021

Examples

			a(5) = 4. The remainder when 5 is divided by 2,3,4 respectively is 1,2,1 and their sum = 4.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000290, A006218, A023196, A048158, A050482, A051778, A120444 (first differences).

Programs

  • GAP
    List([1..70],n->n^2-Sum([1..n],k->Sigma(k))); # Muniru A Asiru, Mar 28 2018
    
  • Haskell
    a004125 n = sum $ map (mod n) [1..n]
    -- Reinhard Zumkeller, Jan 28 2011
    
  • Magma
    [&+[n mod r: r in [1..n]]: n in [1..70]]; // Bruno Berselli, Jul 06 2014
    
  • Maple
    A004125 := n -> add( modp(n,k), k=2..n); /* much faster and unambiguous; "a mod b" may be mods(a,b) */ # M. F. Hasler, Nov 22 2007
  • Mathematica
    Table[Sum[Mod[n,k],{k,2,n-1}],{n,70}] (* Harvey P. Dale, Nov 23 2011 *)
    Accumulate[Table[2n-1-DivisorSigma[1,n],{n,70}]] (* Harvey P. Dale, Jul 11 2014 *)
  • PARI
    A004125(n)=sum(k=2,n,n%k) \\ M. F. Hasler, Nov 22 2007
    
  • Python
    def a(n): return sum(n%k for k in range(1, n))
    print([a(n) for n in range(1, 63)]) # Michael S. Branicky, Jun 08 2021
    
  • Python
    from math import isqrt
    def A004125(n): return n**2+((s:=isqrt(n))**2*(s+1)-sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))>>1) # Chai Wah Wu, Oct 21 2023
    
  • SageMath
    def a(n): return sum(n.mod(k) for k in (1..n))
    print([a(n) for n in (1..62)])  # Peter Luschny, May 12 2025

Formula

a(n) = n^2 - Sum_{k=1..n} sigma(k) = A000290(n) - A024916(n), hence asymptotically a(n) = n^2*(1-Pi^2/12) + O(n*log(n)^(2/3)). - Benoit Cloitre, Apr 28 2002. Asymptotics corrected/improved by Charles R Greathouse IV, Feb 22 2015
a(n) = A008805(n-3) + A049798(n-1), for n > 2. - Carl Najafi, Jan 31 2013
a(n) = A000217(n-1) - A153485(n). - Omar E. Pol, Jan 28 2014
G.f.: x^2/(1-x)^3 - (1-x)^(-1) * Sum_{k>=1} k*x^(2*k)/(1-x^k). - Robert Israel, Aug 13 2015
a(n) = Sum_{i=1..n} (n mod i). - Wesley Ivan Hurt, Sep 15 2017
From Ridouane Oudra, May 12 2025: (Start)
a(n) = A067439(n) + A072514(n).
a(n) = Sum_{d|n} d*A067439(n/d).
a(p) = A067439(p), for p prime.
a(p^k) = A072514(p^(k+1))/p, for p prime and k >= 0. (End)
a(n) = A111490(n) - n. - Peter Luschny, May 12 2025

Extensions

Edited by M. F. Hasler, Apr 18 2015

A158040 Determinant of power series of gamma matrix with determinant 2!.

Original entry on oeis.org

2, 32, 258, 1664, 9710, 53664, 286762, 1497600, 7691238, 38995360, 195696226, 973894272, 4812812446, 23642953376, 115552680090, 562240972800, 2724987988054, 13161369525408, 63371643947474, 304287501281920, 1457424739149582, 6964697175476128
Offset: 1

Views

Author

Keywords

Comments

a(n) = Determinant(A + A^2 + A^3 + A^4 + A^5 + ... + A^n) where A is the submatrix A(1..3,1..3) of the matrix with factorial determinant A = [[1,1,1,1,1,1,...],[1,2,1,2,1,2,...], [1,2,3,1,2,3,...], [1,2,3,4,1,2,...], [1,2,3,4,5,1,...], [1,2,3,4,5,6,...], ...]; note: Determinant A(1..n,1..n) = (n-1)!.

Examples

			a(1) = Determinant(A) = 2! = 2.
		

References

  • G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008.

Crossrefs

Cf. A111490.

Programs

  • Maple
    seq(Determinant(sum(A2^i,i=1..n)),n=1..30);
  • PARI
    vector(100, n, matdet(sum(k=1, n, [1,1,1 ; 1,2,1 ; 1,2,3]^k))) \\ Colin Barker, Jul 13 2014

Formula

Empirical g.f.: 2*x*(8*x^6 -50*x^4 +64*x^3 -25*x^2 +1) / ((x -1)^2*(2*x -1)^2*(2*x^2 -5*x +1)^2). - Colin Barker, Jul 13 2014

Extensions

More terms, and offset changed to 1 by Colin Barker, Jul 13 2014

A067439 a(n) = sum of all the remainders when n is divided by positive integers less than and coprime to n.

Original entry on oeis.org

0, 0, 1, 1, 4, 1, 8, 6, 9, 5, 22, 8, 28, 15, 19, 20, 51, 20, 64, 30, 39, 33, 98, 33, 83, 56, 89, 55, 151, 46, 167, 95, 107, 95, 150, 71, 233, 120, 172, 106, 297, 92, 325, 163, 186, 162, 403, 144, 358, 189, 279, 217, 505, 173, 375, 230, 342, 276, 635, 165, 645, 338
Offset: 1

Views

Author

Amarnath Murthy, Jan 29 2002

Keywords

Examples

			a(8) = 6. The remainders when 8 is divided by the coprime numbers 1, 3, 5 and 7 are 0, 2, 3 and 1, whose sum = 6.
		

Crossrefs

Programs

  • Maple
    a := n -> add(ifelse(igcd(n, i) = 1, irem(n, i), 0), i = 1..n-1):
    seq(a(n), n = 1..62);  # Peter Luschny, May 14 2025
  • Mathematica
    a[n_] := Sum[If[GCD[i, n]>1, 0, Mod[n, i]], {i, 1, n-1}]
    Table[Total[Mod[n,#]&/@Select[Range[n-1],CoprimeQ[#,n]&]],{n,70}] (* Harvey P. Dale, May 22 2012 *)
  • PARI
    a(n)=sum(i=1,n-1,if(gcd(n,i)==1,n%i)) \\ Charles R Greathouse IV, Jul 17 2012

Formula

From Ridouane Oudra, May 14 2025: (Start)
a(n) = A004125(n) - A072514(n).
a(n) = Sum_{d|n} d*mu(d)*A004125(n/d).
a(n) = Sum_{d|n} mu(d)*f(n,d), where f(n,d) = Sum_{i=1..n/d} (n mod d*i).
a(p) = A004125(p), for p prime.
a(p^k) = A004125(p^k) - p*A004125(p^(k-1)), for p prime and k >= 0.
a(p^k) = A072514(p^(k+1))/p - A072514(p^k), for p prime and k >= 0. (End)

Extensions

Edited by Dean Hickerson, Feb 15 2002
Showing 1-10 of 25 results. Next