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

A082893 a(n) is the closest number to n-th prime which is divisible by n.

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 14, 16, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 76, 80, 63, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 240, 245, 250, 255, 260, 265, 270, 275, 280, 285, 290
Offset: 1

Views

Author

Labos Elemer, Apr 22 2003

Keywords

Examples

			24th prime, 89 is between 72 and 96, closer to 96, so a(24)=96;
25th prime, 97 is between 75 and 100, closer to 100, so a(25)=100.
		

Crossrefs

Programs

  • Mathematica
    Table[n*Floor[(Floor[n/2]+Prime[n])/n], {n, 1, 100}]
  • Python
    from sympy import prime
    def A082893(n): return (m:=prime(n)+(n>>1))-m%n # Chai Wah Wu, Apr 23 2025

Formula

a(n)=n*floor[(floor(n/2)+p(n))/n], where p(n) is the n-th prime.

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 ).

A082895 Closest number to sigma(n) = A000203(n) which is divisible by n.

Original entry on oeis.org

1, 4, 3, 8, 5, 12, 7, 16, 9, 20, 11, 24, 13, 28, 30, 32, 17, 36, 19, 40, 42, 44, 23, 72, 25, 52, 27, 56, 29, 60, 31, 64, 33, 68, 35, 108, 37, 76, 39, 80, 41, 84, 43, 88, 90, 92, 47, 144, 49, 100, 51, 104, 53, 108, 55, 112, 57, 116, 59, 180, 61, 124, 126, 128, 65, 132, 67, 136, 69
Offset: 1

Views

Author

Labos Elemer, Apr 22 2003

Keywords

Comments

In the case of a tie, we round up. - Robert Israel, May 26 2019

Examples

			n=100: sigma[100]=217 is between 100=1.100 and 200=2.100
200 is closer to 217, so a[100]=200;
		

Crossrefs

Programs

  • Maple
    f:= proc(n) uses numtheory; n*floor((floor(n/2)+sigma(n))/n) end proc:
    map(f, [$1..100]); # Robert Israel, May 26 2019
  • Mathematica
    Table[n*Floor[(Floor[n/2]+DivisorSigma[1, n])/n], {n, 1, 100}]
  • PARI
    a(n)=sigma(n)\/n*n \\ Charles R Greathouse IV, Feb 15 2013

Formula

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

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

A082896 a(n) = A082893(n)/n.

Original entry on oeis.org

2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
Offset: 1

Views

Author

Labos Elemer, Apr 22 2003

Keywords

Comments

Checked for the first 120000 terms to be the same as A079416. - R. J. Mathar, Sep 17 2008

Crossrefs

Programs

  • Mathematica
    Table[Floor[(Floor[n/2]+Prime)/n], {n, 1, 100}]

Formula

a(n) = floor((floor(n/2) + p(n))/n), where p(n) is the n-th prime.

A065482 a(n) = round( 2^n/n ).

Original entry on oeis.org

2, 2, 3, 4, 6, 11, 18, 32, 57, 102, 186, 341, 630, 1170, 2185, 4096, 7710, 14564, 27594, 52429, 99864, 190650, 364722, 699051, 1342177, 2581110, 4971027, 9586981, 18512790, 35791394, 69273666, 134217728, 260301048, 505290270, 981706811, 1908874354, 3714566310
Offset: 1

Views

Author

N. J. A. Sloane, Dec 03 2001

Keywords

Crossrefs

Programs

  • Magma
    [Round(2^n/n): n in [1..30]]; // G. C. Greubel, Jan 18 2018
    
  • Mathematica
    Table[Floor[(Floor[n/2]+2^n)/n], {n, 1, 100}]
  • PARI
    a(n) = { round(2^n/n) } \\ Harry J. Smith, Oct 20 2009
    
  • Python
    def A065482(n): return ((1<>1))//n # Chai Wah Wu, Apr 23 2025

Formula

a(n) = A082894(n)/n.
a(n) = floor((2^n + floor(n/2))/n).
Showing 1-6 of 6 results.