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 14 results. Next

A003462 a(n) = (3^n - 1)/2.

Original entry on oeis.org

0, 1, 4, 13, 40, 121, 364, 1093, 3280, 9841, 29524, 88573, 265720, 797161, 2391484, 7174453, 21523360, 64570081, 193710244, 581130733, 1743392200, 5230176601, 15690529804, 47071589413, 141214768240, 423644304721, 1270932914164
Offset: 0

Views

Author

Keywords

Comments

Partial sums of A000244. Values of base 3 strings of 1's.
a(n) = (3^n-1)/2 is also the number of different nonparallel lines determined by pair of vertices in the n dimensional hypercube. Example: when n = 2 the square has 4 vertices and then the relevant lines are: x = 0, y = 0, x = 1, y = 1, y = x, y = 1-x and when we identify parallel lines only 4 remain: x = 0, y = 0, y = x, y = 1 - x so a(2) = 4. - Noam Katz (noamkj(AT)hotmail.com), Feb 11 2001
Also number of 3-block bicoverings of an n-set (if offset is 1, cf. A059443). - Vladeta Jovovic, Feb 14 2001
3^a(n) is the highest power of 3 dividing (3^n)!. - Benoit Cloitre, Feb 04 2002
Apart from the a(0) and a(1) terms, maximum number of coins among which a lighter or heavier counterfeit coin can be identified (but not necessarily labeled as heavier or lighter) by n weighings. - Tom Verhoeff, Jun 22 2002, updated Mar 23 2017
n such that A001764(n) is not divisible by 3. - Benoit Cloitre, Jan 14 2003
Consider the mapping f(a/b) = (a + 2b)/(2a + b). Taking a = 1, b = 2 to start with and carrying out this mapping repeatedly on each new (reduced) rational number gives the sequence 1/2, 4/5, 13/14, 40/41, ... converging to 1. Sequence contains the numerators = (3^n-1)/2. The same mapping for N, i.e., f(a/b) = (a + Nb)/(a+b) gives fractions converging to N^(1/2). - Amarnath Murthy, Mar 22 2003
Binomial transform of A000079 (with leading zero). - Paul Barry, Apr 11 2003
With leading zero, inverse binomial transform of A006095. - Paul Barry, Aug 19 2003
Number of walks of length 2*n + 2 in the path graph P_5 from one end to the other one. Example: a(2) = 4 because in the path ABCDE we have ABABCDE, ABCBCDE, ABCDCDE and ABCDEDE. - Emeric Deutsch, Apr 02 2004
The number of triangles of all sizes (not counting holes) in Sierpiński's triangle after n inscriptions. - Lee Reeves (leereeves(AT)fastmail.fm), May 10 2004
Number of (s(0), s(1), ..., s(2n+1)) such that 0 < s(i) < 6 and |s(i) - s(i-1)| = 1 for i = 1, 2, ..., 2*n + 1, s(0) = 1, s(2n+1) = 4. - Herbert Kociemba, Jun 10 2004
Number of non-degenerate right-angled incongruent integer-edged Heron triangles whose circumdiameter is the product of n distinct primes of shape 4k + 1. - Alex Fink and R. K. Guy, Aug 18 2005
Also numerator of the sum of the reciprocals of the first n powers of 3, with A000244 being the sequence of denominators. With the exception of n < 2, the base 10 digital root of a(n) is always 4. In base 3 the digital root of a(n) is the same as the digital root of n. - Alonso del Arte, Jan 24 2006
The sequence 3*a(n), n >= 1, gives the number of edges of the Hanoi graph H_3^{n} with 3 pegs and n >= 1 discs. - Daniele Parisse, Jul 28 2006
Numbers n such that a(n) is prime are listed in A028491 = {3, 7, 13, 71, 103, 541, 1091, ...}. 2^(m+1) divides a(2^m*k) for m > 0. 5 divides a(4k). 5^2 divides a(20k). 7 divides a(6k). 7^2 divides a(42k). 11^2 divides a(5k). 13 divides a(3k). 17 divides a(16k). 19 divides a(18k). 1093 divides a(7k). 41 divides a(8k). p divides a((p-1)/5) for prime p = {41, 431, 491, 661, 761, 1021, 1051, 1091, 1171, ...}. p divides a((p-1)/4) for prime p = {13, 109, 181, 193, 229, 277, 313, 421, 433, 541, ...}. p divides a((p-1)/3) for prime p = {61, 67, 73, 103, 151, 193, 271, 307, 367, ...} = A014753, 3 and -3 are both cubes (one implies other) mod these primes p = 1 mod 6. p divides a((p-1)/2) for prime p = {11, 13, 23, 37, 47, 59, 61, 71, 73, 83, 97, ...} = A097933(n). p divides a(p-1) for prime p > 7. p^2 divides a(p*(p-1)k) for all prime p except p = 3. p^3 divides a(p*(p-1)*(p-2)k) for prime p = 11. - Alexander Adamchuk, Jan 22 2007
Let P(A) be the power set of an n-element set A. Then a(n) = the number of [unordered] pairs of elements {x,y} of P(A) for which x and y are disjoint [and both nonempty]. Wieder calls these "disjoint usual 2-combinations". - Ross La Haye, Jan 10 2008 [This is because each of the elements of {1, 2, ..., n} can be in the first subset, in the second or in neither. Because there are three options for each, the total number of options is 3^n. However, since the sets being empty is not an option we subtract 1 and since the subsets are unordered we then divide by 2! (The number of ways two objects can be arranged.) Thus we obtain (3^n-1)/2 = a(n). - Chayim Lowen, Mar 03 2015]
Also, still with P(A) being the power set of a n-element set A, a(n) is the number of 2-element subsets {x,y} of P(A) such that the union of x and y is equal to A. Cf. A341590. - Fabio Visonà, Feb 20 2021
Starting with offset 1 = binomial transform of A003945: (1, 3, 6, 12, 24, ...) and double bt of (1, 2, 1, 2, 1, 2, ...); equals polcoeff inverse of (1, -4, 3, 0, 0, 0, ...). - Gary W. Adamson, May 28 2009
Also the constant of the polynomials C(x) = 3x + 1 that form a sequence by performing this operation repeatedly and taking the result at each step as the input at the next. - Nishant Shukla (n.shukla722(AT)gmail.com), Jul 11 2009
It appears that this is A120444(3^n-1) = A004125(3^n) - A004125(3^n-1), where A004125 is the sum of remainders of n mod k for k = 1, 2, 3, ..., n. - John W. Layman, Jul 29 2009
Subsequence of A134025; A171960(a(n)) = a(n). - Reinhard Zumkeller, Jan 20 2010
Let A be the Hessenberg matrix of order n, defined by: A[1,j] = 1, A[i, i] := 3, (i > 1), A[i, i-1] = -1, and A[i, j] = 0 otherwise. Then, for n >= 1, a(n) = det(A). - Milan Janjic, Jan 27 2010
This is the sequence A(0, 1; 2, 3; 2) = A(0, 1; 4, -3; 0) of the family of sequences [a, b:c, d:k] considered by Gary Detlefs, and treated as A(a, b; c, d; k) in the Wolfdieter Lang link given below. - Wolfdieter Lang, Oct 18 2010
It appears that if s(n) is a first order rational sequence of the form s(0) = 0, s(n) = (2*s(n-1)+1)/(s(n-1)+2), n > 0, then s(n)= a(n)/(a(n)+1). - Gary Detlefs, Nov 16 2010
This sequence also describes the total number of moves to solve the [RED ; BLUE ; BLUE] or [RED ; RED ; BLUE] pre-colored Magnetic Towers of Hanoi puzzle (cf. A183111 - A183125).
From Adi Dani, Jun 08 2011: (Start)
a(n) is number of compositions of odd numbers into n parts less than 3. For example, a(3) = 13 and there are 13 compositions odd numbers into 3 parts < 3:
1: (0, 0, 1), (0, 1, 0), (1, 0, 0);
3: (0, 1, 2), (0, 2, 1), (1, 0, 2), (1, 2, 0), (2, 0, 1), (2, 1, 0), (1, 1, 1);
5: (1, 2, 2), (2, 1, 2), (2, 2, 1).
(End)
Pisano period lengths: 1, 2, 1, 2, 4, 2, 6, 4, 1, 4, 5, 2, 3, 6, 4, 8, 16, 2, 18, 4, ... . - R. J. Mathar, Aug 10 2012
a(n) is the total number of holes (triangles removed) after the n-th step of a Sierpiński triangle production. - Ivan N. Ianakiev, Oct 29 2013
a(n) solves Sum_{j = a(n) + 1 .. a(n+1)} j = k^2 for some integer k, given a(0) = 0 and requiring smallest a(n+1) > a(n). Corresponding k = 3^n. - Richard R. Forberg, Mar 11 2015
a(n+1) equals the number of words of length n over {0, 1, 2, 3} avoiding 01, 02 and 03. - Milan Janjic, Dec 17 2015
For n >= 1, a(n) is also the total number of words of length n, over an alphabet of three letters, such that one of the letters appears an odd number of times (See A006516 for 4 letter words, and the Balakrishnan reference there). - Wolfdieter Lang, Jul 16 2017
Also, the number of maximal cliques, maximum cliques, and cliques of size 4 in the n-Apollonian network. - Andrew Howroyd, Sep 02 2017
For n > 1, the number of triangles (cliques of size 3) in the (n-1)-Apollonian network. - Andrew Howroyd, Sep 02 2017
a(n) is the largest number that can be represented with n trits in balanced ternary. Correspondingly, -a(n) is the smallest number that can be represented with n trits in balanced ternary. - Thomas König, Apr 26 2020
These form Sierpinski nesting-stars, which alternate pattern on 3^n+1/2 star numbers A003154, based on the square configurations of 9^n. The partial sums of 3^n are delineated according to the geometry of a hexagram, see illustrations in links. (3*a(n-1) + 1) create Sierpinski-anti-triangles, representing the number of holes in a (n+1) Sierpinski triangle (see illustrations). - John Elias, Oct 18 2021
For n > 1, a(n) is the number of iterations necessary to calculate the hyperbolic functions with CORDIC. - Mathias Zechmeister, Jul 26 2022
a(n) is the least number k such that A065363(k) = n. - Amiram Eldar, Sep 03 2022
For all n >= 0, Sum_{k=a(n)+1..a(n+1)} 1/k < Sum_{j=a(n+1)+1..a(n+2)} 1/j. These are the minimal points which partition the infinite harmonic series into a monotonically increasing sequence. Each partition approximates log(3) from below as n tends to infinity. - Joseph Wheat, Apr 15 2023
a(n) is also the number of 3-cycles in the n-Dorogovtsev-Goltsev-Mendes graph (using the convention the 0-Dorogovtsev-Goltsev-Mendes graph is P_2). - Eric W. Weisstein, Dec 06 2023

