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 41-50 of 87 results. Next

A067435 a(n) is the sum of all the remainders when n-th odd number is divided by odd numbers < 2n-1.

Original entry on oeis.org

0, 0, 2, 3, 6, 9, 16, 13, 27, 31, 34, 43, 57, 56, 75, 80, 96, 99, 121, 122, 155, 164, 163, 184, 220, 218, 255, 252, 277, 304, 339, 328, 372, 389, 412, 433, 491, 478, 515, 536, 570, 609, 638, 647, 722, 713, 746, 767, 858, 842, 910, 939, 942, 993, 1060, 1057
Offset: 1

Views

Author

Amarnath Murthy, Jan 29 2002

Keywords

Examples

			a(7) = 16 = 1 +3 +6 +4 +2 = 13 % 3 + 13 % 5 + 13 % 7 + 13 % 9 + 13 % 11.
		

Crossrefs

Programs

  • Maple
    L:= [seq(4*n-3 - numtheory:-sigma(2*n-1)-numtheory:-sigma((n-1)/2^padic:-ordp(n-1,2)), n=1..100)]:
    ListTools:-PartialSums(L); # Robert Israel, Jan 16 2019
  • Python
    from math import isqrt
    def A327329(n): return -(s:=isqrt(n))**2*(s+1)+sum((q:=n//k)*((k<<1)+q+1) for k in range(1,s+1))
    def A067435(n): return n*((n<<1)-1)-(A327329(n<<1)>>1)-A327329(n>>1)+3*(A327329(n)>>1)+A327329(n-1>>1)-(A327329(n-1)>>1) # Chai Wah Wu, Nov 01 2023

Formula

a(n) = a(n-1) + 4*n-3 - A000203(2*n-1) - A000593(n-1). - Robert Israel, Jan 16 2019
a(n) = n*(2*n-1) - A326123(n) - A078471(n-1) = n*(2*n-1) - A024916(2*n) - 2*A024916(floor(n/2)) + 3*A024916(n) + 2*A024916(floor((n-1)/2)) - A024916(n-1). - Chai Wah Wu, Nov 01 2023

Extensions

Corrected and extended by several contributors.

A131383 Total digital sum of n: sum of the digital sums of n for all the bases 1 to n (a 'digital sumorial').

Original entry on oeis.org

1, 3, 6, 8, 13, 16, 23, 25, 30, 35, 46, 46, 59, 66, 75, 74, 91, 91, 110, 112, 125, 136, 159, 152, 169, 182, 195, 199, 228, 223, 254, 253, 274, 291, 316, 297, 334, 353, 378, 373, 414, 409, 452, 460, 475, 498, 545, 520, 557, 565, 598, 608, 661, 652, 693, 690
Offset: 1

Views

Author

Hieronymus Fischer, Jul 05 2007, Jul 15 2007, Jan 07 2009

Keywords

Comments

Sums of rows of the triangle in A138530. - Reinhard Zumkeller, Mar 26 2008

Examples

			5 = 11111(base 1) = 101(base 2) = 12(base 3) = 11(base 4) = 10(base 5). Thus a(5) = ds_1(5)+ds_2(5)+ds_3(5)+ds_4(5)+ds_5(5) = 5+2+3+2+1 = 13.
		

Crossrefs

Programs

  • Mathematica
    Table[n + Total@ Map[Total@ IntegerDigits[n, #] &, Range[2, n]], {n, 56}] (* Michael De Vlieger, Jan 03 2017 *)
  • PARI
    a(n)=sum(i=2,n+1,vecsum(digits(n,i))); \\ R. J. Cano, Jan 03 2017

Formula

a(n) = n^2-sum{k>0, sum{2<=p<=n, (p-1)*floor(n/p^k)}}.
a(n) = n^2-sum{2<=p<=n, (p-1)*sum{0
a(n) = n^2-A024916(n)+A006218(n)-sum{k>1, sum{2<=p<=n, (p-1)*floor(n/p^k)}}.
a(n) = A004125(n)+A006218(n)-sum{k>1, sum{2<=p<=n, (p-1)*floor(n/p^k)}}.
Asymptotic behavior: a(n) = (1-Pi^2/12)*n^2 + O(n*log(n)) = A004125(n) + A006218(n) + O(n*log(n)).
Lim a(n)/n^2 = 1 - Pi^2/12 for n-->oo.
G.f.: (1/(1-x))*(x(1+x)/(1-x)^2-sum{k>0,sum{j>1,(j-1)*x^(j^k)/(1-x^(j^k))}= }).
Also: (1/(1-x))*(x(1+x)/(1-x)^2-sum{m>1, sum{10,j^(1/k) is an integer, j^(1/k)-1}}*x^m}).
a(n) = n^2-sum{10,sum{1
Recurrence: a(n)=a(n-1)-b(n)+2n-1, where b(n)=sum{1
a(n) = sum{1<=p<=n, ds_p(n)} where ds_p = digital sum base p.
a(n) = A043306(n) + n (that sequence ignores unary) = A014837(n) + n + 1 (that sequence ignores unary and base n in which n is "10"). - Alonso del Arte, Mar 26 2009

A154585 a(n) = abs(Sum_{k=1..n} (-1)^k * (n-k+1 mod k)).

Original entry on oeis.org

0, 1, 1, 0, 1, 2, 4, 0, 3, 4, 5, 4, 1, 10, 4, 3, 1, 2, 9, 2, 11, 12, 17, 11, 0, 13, 0, 1, 6, 7, 23, 8, 7, 20, 10, 9, 8, 25, 14, 13, 4, 3, 20, 13, 34, 35, 34, 26, 8, 13, 6, 5, 8, 25, 24, 1, 26, 27, 34, 33, 4, 37, 25, 6, 11, 12, 11, 16, 37, 38, 60, 59, 24, 25, 0, 19, 40, 41, 54, 14, 25, 26, 51
Offset: 1

Author

Keywords

Examples

			a(5) = -(5 mod 1)+(4 mod 2)-(3 mod 3)+(2 mod 4)-(1 mod 5) = -0+0-0+2-1 = 1.
		

Crossrefs

Programs

  • Maple
    P:=proc(i) local a,n; for n from 1 by 1 to i do a:=abs(sum('(-1)^k*((n-k+1) mod k)','k'=1..n)); print(a); od; end: P(100);
  • Mathematica
    a[n_] := Abs @ Sum[(-1)^k * Mod[n - k + 1, k], {k, 1, n}]; Array[a, 100] (* Amiram Eldar, Sep 18 2021 *)
  • PARI
    a(n) = abs(sum(k=1, n, (-1)^k * lift(Mod(n-k+1, k)))); \\ Michel Marcus, Sep 18 2021

A244970 Total number of regions after n-th stage in the diagram of the symmetric representation of sigma on the four quadrants.

Original entry on oeis.org

1, 2, 6, 7, 11, 12, 16, 17, 25, 29, 33, 34, 38, 42, 50, 51, 55, 56, 60, 61, 73, 77, 81, 82, 90, 94, 106, 107, 111, 112, 116, 117, 129, 133, 141, 142, 146, 150, 162, 163, 167, 168, 172, 176, 184, 188, 192, 193, 201, 209, 221, 225, 229, 230, 242, 243, 255, 259, 263, 264
Offset: 1

Author

Omar E. Pol, Jul 08 2014

Keywords

Comments

Partial sums of A244971.
If we use toothpicks of length 1/2, so the area of the central square is equal to 1. The total area of the structure after n-th stage is equal to A024916(n), the sum of all divisors of all positive integers <= n, hence the total area of the n-th set of symmetric regions added at n-th stage is equal to sigma(n) = A000203(n), the sum of divisors of n.
If we use toothpicks of length 1, so the number of cells (and the area) of the central square is equal to 4. The number of cells (and the total area) of the structure after n-th stage is equal to 4*A024916(n) = A243980(n), hence the number of cells (and the total area) of the n-th set of symmetric regions added at n-th stage is equal to 4*A000203(n) = A239050(n).
a(n) is also the total number of terraces of the stepped pyramid with n levels described in A244050. - Omar E. Pol, Apr 20 2016

Examples

			Illustration of the structure after 15 stages (contains 50 regions):
.
.                   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.                  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
.                  |  _ _ _ _ _ _ _ _ _ _ _ _ _ _  |
.               _ _| |_ _ _ _ _ _ _ _ _ _ _ _ _ _| |_ _
.             _|  _| |  _ _ _ _ _ _ _ _ _ _ _ _  | |_  |_
.           _|   |_ _| |_ _ _ _ _ _ _ _ _ _ _ _| |_ _|   |_
.          |  _ _|     |  _ _ _ _ _ _ _ _ _ _  |     |_ _  |
.     _ _ _|_| |      _| |_ _ _ _ _ _ _ _ _ _| |_      | |_|_ _ _
.    | |  _ _ _|    _|_ _|  _ _ _ _ _ _ _ _  |_ _|_    |_ _ _  | |
.    | | | |  _ _ _| |  _| |_ _ _ _ _ _ _ _| |_  | |_ _ _  | | | |
.    | | | | | |  _ _|_|  _|  _ _ _ _ _ _  |_  |_|_ _  | | | | | |
.    | | | | | | | |  _ _|   |_ _ _ _ _ _|   |_ _  | | | | | | | |
.    | | | | | | | | | |  _ _|  _ _ _ _  |_ _  | | | | | | | | | |
.    | | | | | | | | | | | |  _|_ _ _ _|_  | | | | | | | | | | | |
.    | | | | | | | | | | | | | |  _ _  | | | | | | | | | | | | | |
.    | | | | | | | | | | | | | | |   | | | | | | | | | | | | | | |
.    | | | | | | | | | | | | | | |_ _| | | | | | | | | | | | | | |
.    | | | | | | | | | | | | |_|_ _ _ _|_| | | | | | | | | | | | |
.    | | | | | | | | | | |_|_  |_ _ _ _|  _|_| | | | | | | | | | |
.    | | | | | | | | |_|_    |_ _ _ _ _ _|    _|_| | | | | | | | |
.    | | | | | | |_|_ _  |_  |_ _ _ _ _ _|  _|  _ _|_| | | | | | |
.    | | | | |_|_ _  | |_  |_ _ _ _ _ _ _ _|  _| |  _ _|_| | | | |
.    | | |_|_ _    |_|_ _| |_ _ _ _ _ _ _ _| |_ _|_|    _ _|_| | |
.    |_|_ _ _  |     |_  |_ _ _ _ _ _ _ _ _ _|  _|     |  _ _ _|_|
.          | |_|_      | |_ _ _ _ _ _ _ _ _ _| |      _|_| |
.          |_    |_ _  |_ _ _ _ _ _ _ _ _ _ _ _|  _ _|    _|
.            |_  |_  | |_ _ _ _ _ _ _ _ _ _ _ _| |  _|  _|
.              |_ _| |_ _ _ _ _ _ _ _ _ _ _ _ _ _| |_ _|
.                  | |_ _ _ _ _ _ _ _ _ _ _ _ _ _| |
.                  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
.                  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
.
The diagram is also the top view of the stepped pyramid with 15 levels described in A244050. - _Omar E. Pol_, Apr 20 2016
		

A072514 Sum of n mod k for k in {1...n} with gcd(k,n) > 1.

Original entry on oeis.org

0, 0, 0, 0, 0, 2, 0, 2, 3, 8, 0, 9, 0, 16, 17, 16, 0, 27, 0, 31, 31, 44, 0, 52, 20, 56, 36, 69, 0, 92, 0, 72, 77, 102, 68, 127, 0, 128, 97, 152, 0, 192, 0, 165, 153, 196, 0, 230, 56, 231, 170, 237, 0, 319, 154, 290, 211, 302, 0, 421, 0, 334, 273, 334, 192, 478, 0, 411, 317
Offset: 1

Author

Amarnath Murthy, Jul 30 2002

Keywords

Comments

Previous name was: Sum of the remainders when n is divided by unrelated numbers (numbers which are neither coprime to n nor divide n).

Examples

			a(18) = 27: the unrelated numbers to 18 are 4, 8, 10, 12, 14, 15 and 16. The remainders when 18 is divided by these numbers are 2, 2, 8, 6, 4, 3 and 2 whose sum is 27.
		

Crossrefs

Programs

  • Maple
    seq(add(n mod k, k=select(j->gcd(j,n)>1, [$1..n])),n=1..69); # Peter Luschny, Oct 01 2014
  • Mathematica
    snmk[n_]:=Total[Mod[n,Complement[Complement[Range[n],Divisors[n]], Select[ Range[n], CoprimeQ[ #,n]&]]]]; Array[snmk,70] (* Harvey P. Dale, Dec 09 2018 *)
  • PARI
    lista(nn) = vector(nn, n, sum(i=1, n, (n % i)*(gcd(n, i) != 1))); \\ Michel Marcus, Oct 01 2014

Formula

From Ridouane Oudra, May 14 2025: (Start)
a(n) = A004125(n) - A067439(n).
a(n) = Sum_{d|n, d>1} d*A067439(n/d).
a(p) = 0, for p prime.
a(p*q) = p*A067439(q) + q*A067439(p), for p and q two distinct prime numbers.
a(p^k) = p*A004125(p^(k-1)), for p a prime and k >= 0. (End)

Extensions

Corrected and extended by David Garber, Oct 22 2002
New name from Robert Israel, Oct 01 2014

A103289 Numbers k such that both sigma(k) >= 2*k-1 and sigma(k+1) >= 2*(k+1)-1.

Original entry on oeis.org

1, 4095, 5775, 5984, 7424, 11024, 21735, 21944, 26144, 27404, 39375, 43064, 49664, 56924, 58695, 61424, 69615, 70784, 76544, 77175, 79695, 81080, 81675, 82004, 84524, 84644, 89775, 91664, 98175, 103455, 104895, 106784, 109395, 111824
Offset: 1

Author

Max Alekseyev, Jan 28 2005

Keywords

Comments

A004125(n) is less than A004125(n-1) and A004125(n+1) iff n belongs to A023196 but not to the current sequence.
Numbers k that both k and k+1 are in A103288.
Union of sequences A096399 and {2^m-1} for m in A103291.

Crossrefs

Programs

  • GAP
    Filtered([1..120000],n->Sigma(n)>=2*n-1 and Sigma(n+1)>2*(n+1)-1); # Muniru A Asiru, Jun 26 2018
  • Maple
    with(numtheory): a:=`if`(sigma(n)>=2*n-1 and sigma(n+1)>=2*(n+1)-1,n,NULL): seq(a(n),n=1..120000); # Muniru A Asiru, Jun 26 2018
  • Mathematica
    Select[Range[120000], And[DivisorSigma[1, #] >= 2 #1 - 1, DivisorSigma[1, # + 1] >= 2 (#1 + 1) - 1] &] (* Michael De Vlieger, Jun 29 2018 *)
  • PARI
    for(i=1,1000000,if(sigma(i)>=2*i-1 && sigma(i+1)>=2*i+1, print1(i, ", ")));
    

A129365 a(n) = A092287(n)/A129364(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 2, 6, 48, 48, 48, 48, 1536, 207360, 207360, 207360, 1105920, 1105920, 17694720, 30098718720, 15410543984640, 15410543984640, 481579499520, 60197437440000, 123284351877120000, 29958097506140160000
Offset: 1

Author

Peter Bala, Apr 13 2007

Keywords

Comments

Conjectures:
A) a(n) is always an integer.
B) If p is a prime then p|a(n) if and only if p <= n/3. Let ordp(n,p) denote the exponent of the largest power of p which divides n. For example, ordp(48,2) = 4 since 48 = 3*(2^4). The precise decomposition of a(n) into primes would follow from the following two conjectures:
C) For each positive integer n and prime p, ordp(a(n*p),p) = ordp(a(n*p+1),p) = ordp(a(n*p+2),p) = . . . = ordp(a(n*p+p-1),p).
D) Let b(n) = A004125(n). Then ordp(a(n*p),p) = b(n) + b(floor(n/p)) + b(floor(n/p^2)) + b(floor(n/p^3)) + .... This is reminiscent of de Polignac's formula (also due to Legendre) for the prime factorization of n! (see the link).

Crossrefs

Formula

a(n) = ( Product_{j = 1..n} Product_{k = 1..n} gcd(j,k) ) / ( Product_{j = 1..n} Product_{d|j} d^(j/d) ).
a(n) = ( Product_{j = 1..n} Product_{k = 1..n} gcd(j,k) ) / ( Product_{k = 1..n} (floor(n/k)!)^k ).

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

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

A224923 a(n) = Sum_{i=0..n} Sum_{j=0..n} (i XOR j), where XOR is the binary logical exclusive-or operator.

Original entry on oeis.org

0, 2, 12, 24, 68, 114, 168, 224, 408, 594, 788, 984, 1212, 1442, 1680, 1920, 2672, 3426, 4188, 4952, 5748, 6546, 7352, 8160, 9096, 10034, 10980, 11928, 12908, 13890, 14880, 15872, 18912, 21954, 25004, 28056, 31140, 34226, 37320, 40416, 43640, 46866, 50100, 53336, 56604
Offset: 0

Author

Alex Ratushnyak, Apr 19 2013

Keywords

Crossrefs

Programs

  • Mathematica
    Array[Sum[BitXor[i, j], {i, 0, #}, {j, 0, #}] &, 45, 0] (* Michael De Vlieger, Nov 03 2022 *)
  • Python
    for n in range(99):
        s = 0
        for i in range(n+1):
            for j in range(n+1):
                s += i ^ j
        print(s, end=",") # Alex Ratushnyak, Apr 19 2013
    
  • Python
    # O(log(n)) version, whereas program above is O(n^2)
    def countPots2Until(n):
        nbPots = {1:n>>1}
        lftMask = ~3
        rgtMask = 1
        digit = 2
        while True:
            lft = (n & lftMask) >> 1
            rgt = n & rgtMask
            nbDigs = lft
            if n & digit:
                nbDigs |= rgt
            if nbDigs == 0:
                return nbPots
            nbPots[digit] = nbDigs
            rgtMask |= digit
            digit <<= 1
            lftMask = lftMask ^ digit
    def sumXorSquare(n):
        """Returns sum(i^j for i, j <= n)"""
        n += 1
        nbPots = countPots2Until(n)
        return 2 * sum(pot * freq * (n - freq) for pot, freq in nbPots.items())
    print([sumXorSquare(n) for n in range(100)])  # Miguel Garcia Diaz, Nov 19 2014
    
  • Python
    # O(log(n)) version, same as previous, but simpler and about 3x faster.
    def xor_square(n: int) -> int:
        return sum((((n + 1 >> i) ** 2 >> 1 << i) +
                   ((n + 1) & ((1 << i) - 1)) * (n + 1 + (1 << i) >> i + 1 << 1)
                   << 2 * i) for i in range(n.bit_length()))
    print([xor_square(n) for n in range(100)]) # Gabriel F. Ushijima, Feb 24 2024

A224924 Sum_{i=0..n} Sum_{j=0..n} (i AND j), where AND is the binary logical AND operator.

Original entry on oeis.org

0, 1, 3, 12, 16, 33, 63, 112, 120, 153, 211, 300, 408, 553, 735, 960, 976, 1041, 1155, 1324, 1536, 1809, 2143, 2544, 2952, 3433, 3987, 4620, 5320, 6105, 6975, 7936, 7968, 8097, 8323, 8652, 9072, 9601, 10239, 10992, 11800, 12729, 13779, 14956, 16248, 17673, 19231, 20928
Offset: 0

Author

Alex Ratushnyak, Apr 19 2013

Keywords

Comments

For n>0, a(2^n)-A000217(2^n)=a(2^n-1)-A000217(2^n-1) [See links]. - R. J. Cano, Aug 21 2013

Crossrefs

Programs

  • Maple
    read("transforms") :
    A224924 := proc(n)
        local a,i,j ;
        a := 0 ;
        for i from 0 to n do
        for j from 0 to n do
            a := a+ANDnos(i,j) ;
        end do:
        end do:
        a ;
    end proc: # R. J. Mathar, Aug 22 2013
  • Mathematica
    a[n_] := Sum[BitAnd[i, j], {i, 0, n}, {j, 0, n}];
    Table[a[n], {n, 0, 20}]
    (* Enrique Pérez Herrero, May 30 2015 *)
  • PARI
    a(n)=sum(i=0,n,sum(j=0,n,bitand(i,j))); \\ R. J. Cano, Aug 21 2013
  • Python
    for n in range(99):
        s = 0
        for i in range(n+1):
          for j in range(n+1):
            s += i & j
        print(s, end=',')
    

Formula

a(2^n) = a(2^n - 1) + 2^n.
a(n) -a(n-1) = 2*A222423(n) -n. - R. J. Mathar, Aug 22 2013
Previous Showing 41-50 of 87 results. Next