close
login
A387921
a(n) is the least number k such that A005704(k) is divisible by prime(n).
1
1, 2, 3, 4, 11, 20, 49, 29, 9, 34, 18, 109, 32, 69, 13, 45, 90, 77, 33, 182, 183, 59, 446, 167, 101, 56, 206, 125, 63, 46, 36, 28, 37, 130, 301, 174, 185, 236, 104, 99, 136, 578, 78, 391, 86, 79, 200, 177, 241, 64, 547, 27, 444, 337, 115, 61, 194, 372, 117, 464
OFFSET
1,2
COMMENTS
a(n) exists for all n (Woodrow, 2004).
LINKS
R. E. Woodrow, 40th International Mathematical Olympiad, Vietnam Team Selection Test, Hanoi, Vietnam, May 8-9, 2001, The Olympiad Corner No. 235, Crux Mathematicorum, Vol. 30, No. 1 (2004), p. 17.
EXAMPLE
a(1) = 1 since A005704(1) = 2 is the least term of A005704 that is divisible by prime(1) = 2.
a(5) = 11 since A005704(11) = 33 is the least term of A005704 that is divisible by prime(5) = 11.
MATHEMATICA
s[0] = 1; s[n_] := s[n] = s[n-1] + s[Floor[n/3]]; a[n_] := Module[{p = Prime[n], k = 1}, While[!Divisible[s[k], p], k++]; k]; Array[a, 100]
PROG
(PARI) memoA005704 = Map();
s(n) = {my(v); if(!mapisdefined(memoA005704, n, &v), v = if(n == 0, 1, s(n-1) + s(n\3)); mapput(memoA005704, n, v)); v; }
a(n) = {my(p = prime(n), k = 1); while(s(k) % p, k++); k; }
CROSSREFS
Cf. A005704.
Sequence in context: A297180 A162969 A104109 * A066347 A367807 A118596
KEYWORD
nonn
AUTHOR
Amiram Eldar, Sep 12 2025
STATUS
approved