Examples

			There are 4 3-block bicoverings of a 3-set: {{1, 2, 3}, {1, 2}, {3}}, {{1, 2, 3}, {1, 3}, {2}}, {{1, 2, 3}, {1}, {2, 3}} and {{1, 2}, {1, 3}, {2, 3}}.
Ternary........Decimal
0.................0
1.................1
11................4
111..............13
1111.............40 etc. - _Zerinvary Lajos_, Jan 14 2007
There are altogether a(3) = 13 three letter words over {A,B,C} with say, A, appearing an odd number of times: AAA; ABC, ACB, ABB, ACC; BAC, CAB, BAB, CAC; BCA, CBA, BBA, CCA. - _Wolfdieter Lang_, Jul 16 2017
		

References

  • J. G. Mauldon, Strong solutions for the counterfeit coin problem, IBM Research Report RC 7476 (#31437) 9/15/78, IBM Thomas J. Watson Research Center, P. O. Box 218, Yorktown Heights, N. Y. 10598.
  • Paulo Ribenboim, The Book of Prime Number Records, Springer-Verlag, NY, 2nd ed., 1989, p. 60.
  • Paulo Ribenboim, The Little Book of Big Primes, Springer-Verlag, NY, 1991, p. 53.
  • Amir Sapir, The Tower of Hanoi with Forbidden Moves, The Computer J. 47 (1) (2004) 20, case three-in-a row, sequence a(n).
  • Robert Sedgewick, Algorithms, 1992, pp. 109.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Sequences used for Shell sort: A033622, A003462, A036562, A036564, A036569, A055875.
Cf. A179526 (repeats), A113047 (characteristic function).
Cf. A000225, A000392, A004125, A014753, A028491 (indices of primes), A059443 (column k = 3), A065363, A097933, A120444, A321872 (sum reciprocals).
Cf. A064099 (minimal number of weightings to detect lighter or heavier coin among n coins).
Cf. A039755 (column k = 1).
Cf. A006516 (binomial transform, and special 4 letter words).
Cf. A341590.
Cf. A003462(n) (3-cycles), A367967(n) (5-cycles), A367968(n) (6-cycles).

Programs

Formula

G.f.: x/((1-x)*(1-3*x)).
a(n) = 4*a(n-1) - 3*a(n-2), n > 1. a(0) = 0, a(1) = 1.
a(n) = 3*a(n-1) + 1, a(0) = 0.
E.g.f.: (exp(3*x) - exp(x))/2. - Paul Barry, Apr 11 2003
a(n+1) = Sum_{k = 0..n} binomial(n+1, k+1)*2^k. - Paul Barry, Aug 20 2004
a(n) = Sum_{i = 0..n-1} 3^i, for n > 0; a(0) = 0.
a(n) = A125118(n, 2) for n > 1. - Reinhard Zumkeller, Nov 21 2006
a(n) = StirlingS2(n+1, 3) + StirlingS2(n+1, 2). - Ross La Haye, Jan 10 2008
a(n) = Sum_{k = 0..n} A106566(n, k)*A106233(k). - Philippe Deléham, Oct 30 2008
a(n) = 2*a(n-1) + 3*a(n-2) + 2, n > 1. - Gary Detlefs, Jun 21 2010
a(n) = 3*a(n-1) + a(n-2) - 3*a(n-3) = 5*a(n-1) - 7*a(n-2) + 3*a(n-3), a(0) = 0, a(1) = 1, a(2) = 4. Observation by G. Detlefs. See the W. Lang comment and link. - Wolfdieter Lang, Oct 18 2010
A008344(a(n)) = 0, for n > 1. - Reinhard Zumkeller, May 09 2012
A085059(a(n)) = 1 for n > 0. - Reinhard Zumkeller, Jan 31 2013
G.f.: Q(0)/2 where Q(k) = 1 - 1/(9^k - 3*x*81^k/(3*x*9^k - 1/(1 - 1/(3*9^k - 27*x*81^k/(9*x*9^k - 1/Q(k+1)))))); (continued fraction ). - Sergei N. Gladkovskii, Apr 12 2013
a(n) = A001065(3^n) where A001065(m) is the sum of the proper divisors of m for positive integer m. - Chayim Lowen, Mar 03 2015
a(n) = A000244(n) - A007051(n) = A007051(n)-1. - Yuchun Ji, Oct 23 2018
Sum_{n>=1} 1/a(n) = A321872. - Amiram Eldar, Nov 18 2020

Extensions

More terms from Michael Somos
Corrected my comment of Jan 10 2008. - Ross La Haye, Oct 29 2008
Removed comment that duplicated a formula. - Joerg Arndt, Mar 11 2010

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

A236112 Triangle read by rows: T(n,k), n>=1, k>=1, in which column k lists k+1 copies of the squares in nondecreasing order, and the first element of column k is in row k(k+1)/2.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Jan 23 2014

Keywords

Comments

Gives an identity for the sum of remainders of n mod k, for k = 1,2,3,...,n. Alternating sum of row n equals A004125(n), i.e., Sum_{k=1..A003056(n)} (-1)^(k-1)*T(n,k) = A004125(n).
Row n has length A003056(n) hence the first element of column k is in row A000217(k).

Examples

			Triangle begins:
    0;
    0;
    1,   0;
    1,   0;
    4,   0;
    4,   1,   0;
    9,   1,   0;
    9,   1,   0;
   16,   4,   0;
   16,   4,   1,   0;
   25,   4,   1,   0;
   25,   9,   1,   0;
   36,   9,   1,   0;
   36,   9,   4,   0;
   49,  16,   4,   1,  0;
   49,  16,   4,   1,  0;
   64,  16,   4,   1,  0;
   64,  25,   9,   1,  0;
   81,  25,   9,   1,  0;
   81,  25,   9,   4,  0;
  100,  36,   9,   4,  1,  0;
  100,  36,  16,   4,  1,  0;
  121,  36,  16,   4,  1,  0;
  121,  49,  16,   4,  1,  0;
  ...
For n = 24 the 24th row of triangle is 121, 49, 16, 4, 1, 0 therefore the alternating row sum is 121 - 49 + 16 - 4 + 1 - 0 = 85 equaling A004125(24).
		

Crossrefs

A235796 2*n - 1 - sigma(n).

Original entry on oeis.org

0, 0, 1, 0, 3, -1, 5, 0, 4, 1, 9, -5, 11, 3, 5, 0, 15, -4, 17, -3, 9, 7, 21, -13, 18, 9, 13, -1, 27, -13, 29, 0, 17, 13, 21, -20, 35, 15, 21, -11, 39, -13, 41, 3, 11, 19, 45, -29, 40, 6, 29, 5, 51, -13, 37, -9, 33, 25, 57, -49, 59, 27, 21, 0, 45, -13, 65, 9, 41
Offset: 1

Views

Author

Omar E. Pol, Jan 25 2014

Keywords

Comments

Partial sums give A004125.
Also 0 together with A120444.
It appears that a(n) = 0 iff n is a power of 2.
Numbers n with a(n) = 0 are called "almost perfect", "least deficient" or "slightly defective" numbers. See A000079. - Robert Israel, Jul 22 2014
a(n) = n - 2 iff n is prime.
a(n) = -1 iff n is a perfect number.
Also the alternating row sums of A239446. - Omar E. Pol, Jul 21 2014

Examples

			.     The positive     The sum of
n     odd numbers     divisors of n.      a(n)
1          1                1               0
2          3                3               0
3          5                4               1
4          7                7               0
5          9                6               3
6         11               12              -1
7         13                8               5
8         15               15               0
9         17               13               4
10        19               18               1
...
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, New York, 2004.

Crossrefs

Programs

  • Magma
    [2*n-1-SumOfDivisors(n): n in [1..100]]; // Vincenzo Librandi, Feb 25 2014
  • Mathematica
    Table[2n-1-DivisorSigma[1,n],{n,70}] (* Harvey P. Dale, Jul 11 2014 *)
  • PARI
    vector(100, n, (2*n-1)-sigma(n)) \\ Colin Barker, Jan 27 2014
    

Formula

a(n) = A005408(n-1) - A000203(n).
a(n) = -1 - A033880(n). - Michel Marcus, Jan 27 2014
a(n) = n - 1 - A001065(n). - Omar E. Pol, Jan 29 2014
a(n) = A033879(n) - 1. - Omar E. Pol, Jan 30 2014
a(n) = 2*n - 2 - A039653(n). - Omar E. Pol, Jan 31 2014
a(n) = (-1)*A237588(n). - Omar E. Pol, Feb 23 2014
a(n) = 2*n - A088580(n). - Omar E. Pol, Mar 23 2014

A235794 Triangle read by rows: T(n,k), n>=1, k>=1, in which column k starts with k zeros and then lists the odd numbers interleaved with k zeros, and the first element of column k is in row k(k+1)/2.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Jan 23 2014

Keywords

Comments

It appears that the alternating row sums give A120444, the first differences of A004125, i.e., Sum_{k=1..A003056(n)} (-1)^(k-1)*T(n,k) = A120444(n).
Row n has length A003056(n) hence the first element of column k is in row A000217(k).

Examples

			Triangle begins:
  0;
  1;
  0,  0;
  3,  0;
  0,  1;
  5,  0,  0;
  0,  0,  0;
  7,  3,  0;
  0,  0,  1;
  9,  0,  0,  0;
  0,  5,  0,  0;
  11, 0,  0,  0;
  0,  0,  3,  0;
  13, 7,  0,  1;
  0,  0,  0,  0,  0;
  15, 0,  0,  0,  0;
  0,  9,  5,  0,  0;
  17, 0,  0,  0,  0;
  0,  0,  0,  3,  0;
  19, 11, 0,  0,  1;
  0,  0,  7,  0,  0,  0;
  21, 0,  0,  0,  0,  0;
  0,  13, 0,  0,  0,  0;
  23, 0,  0,  5,  0,  0;
  ...
For n = 14 the 14th row of triangle is 13, 7, 0, 1, and the alternating sum is 13 - 7 + 0 - 1 = 5, the same as A120444(14) = 5.
		

Crossrefs

A163553 First differences of A024816.

Original entry on oeis.org

0, 2, 1, 6, 0, 11, 1, 11, 5, 17, -4, 27, 4, 15, 9, 30, -3, 38, -2, 31, 18, 35, -12, 54, 15, 29, 12, 55, -12, 71, 1, 48, 28, 41, -7, 90, 16, 43, 6, 89, -12, 95, 4, 51, 52, 71, -28, 116, 14, 72, 26, 97, -12, 103, 8, 97, 48, 89, -48, 167, 28, 55, 41, 108, 6, 143, 10, 99, 22, 143
Offset: 1

Views

Author

John W. Layman, Jul 30 2009

Keywords

Comments

A024816(n) is the sum of the non-divisors k of n for k=2,3,...,n-1.
It appears that (1) a(n) = A120444(n)+1 if and only if n is a prime, (2) if a(n)<0 then A120444(n)<0, and (3) a(n)<=0 whenever n is of the form 6k-1. Are these conjectures easy to prove/disprove? (A120444 is the first difference of A004125 Sum of remainders of n mod k, for k = 1,2,3,...,n).

Crossrefs

Programs

  • Mathematica
    Differences[Table[Total[Complement[Range[n],Divisors[n]]],{n,80}]] (* Harvey P. Dale, Mar 05 2013 *)
  • PARI
    a(n) = n + 1 + sigma(n) - sigma(n+1); \\ Michel Marcus, Jul 29 2017

A235799 a(n) = n^2 - sigma(n).

Original entry on oeis.org

0, 1, 5, 9, 19, 24, 41, 49, 68, 82, 109, 116, 155, 172, 201, 225, 271, 285, 341, 358, 409, 448, 505, 516, 594, 634, 689, 728, 811, 828, 929, 961, 1041, 1102, 1177, 1205, 1331, 1384, 1465, 1510, 1639, 1668, 1805, 1852, 1947, 2044, 2161, 2180, 2344, 2407
Offset: 1

Views

Author

Omar E. Pol, Jan 24 2014

Keywords

Comments

From Omar E. Pol, Apr 11 2021: (Start)
If n is prime (A000040) then a(n) = n^2 - n - 1.
If n is a power of 2 (A000079) then a(n) = (n-1)^2.
If n is a perfect number (A000396) then a(n) = (n-1)^2 - 1, assuming there are no odd perfect numbers.
In order to construct the diagram of the symmetric representation of a(n) we use the following rules:
At stage 1 in the first quadrant of the square grid we draw the symmetric representation of sigma(n) using the two Dyck paths described in the rows n and n-1 of A237593. The area of the region that is below the symmetric representation of sigma(n) equals A024916(n-1).
At stage 2 we draw a pair of orthogonal line segments (if it's necessary) such that in the drawing appears totally formed a square n X n. The area of the region that is above the symmetric representation of sigma(n) equals A004125(n).
At stage 3 we turn OFF the cells of the symmetric representation of sigma(n). Then we turn ON the rest of the cells that are in the square n X n. The result is that the ON cell form the diagram of the symmetric representation of a(n). See the Example section. (End)

Examples

			From _Omar E. Pol, Apr 04 2021: (Start)
Illustration of initial terms in the first quadrant for n = 1..6:
.
.                                                             y|        _ _
.                                              y|      _ _     |_ _ _  |_  |
.                                 y|      _     |_ _ _|   |    |     |   |_|
.                      y|    _     |_ _  |_|    |        _|    |     |_ _
.             y|        |_ _|_|    |   |_       |       |      |         |
.      y|      |_       |   |      |     |      |       |      |         |
.       |_ _   |_|_ _   |_ _|_ _   |_ _ _|_ _   |_ _ _ _|_ _   |_ _ _ _ _|_ _
.          x        x          x            x              x                x
.
n:        1       2         3           4             5               6
a(n):     0       1         5           9            19              24
.
Illustration of initial terms in the first quadrant for n = 7..9:
.                                                y|          _ _ _ _
.                          y|          _ _ _      |_ _ _ _ _|       |
.      y|        _ _ _      |_ _ _ _  |     |     |          _ _    |
.       |_ _ _ _|     |     |       | |_    |     |         |_  |   |
.       |             |     |       |_  |_ _|     |           |_|  _|
.       |            _|     |         |_ _        |               |
.       |           |       |             |       |               |
.       |           |       |             |       |               |
.       |           |       |             |       |               |
.       |_ _ _ _ _ _|_ _    |_ _ _ _ _ _ _|_ _    |_ _ _ _ _ _ _ _|_ _
.                      x                     x                       x
.
n:              7                    8                      9
a(n):          41                   49                     68
.
For n = 9 the figures 1, 2 and 3 below show respectively the three stages described in the Comments section as follows:
.
.   y|_ _ _ _ _ 5            y|_ _ _ _ _ _ _ _ _      y|          _ _ _ _
.    |_ _ _ _ _|              |_ _ _ _ _|       |      |_ _ _ _ _|       |
.    |         |_ _ 3         |         |_ _ R  |      |          _ _    |
.    |         |_  |          |         |_  |   |      |         |_  |   |
.    |           |_|_ _ 5     |           |_|_ _|      |           |_|  _|
.    |               | |      |               | |      |               |
.    |      Q        | |      |       Q       | |      |               |
.    |               | |      |               | |      |               |
.    |               | |      |               | |      |               |
.    |_ _ _ _ _ _ _ _|_|_     |_ _ _ _ _ _ _ _|_|_     |_ _ _ _ _ _ _ _|_ _
.                       x                        x                        x
.         Figure 1.                Figure 2.                Figure 3.
.         Symmetric                Symmetric                Symmetric
.       representation           representation           representation
.         of sigma(9)              of sigma(9)             of a(9) = 68
.       A000203(9) = 13          A000203(9) = 13
.           and of                   and of
.     Q = A024916(8) = 56      R = A004125(9) = 12
.                              Q = A024916(8) = 56
.
Note that the symmetric representation of a(9) contains a hole formed by three cells because these three cells were the central part of the symmetric representation of sigma(9). (End)
		

Crossrefs

Programs

  • Magma
    [n^2 - DivisorSigma(1,n): n in [1..50]]; // G. C. Greubel, Oct 31 2018
  • Mathematica
    Table[n^2-DivisorSigma[1,n],{n,50}] (* Harvey P. Dale, Sep 02 2016 *)
  • PARI
    vector(50, n, n^2 - sigma(n)) \\ G. C. Greubel, Oct 31 2018
    

Formula

a(n) = A000290(n) - A000203(n).
a(n) = A024916(n-1) + A004125(n), n > 1.
G.f.: x*(1 + x)/(1 - x)^3 - Sum_{k>=1} x^k/(1 - x^k)^2. - Ilya Gutkovskiy, Mar 17 2017
From Omar E. Pol, Apr 10 2021: (Start)
a(n) = A024816(n) + A000217(n-1).
a(n) = A067436(n) + A153485(n) + A244048(n). (End)

A237588 Sigma(n) - 2n + 1.

Original entry on oeis.org

0, 0, -1, 0, -3, 1, -5, 0, -4, -1, -9, 5, -11, -3, -5, 0, -15, 4, -17, 3, -9, -7, -21, 13, -18, -9, -13, 1, -27, 13, -29, 0, -17, -13, -21, 20, -35, -15, -21, 11, -39, 13, -41, -3, -11, -19, -45, 29, -40, -6, -29, -5, -51, 13, -37, 9, -33, -25, -57, 49, -59, -27, -21, 0
Offset: 1

Views

Author

Omar E. Pol, Feb 20 2014

Keywords

Comments

Also we can write Sigma(n) - (2n - 1).
a(n) = 2 - n iff n is prime.
a(n) = 1 iff n is a perfect number.
Conjecture: a(n) = 0 iff n is a power of 2.
The problem is not new. In fact, the following comments appeared on page 74 of Guy's book: "If Sigma(n) = 2*n - 1, n has been called almost perfect. Powers of 2 are almost perfect; it is not known if any other numbers are.". - Zhi-Wei Sun, Feb 23 2014

Examples

			-----------------------------------------------
.     The sum of       The positive
n    divisors of n     odd numbers        a(n)
-----------------------------------------------
1          1                1               0
2          3                3               0
3          4                5              -1
4          7                7               0
5          6                9              -3
6         12               11               1
7          8               13              -5
8         15               15               0
9         13               17              -4
10        18               19              -1
...
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, New York, 2004.

Crossrefs

Programs

  • Magma
    [1-2*n+SumOfDivisors(n): n in [1..100]]; // Vincenzo Librandi, Feb 25 2014
  • Mathematica
    Table[DivisorSigma[1,n]-2n+1,{n,70}] (* Harvey P. Dale, Nov 15 2014 *)
  • PARI
    vector(100, n, sigma(n)-2*n+1) \\ Colin Barker, Feb 21 2014
    

Formula

a(n) = A000203(n) - A005408(n-1) = 1 - n + A001065(n) = 1 - A033879(n) = 1 + A033880(n) = (-1)*A235796(n).
a(n) = A088580(n) - 2*n. - Omar E. Pol, Mar 23 2014

A362081 Numbers k achieving record abundance (sigma(k) > 2*k) via a residue-based measure M(k) (see Comments), analogous to superabundant numbers A004394.

Original entry on oeis.org

1, 2, 4, 6, 12, 24, 30, 36, 72, 120, 360, 420, 840, 1680, 2520, 4032, 5040, 10080, 25200, 32760, 65520, 98280, 194040, 196560, 388080, 942480, 1801800, 3160080, 3603600, 6320160, 12640320, 24504480, 53721360, 61981920, 73513440, 115315200, 122522400, 189909720, 192099600, 214885440
Offset: 1

Views

Author

Richard Joseph Boland, Apr 08 2023

Keywords

Comments

The residue-based quantifier function, M(k) = (k+1)*(1 - zeta(2)/2) - 1 - ( Sum_{j=1..k} k mod j )/k, measures either abundance (sigma(k) > 2*k), or deficiency (sigma(k) < 2*k), of a positive integer k. It follows from the known facts that Sum_{j=1..k} (sigma(j) + k mod j) = k^2 and that the average order of sigma(k)/k is Pi^2/6 = zeta(2) (see derivation below).
M(k) ~ 0 when sigma(k) ~ 2*k and for sufficiently large k, M(k) is positive when k is an abundant number (A005101) and negative when k is a deficient number (A005100). The terms of this sequence are the abundant k for which M(k) > M(m) for all m < k, analogous to the superabundant numbers A004394, which utilize sigma(k)/k as the measure. However, sigma(k)/k does not give a meaningful measure of deficiency, whereas M(k) does, thus a sensible notion of superdeficient (see A362082).

Examples

			The abundance measure is initially negative, becoming positive for k > 30. Initial measures with factorizations from the Mathematica program:
   1  -0.64493406684822643647   {{1,1}}
   2  -0.46740110027233965471   {{2,1}}
   4  -0.36233516712056609118   {{2,2}}
   6  -0.25726923396879252765   {{2,1},{3,1}}
  12  -0.10873810118013850374   {{2,2},{3,1}}
  24  -0.10334250226949712257   {{2,3},{3,1}}
  30  -0.096478036147509765322  {{2,1},{3,1},{5,1}}
  36   0.068719763307810925260  {{2,2},{3,2}}
  72   0.12657322670640173542   {{2,3},{3,2}}
		

Crossrefs

Programs

  • Mathematica
    Clear[max, Rp, R, seqtable, M];
    max = -1; Rp = 0; seqtable = {};
    Do[R = Rp + 2 k - 1 - DivisorSigma[1, k];
      M = N[(k + 1)*(1 - Zeta[2]/2) - 1 - R/k, 20];
      If[M > max, max = M; Print[k, "   ", max, "   ", FactorInteger[k]];
       AppendTo[seqtable, k]];
      Rp = R, {k, 1, 1000000000}];
    Print[seqtable]
  • PARI
    M(n) = (n+1)*(1 - zeta(2)/2) - 1 - sum(k=2, n, n%k)/n;
    lista(nn) = my(m=-oo, list=List()); for (n=1, nn, my(mm = M(n)); if (mm > m, listput(list, n); m = mm);); Vec(list); \\ Michel Marcus, Apr 21 2023

Formula

Derived starting with lemmas 1-3:
1) Sum_{j=1..k} (sigma(j) + k mod j) = k^2.
2) The average order of sigma(k)/k is Pi^2/6 = zeta(2).
3) R(k) = Sum_{j=1..k} k mod j, so R(k)/k is the average order of (k mod j).
Then:
Sum_{j=1..k} sigma(j) ~ zeta(2)*Sum_{j=1..k} j = zeta(2)*(k^2+k)/2.
R(k)/k ~ k - k*zeta(2)/2 - zeta(2)/2.
0 ~ (k+1)*(1 - zeta(2)/2) - 1 - R(k)/k.
Thus M(k) = (k+1)*(1 - zeta(2)/2) - 1 - R(k)/k is a measure of variance about sigma(k) ~ 2*k corresponding to M(k) ~ 0.

