login
This site is supported by donations 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
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, 28, 24, 30, 0, 32, 16, 34, 8, 36, 19, 38, 15, 40, 35, 42, 32, 44, 23, 46, 32, 48, 24, 50, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

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

LINKS

Table of n, a(n) for n=1..76.

FORMULA

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

PROG

(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}

CROSSREFS

Cf. A095200, A095201.

Cf. A000217 (triangular numbers).

Sequence in context: A241384 A140254 A204187 * A291937 A243488 A154849

Adjacent sequences:  A095199 A095200 A095201 * A095203 A095204 A095205

KEYWORD

nonn

AUTHOR

Amarnath Murthy, Jun 05 2004

EXTENSIONS

Edited by Rick L. Shepherd, Jun 08 2004

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 May 26 15:29 EDT 2019. Contains 323597 sequences. (Running on oeis4.)