A347112 a(n) = concat(prime(n+1),n) mod prime(n).
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
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.
Links
- Simon Strandgaard, Plot of 10000 terms
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