|
|
A075085
|
|
a(n) is the smallest number not already in the sequence such that Sum_{k=1..n} a(k) is divisible by prime(n).
|
|
1
|
|
|
2, 1, 7, 4, 8, 17, 12, 6, 35, 24, 39, 30, 20, 10, 67, 36, 95, 14, 42, 28, 87, 48, 32, 137, 72, 238, 22, 44, 131, 161, 55, 179, 78, 26, 130, 177, 84, 247, 60, 90, 269, 213, 170, 34, 68, 233, 5, 204, 295, 265, 76, 114, 38, 190, 371, 120, 389, 313, 132, 88, 327, 230, 15, 399
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Original title: Rearrangement of natural numbers such that the n-th partial sum is divisible by the n-th prime.
The numbers 3, 9, 13, ... do not appear in the first 1655 terms of this sequence. Is this truly a permutation of the natural numbers? - Derek Orr, Jun 16 2015
The numbers 3, 9, 16, 18, 19, ... do not appear in the first 80 million terms of this sequence - Carl R. White, Mar 07 2024
|
|
LINKS
|
|
|
MAPLE
|
b:= proc() false end:
s:= proc(n) option remember; a(n)+s(n-1) end: s(0):=0:
a:= proc(n) option remember; local k, p; p:= ithprime(n);
for k from p*(iquo(s(n-1), p)+1)-s(n-1)
while b(k) by p do od; b(k):= true; k
end:
|
|
MATHEMATICA
|
f[lst_] := Block[{k = 1, p = Prime[1 + Length@ lst], s = Total@ lst}, While[Mod[s + k, p] != 0 || MemberQ[lst, k], k++]; Append[lst, k]]; Nest[f, {}, 64] (* Robert G. Wilson v, Jun 17 2015 *)
|
|
PROG
|
(PARI) v=[2]; n=1; while(n<10^3, s=(n+vecsum(v))%prime(#v+1); if(!(s||vecsearch(vecsort(v), n)), v=concat(v, n); n=0); n++); v \\ Derek Orr, Jun 16 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|