A362082 Numbers k achieving record deficiency via a residue-based measure, M(k) = (k+1)*(1 - zeta(2)/2) - 1 - ( Sum_{j=1..k} k mod j )/k.

Original entry on oeis.org

1, 5, 11, 23, 47, 59, 167, 179, 359, 503, 719, 1439, 5039, 6719, 7559, 15119, 20159, 52919, 75599, 83159, 166319, 415799, 720719, 831599, 1081079, 2162159, 4324319, 5266799, 7900199, 10533599, 18345599, 28274399, 41081039, 136936799, 205405199, 410810399
Offset: 1

Views

Author

Richard Joseph Boland, Apr 17 2023

Keywords

Comments

M(k) = (k+1)*(1 - zeta(2)/2) - 1 - ( Sum_{j=1..k} k mod j )/k is a measure of either abundance (sigma(k) > 2*k), or deficiency (sigma(k) < 2*k), of a positive integer k. The measure follows from the known facts that Sum_{j=1..k} (sigma(j) + k mod j) = k^2 and that the average order of sigma(k)/k is Pi^2/6 = zeta(2) (see derivation below).
M(k) ~ 0 when sigma(k) ~ 2*k and for sufficiently large k, M(k) is positive when k is an abundant number (A005101) and negative when k is a deficient number (A005100).
The terms of this sequence are the deficient k for which M(k) < M(m) for all m < k and may be thought of as "superdeficient", contra-analogous to the superabundant numbers A004394 utilizing sigma(k)/k as the measure of abundance, which is otherwise not particularly meaningful as a deficiency measure.
15119=13*1163 is the first term that is composite and subsequently, up to 1000000000, roughly half of the terms are composite.

