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 11-13 of 13 results.

A330823 a(1) = 1; for n > 1, a(n) = a(n-1) - n if n is prime, otherwise a(n) = a(n-1) + floor(n/(log(n)-1)).

Original entry on oeis.org

1, -1, -4, 6, 1, 8, 1, 8, 15, 22, 11, 19, 6, 14, 22, 31, 14, 23, 4, 14, 24, 34, 11, 22, 33, 44, 55, 67, 38, 50, 19, 31, 44, 57, 70, 83, 46, 60, 74, 88, 47, 62, 19, 34, 50, 66, 19, 35, 51, 68, 85, 102, 49, 67, 85, 103, 121, 139, 80, 99, 38, 57, 77, 97, 117, 137, 70
Offset: 1

Views

Author

Scott R. Shannon, Jan 02 2020

Keywords

Comments

The Prime Number Theorem shows that the probability of a random number not greater than x being prime is approximately 1/log(x), therefore the probability of a number being composite in the same range is approximately (log(x)-1)/log(x). As this sequence subtracts n from the previous term if n is prime, or adds n with a weighting of 1/(log(n)-1) if n is composite, its expected value as n goes to infinity is approximately n*(1/(log(n)-1))*((log(n)-1)/log(n)) - n*(1/log(n)) = 0. We therefore expect that a(n)/n approaches 0 as n goes to infinity.
In the first 2 million terms the sequence changes sign 1900 times, has a maximum positive value of 160213275 at a(1772200), and a maximum negative value of -29535301 at a(1513751). The majority of terms are positive. See the image link below.

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = a[n - 1] + If[PrimeQ[n], -n, Floor[n/(Log[n] - 1)]]; Array[a, 67] (* Amiram Eldar, Jan 05 2020 *)

A380198 Difference between pi(2^n) and the integer nearest to 2^n / log(2^n).

Original entry on oeis.org

-2, -1, 0, 0, 2, 3, 5, 8, 15, 24, 40, 72, 119, 212, 360, 633, 1128, 1989, 3580, 6386, 11537, 20897, 37980, 69354, 127336, 234054, 431877, 799754, 1484440, 2763961, 5156791, 9644970, 18080775, 33959344, 63902732, 120474951, 227515953, 430345298, 815241632
Offset: 1

Views

Author

James C. McMahon, Jan 16 2025

Keywords

Examples

			n   2^n   pi(2^n)  round(2^n/log(2^n))  a(n)
------------------------------------------------
1     2     1         3                  -2
2     4     2         3                  -1
3     8     4         4                   0
4    16     6         6                   0
		

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[2^n]-Round[2^n/Log[2^n]],{n,39}]

Formula

a(n) = - A053622(2^n).
a(n) = A007053(n) - A050499(2^n).

A342355 Decimal expansion of 163/log(163).

Original entry on oeis.org

3, 1, 9, 9, 9, 9, 9, 8, 7, 3, 8, 4, 9, 0, 0, 8, 2, 6, 7, 5, 7, 5, 8, 3, 9, 3, 0, 2, 6, 5, 5, 6, 5, 4, 7, 9, 4, 1, 0, 9, 0, 6, 5, 1, 4, 9, 2, 0, 8, 2, 9, 3, 9, 6, 9, 6, 4, 0, 9, 9, 0, 9, 6, 6, 9, 6, 3, 1, 9, 5, 7, 6, 8, 4, 6, 6, 0, 8, 3, 2, 2, 1, 1, 7, 1, 2, 9, 5, 9, 5, 8, 9, 1, 8, 4, 9, 0
Offset: 2

Views

Author

Michal Paulovic, Mar 08 2021

Keywords

Comments

A near-integer close to 32.

Examples

			31.9999987384900826...
		

Crossrefs

Programs

  • MATLAB
    format long; 163 / log(163)
  • Maple
    Digits:=100; evalf(163/ln(163));
  • Mathematica
    RealDigits[163/Log[163], 10, 100][[1]]
  • PARI
    default(realprecision, 100); 163 / log(163)
    

Formula

Equals 163/log(163).
Previous Showing 11-13 of 13 results.