login
a(1) = a(3) = 0, and otherwise a(n) is the least multiple of prime(n) whose decimal representation ends with that of prime(n+1).
1

%I #22 Apr 29 2021 01:41:06

%S 0,15,0,511,913,117,119,323,529,1131,837,3441,943,1247,4653,159,4661,

%T 2867,871,4473,1679,6083,6889,6497,71101,81103,7107,52109,17113,54127,

%U 32131,82137,20139,82149,104151,16157,119163,148167,3173,73179,150181,38191,157193,44197,13199

%N a(1) = a(3) = 0, and otherwise a(n) is the least multiple of prime(n) whose decimal representation ends with that of prime(n+1).

%C This is a variant of A333577 where prime(n) and prime(n+1) are switched.

%C Some particular results:

%C a(n) = prime(n) * prime(n+1) for a(2) = 3*5,

%C a(n) = prime(n) * prime(n-1) for a(8) = 19*17,

%C a(n) = prime(n)^2 for a(9) = 23^2 or a(23) = 83^2,

%C a(n) = concatenation of prime(n-1) and prime(n+1) for a(4) = 511.

%e For prime(3) = 5 and prime(4) = 7, there does not exist any integer that ends with 7 and is divisible by 5, hence a(3)=0.

%e For prime(6) = 13 and prime(7) = 17, 117 ends with 17 and 117 = 9*13 is divisible by 13, and no integer < 117 satisfies these two conditions, so a(6) = 117.

%t a[1] = a[3] = 0; a[n_] := Module[{p = Prime[n], q, r}, q = NextPrime[p]; r = 10^Ceiling[Log10[q]]; While[!Divisible[q, p], q += r]; q]; Array[a, 45] (* _Amiram Eldar_, Apr 08 2020 *)

%o (PARI) a(n) = {if ((n==1) || (n==3), return(0)); my(q = prime(n+1), p = prime(n), x = q, k = 0); until ((x % p) == 0, k++; x = eval(concat(Str(k), Str(q)));); x;} \\ _Michel Marcus_, Apr 08 2020

%o (PARI) a(n) = { if (n==1 || n==3, 0, my (p=prime(n), q=nextprime(p+1)); lift(chinese(Mod(0, p), Mod(q, 10^#digits(q))))) } \\ _Rémy Sigrist_, Apr 09 2020

%Y Cf. A333577.

%K nonn,base

%O 1,2

%A _Bernard Schott_, Apr 08 2020

%E More terms from _Michel Marcus_, Apr 08 2020