Examples

			First few terms with their M(k) measure and factorizations as generated by the Mathematica program:
    1   -0.64493406684822643647   {{1,1}}
    5   -0.73480220054467930942   {{5,1}}
   11   -0.86960440108935861883  {{11,1}}
   23   -1.0000783673961085420   {{23,1}}
   47   -1.0528856894638174541   {{47,1}}
   59   -1.1107338698535727552   {{59,1}}
  167   -1.1984137110594038972  {{167,1}}
  179   -1.2619431113124463216  {{179,1}}
  359   -1.3499704727921791778  {{359,1}}
  503   -1.3722914063892448936  {{503,1}}
  719   -1.4363475145965658088  {{719,1}}
		

Crossrefs

Cf. A362081 (analogous to superabundant A004394).
Cf. A362083 (analogous to A335067, A326393).

Programs

  • Mathematica
    Clear[min, Rp, R, seqtable, M]; min = 1; Rp = 0; seqtable = {};
    Do[R = Rp + 2 k - 1 - DivisorSigma[1, k];
      M = N[(k + 1)*(1 - Zeta[2]/2) - 1 - R/k, 20];
      If[M < min, min = M; Print[k, "   ", min, "   ", FactorInteger[k]];
       AppendTo[seqtable, k]];
      Rp = R, {k, 1, 1000000000}];
    Print[seqtable]
  • PARI
    M(n) = (n+1)*(1 - zeta(2)/2) - 1 - sum(k=2, n, n%k)/n;
    lista(nn) = my(m=+oo, list=List()); for (n=1, nn, my(mm = M(n)); if (mm < m, listput(list, n); m = mm);); Vec(list); \\ Michel Marcus, Apr 21 2023

Formula

Derived starting with lemmas 1-3:
1) Sum_{j=1..k} (sigma(j) + k mod j) = k^2.
2) The average order of sigma(k)/k is Pi^2/6 = zeta(2).
3) R(k) = Sum_{j=1..k} k mod j, so R(k)/k is the average order of (k mod j).
Then:
Sum_{j=1..k} sigma(j) ~ zeta(2)*Sum_{j=1..k} j = zeta(2)*(k^2+k)/2.
R(k)/k ~ k - k*zeta(2)/2 - zeta(2)/2.
0 ~ (k+1)*(1 - zeta(2)/2) - 1 - R(k)/k.
Thus M(k) = (k+1)*(1 - zeta(2)/2) - 1 - R(k)/k is a measure of variance about sigma(k) ~ 2*k corresponding to M(k) ~ 0.
Showing 1-10 of 14 results. Next