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.

A342730 a(n) = floor((frac(e*n) + 1) * prime(n+1)).

Original entry on oeis.org

2, 5, 7, 8, 20, 20, 22, 19, 40, 42, 36, 70, 66, 57, 49, 94, 88, 73, 129, 116, 99, 85, 149, 135, 120, 197, 172, 149, 121, 206, 196, 165, 271, 236, 211, 172, 291, 256, 216, 175, 309, 262, 223, 364, 316, 263, 219, 392, 335, 273, 445, 390, 325, 268, 459, 395
Offset: 0

Views

Author

Simon Strandgaard, Mar 19 2021

Keywords

Examples

			x(n) = frac(e * n) + 1,
a(0) = floor(x(0) * prime(1)) = floor(1.00 *  2) =  2,
a(1) = floor(x(1) * prime(2)) = floor(1.72 *  3) =  5,
a(2) = floor(x(2) * prime(3)) = floor(1.44 *  5) =  7,
a(3) = floor(x(3) * prime(4)) = floor(1.15 *  7) =  8,
a(4) = floor(x(4) * prime(5)) = floor(1.87 * 11) = 20.
		

Crossrefs

Programs

  • Mathematica
    Array[Floor[(Mod[E #, 1] + 1) Prime[# + 1]] &, 56, 0] (* Michael De Vlieger, Mar 19 2021 *)
  • PARI
    a(n) = floor((frac(exp(1)*n) + 1) * prime(n+1)); \\ Michel Marcus, Mar 20 2021
  • Ruby
    require 'prime'
    values = []
    primes = Prime.first(20)
    primes.each_with_index do |prime, n|
        x = ((n * Math::E) % 1) + 1
        values << (x * prime).floor
    end
    p values