login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

a(100959)=13. - Alois P. Heinz, Jun 17 2015

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..20000

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:

seq(a(n), n=1..100);  # Alois P. Heinz, Jun 17 2015

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

Sequence in context: A107865 A089225 A185110 * A217458 A124048 A087059

Adjacent sequences:  A075082 A075083 A075084 * A075086 A075087 A075088

KEYWORD

nonn,look

AUTHOR

Amarnath Murthy, Sep 13 2002

EXTENSIONS

More terms from David Wasserman, Jan 16 2005

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 23 05:36 EDT 2019. Contains 321422 sequences. (Running on oeis4.)