OFFSET
1,3
LINKS
Simon Strandgaard, Plot of 10000 terms
EXAMPLE
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.
MATHEMATICA
Array[Mod[#3*10^(1 + Floor[Log10[#1]]) + #1, #2] & @@ {#, Prime[#], Prime[# + 1]} &, 64] (* Michael De Vlieger, Aug 18 2021 *)
PROG
(PARI) a(n) = eval(Str(prime(n+1), n)) % prime(n);
(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
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Simon Strandgaard, Aug 18 2021
STATUS
approved