The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A095248 a(n) = least k > 0 such that n-th partial sum is divisible by n if and only if n is not prime. 1

%I #7 Oct 04 2017 14:02:47

%S 1,2,1,4,1,3,1,3,2,2,1,3,1,3,2,2,1,3,1,3,2,2,1,3,2,2,2,2,1,3,1,3,2,2,

%T 2,2,1,3,2,2,1,3,1,3,2,2,1,3,2,2,2,2,1,3,2,2,2,2,1,3,1,3,2,2,2,2,1,3,

%U 2,2,1,3,1,3,2,2,2,2,1,3,2,2,1,3,2,2,2,2,1,3,2,2,2,2,2,2,1,3,2,2,1,3,1,3,2

%N a(n) = least k > 0 such that n-th partial sum is divisible by n if and only if n is not prime.

%H Antti Karttunen, <a href="/A095248/b095248.txt">Table of n, a(n) for n = 1..10000</a>

%e n = 1 is not prime, k = 1 results in first partial sum 1 divisible by 1 as required, so a(1) = 1.

%e n = 2 is prime, k = 1 results in second partial sum 2 divisible by 2 and is excluded, but k = 2 results in second partial sum 3 not divisible by 2 as required, so a(2) = 2.

%o (PARI) {m=105;s=0;for(n=1,m,k=1;if(isprime(n), while((s+k)%n==0,k++), while((s+k)%n>0,k++));print1(k,",");s=s+k)}

%K nonn

%O 1,2

%A _Amarnath Murthy_, Jun 17 2004

%E Edited and extended by _Klaus Brockhaus_, Jun 19 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 May 28 14:43 EDT 2024. Contains 372913 sequences. (Running on oeis4.)