login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A095202 Value of largest k such that (n-1) + (n-2) + (n-3) + ... + (n-k) is a multiple of n, or 0 if no such k exists. 2

%I #3 Dec 05 2013 19:56:51

%S 0,0,2,0,4,3,6,0,8,4,10,8,12,7,14,0,16,8,18,15,20,11,22,15,24,12,26,7,

%T 28,24,30,0,32,16,34,8,36,19,38,15,40,35,42,32,44,23,46,32,48,24,50,

%U 39,52,27,54,48,56,28,58,39,60,31,62,0,64,44,66,16,68,55,70,63,72,36,74,56

%N Value of largest k such that (n-1) + (n-2) + (n-3) + ... + (n-k) is a multiple of n, or 0 if no such k exists.

%C Equivalently, largest k < n such that k-th triangular number (A000217(k)) is a multiple of n, or 0 if no such k exists.

%F a(2n-1) = 2n-2 for all n >= 1; a(2^n) = 0 for all n >= 1.

%o (PARI) {a(n) = s=0; saved_k=0; k=0; while(k<n-1, k++; s=s+(n-k); if(s%n==0,saved_k=k)); saved_k}

%Y Cf. A095200, A095201.

%Y Cf. A000217 (triangular numbers).

%K nonn

%O 1,3

%A _Amarnath Murthy_, Jun 05 2004

%E Edited by _Rick L. Shepherd_, Jun 08 2004

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 04:42 EDT 2024. Contains 371964 sequences. (Running on oeis4.)