OFFSET
1,2
COMMENTS
This is a variant of A333577 where prime(n) and prime(n+1) are switched.
Some particular results:
a(n) = prime(n) * prime(n+1) for a(2) = 3*5,
a(n) = prime(n) * prime(n-1) for a(8) = 19*17,
a(n) = prime(n)^2 for a(9) = 23^2 or a(23) = 83^2,
a(n) = concatenation of prime(n-1) and prime(n+1) for a(4) = 511.
EXAMPLE
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.
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.
MATHEMATICA
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 *)
PROG
(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
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Apr 08 2020
EXTENSIONS
More terms from Michel Marcus, Apr 08 2020
STATUS
approved