OFFSET
1,2
LINKS
Sean A. Irvine, Table of n, a(n) for n = 1..500
Sean A. Irvine, Java program (github)
MAPLE
q:= proc(n) option remember; {seq(irem(i^3, n), i=1..n)} end:
a:= proc(n) option remember; local k, l; l:= [seq(a(i), i=1..n-1)];
for k from a(n-1)+1 while not andmap(x-> irem(k, x) in q(x), l)
do od: k
end: a(1):=1:
seq(a(n), n=1..48); # Alois P. Heinz, Feb 23 2022
MATHEMATICA
q[n_] := q[n] = Table[Mod[i^3, n], {i, 1, n}] // Union;
a[n_] := a[n] = Module[{k, l}, l = Array[a, n-1];
For[k = a[n-1]+1, !AllTrue[l, MemberQ[q[#], Mod[k, #]]&], k++]; k];
a[1] = 1;
Table[a[n], {n, 1, 48}] (* Jean-François Alcover, May 20 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Henry Bottomley, May 15 2000
EXTENSIONS
Corrected and extended by Sean A. Irvine, Feb 22 2022
STATUS
approved