|
| |
|
|
A072562
|
|
Smallest of exactly n consecutive integers divisible respectively by the first n primes.
|
|
12
|
|
|
|
4, 2, 8, 158, 3098, 788, 210998, 5316098, 34415168, 703693778, 194794490678, 5208806743928, 138782093170508, 5006786309605868, 253579251611336438, 12551374903381164638, 142908008812141343558, 77053322014980646906358
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
|
OFFSET
|
1,1
|
|
|
COMMENTS
|
|
|
|
LINKS
|
|
|
|
FORMULA
|
|
|
|
EXAMPLE
|
a(4)=158 because 158 is the least number such that 158, 159, 160 and 161 are divisible by 4 consecutive primes, namely 2, 3, 5 and 7 respectively.
a(5) does not equal A069561(5)=788 because 788 is the smallest integer in a run of 6 (not 5) consecutive integers that are divisible respectively by the first 6 consecutive primes. - Geoffrey Critzer, Oct 29 2014
|
|
|
MAPLE
|
A:= proc(n)
local r;
if n = 1 then return 4 fi;
r:= chrem([seq(-i, i=0..n-1)], [seq(ithprime(i), i=1..n)]);
if r + n mod ithprime(n+1) = 0 then r + mul(ithprime(i), i=1..n) else r fi
end proc:
|
|
|
MATHEMATICA
|
f[n_] := Block[{p = Prime@ Range@ n}, r = ChineseRemainder[-Range@ n + 1, p]; If[ Mod[r + n, Prime[n + 1]] == 0, r + Times @@ p, r]]; f[1] = 4; Array[f, 20] (* Robert G. Wilson v, Oct 30 2014 *)
|
|
|
PROG
|
(PARI) a(n)=if(n==1, return(4)); my(m=chinese(vector(n, k, Mod(1-k, prime(k)))), p=prime(n+1), t=lift(m)); if((t+n)%p, t, t+m.mod) \\ Charles R Greathouse IV, Jun 20 2015
|
|
|
CROSSREFS
|
|
|
|
KEYWORD
|
nonn
|
|
|
AUTHOR
|
|
|
|
EXTENSIONS
|
|
|
|
STATUS
|
approved
|
| |
|
|