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.

A347112 a(n) = concat(prime(n+1),n) mod prime(n).

Original entry on oeis.org

1, 1, 3, 2, 3, 7, 10, 10, 0, 7, 22, 5, 8, 27, 4, 33, 40, 8, 17, 7, 37, 27, 42, 23, 37, 24, 15, 14, 102, 74, 50, 108, 96, 61, 86, 32, 9, 112, 138, 121, 62, 137, 52, 58, 48, 52, 192, 2, 22, 221, 185, 13, 89, 152, 141, 130, 257, 116, 182, 260, 212, 290, 156, 264
Offset: 1

Views

Author

Simon Strandgaard, Aug 18 2021

Keywords

Examples

			a(1) = concat( 3,1) mod  2 = 1,
a(2) = concat( 5,2) mod  3 = 1,
a(3) = concat( 7,3) mod  5 = 3,
a(4) = concat(11,4) mod  7 = 2,
a(5) = concat(13,5) mod 11 = 3.
		

Crossrefs

Programs

  • Mathematica
    Array[Mod[#3*10^(1 + Floor[Log10[#1]]) + #1, #2] & @@ {#, Prime[#], Prime[# + 1]} &, 64] (* Michael De Vlieger, Aug 18 2021 *)
  • PARI
    a(n) = eval(Str(prime(n+1),n)) % prime(n);
    
  • Python
    from sympy import prime
    def a(n): return int(str(prime(n+1)) + str(n))%prime(n)
    print([a(n) for n in range(1, 65)]) # Michael S. Branicky, Aug 18 2021
  • Ruby
    require 'prime'
    values = []
    primes = Prime.first(50)
    primes.each_index do |n|
      next if n < 1
      values << (primes[n].to_s + n.to_s).to_i % primes[n-1]
    end
    p values