OFFSET
0,2
COMMENTS
This sequence has similarities with A102370: here, for k > 0, a(n) and n + k have the same prime(k)-adic valuation, there, for k >= 0, A102370(n) and n + k have the same k-th binary digit (the least significant binary digit having index 0).
For any positive number, say k, we can use the Chinese remainder theorem to find a term that is a multiple of k; this term has index < k.
a(n) is even iff n is odd.
See A298161 for the indices of ones in the sequence.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10000
FORMULA
EXAMPLE
For n = 7:
- the 2-adic valuation of 7 + 1 is 3,
- the 3-adic valuation of 7 + 2 is 2,
- the 5-adic valuation of 7 + 3 is 1,
- the 7-adic valuation of 7 + 4 is 0,
- the 11-adic valuation of 7 + 5 is 0,
- the 13-adic valuation of 7 + 6 is 1,
- for k > 6, the prime(k)-adic valuation of 7 + k is 0,
- hence a(7) = 2^3 * 3^2 * 5^1 * 13^1 = 4680.
MAPLE
f:= proc(n) local v, p, k;
v:= 1: p:= 1:
for k from 1 do
p:= nextprime(p);
if p > n+k then return v fi;
v:= v * p^padic:-ordp(n+k, p)
od
end proc:
map(f, [$0..100]); # Robert Israel, Jan 16 2018
MATHEMATICA
f[n_] := Module[{v = 1, p = 1, k}, For[k = 1, True, k++, p = NextPrime[p]; If[p > n + k, Return[v]]; v *= p^IntegerExponent[n + k, p]]];
f /@ Range[0, 100] (* Jean-François Alcover, Jul 30 2020, after Maple *)
PROG
(PARI) a(n) = my (v=1, k=0); forprime(p=1, oo, k++; if (n+k < p, break); v *= p^valuation(n+k, p)); return (v)
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Jan 13 2018
STATUS
approved