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

A082901 a(n) = A082895(n)-A000203(n); the distance from sigma(n) to that multiple of n which is closest to sigma(n), positive terms for cases where the closest multiple is after sigma(n), and negative terms where it is before sigma(n). In case of ties, a positive term is selected.

Original entry on oeis.org

0, 1, -1, 1, -1, 0, -1, 1, -4, 2, -1, -4, -1, 4, 6, 1, -1, -3, -1, -2, 10, 8, -1, 12, -6, 10, -13, 0, -1, -12, -1, 1, -15, 14, -13, 17, -1, 16, -17, -10, -1, -12, -1, 4, 12, 20, -1, 20, -8, 7, -21, 6, -1, -12, -17, -8, -23, 26, -1, 12, -1, 28, 22, 1, -19, -12, -1, 10, -27, -4, -1, 21, -1, 34, 26, 12, -19, -12, -1, -26, -40, 38, -1, 28
Offset: 1

Views

Author

Labos Elemer, Apr 22 2003

Keywords

Examples

			n=2: sigma(2)=3, the closest even numbers to 3 are 2 and 4, we choose 4 to get a positive difference, thus a(2) = 4-3 = 1.
n=28: sigma(28) = 56, thus a multiple of 28 which is closest to 28 is 28, so the difference is zero. Positions of zeros for this sequence is given by the multiply perfect numbers, A007691.
When n is a prime p > 2, sigma(p) = p+1, thus the multiple of p closest to p+1 is p, so difference is -1.
		

Crossrefs

Programs

  • Mathematica
    Table[n*Floor[(Floor[n/2]+DivisorSigma[1, n])/n]- DivisorSigma[1, n], {n, 1, 100}]
  • PARI
    a(n)=my(s=sigma(n));s\/n*n-s \\ Charles R Greathouse IV, Feb 15 2013
    
  • PARI
    A082901(n) = { my(s=sigma(n),  a = ((s\n)*n)-s, b = ((1+(s\n))*n)-s); if(b <= abs(a), b, a); }; \\ Antti Karttunen, Oct 01 2018

Formula

a(n) = n*floor[(floor(n/2)+sigma(n))/n] - sigma(n).

Extensions

Definition clarified and the example section edited by Antti Karttunen, Sep 25 2018

A082898 a(n) = A082895(n)/n, where A082895(n) is the closest number to sigma(n) which is divisible by n.

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 2, 2
Offset: 1

Views

Author

Labos Elemer, Apr 22 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Floor[(Floor[n/2]+DivisorSigma[1, n])/n], {n, 1, 100}]
  • PARI
    A082898(n) = { my(s=sigma(n), a = ((s\n)*n), b = (1+(s\n))*n); if((b-s) <= abs(a-s), b, a)/n; }; \\ Antti Karttunen, Oct 09 2018

Formula

a(n) = floor[(floor(n/2)+sigma[n])/n], sigma() = A000203().

A082894 a(n) is the closest number to 2^n which is divisible by n.

Original entry on oeis.org

2, 4, 9, 16, 30, 66, 126, 256, 513, 1020, 2046, 4092, 8190, 16380, 32775, 65536, 131070, 262152, 524286, 1048580, 2097144, 4194300, 8388606, 16777224, 33554425, 67108860, 134217729, 268435468, 536870910, 1073741820, 2147483646
Offset: 1

Views

Author

Labos Elemer, Apr 22 2003

Keywords

Examples

			n=11: 2^11=2048 is between 2046=11.186 and 2035=11.185, closer to a(11)=2046;
Powers of two are fixed points of this map.
		

Crossrefs

Programs

  • Maple
    A082894:=n->n*floor((floor(n/2)+2^n)/n); seq(A082894(k), k=1..100); # Wesley Ivan Hurt, Oct 29 2013
  • Mathematica
    Table[n*Floor[(Floor[n/2]+2^n)/n], {n, 100}]
  • PARI
    for(n=1,50, print1(n*floor( (floor(n/2)+2^n) / n ), ", ")) \\ G. C. Greubel, Aug 08 2017
    
  • Python
    def A082894(n): return (m:=(1<>1))-m%n # Chai Wah Wu, Apr 23 2025

Formula

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

A082900 a(n) = A082894(n)-A000079(n), the difference of 2^n and the number closest to it and divisible by n.

Original entry on oeis.org

0, 0, 1, 0, -2, 2, -2, 0, 1, -4, -2, -4, -2, -4, 7, 0, -2, 8, -2, 4, -8, -4, -2, 8, -7, -4, 1, 12, -2, -4, -2, 0, -8, -4, 17, 8, -2, -4, -8, -16, -2, 20, -2, -16, -17, -4, -2, -16, 19, -24, -8, -16, -2, 26, 12, 24, -8, -4, -2, -16, -2, -4, -8, 0, -32, 2, -2, -16, -8, 26, -2, 8, -2, -4, 7, -16, -18, 14, -2, -16, 1, -4, -2, 20, -32, -4, -8
Offset: 1

Views

Author

Labos Elemer, Apr 22 2003

Keywords

Comments

n=5:2^5=32 and number divisible by n=5 and closest to 32 is 30 = A082894(5), a(5)=30-32=-2 is the corresponding difference.

Crossrefs

Programs

Formula

a(n)=n*floor[(floor(n/2)+2^n)/n]-2^n
Showing 1-4 of 4 results.