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!)
A024699 a(n) = (prime(n+2)-1)/6 if this is an integer or (prime(n+2)+ 1)/6 otherwise. 5

%I #39 Sep 08 2022 08:44:48

%S 1,1,2,2,3,3,4,5,5,6,7,7,8,9,10,10,11,12,12,13,14,15,16,17,17,18,18,

%T 19,21,22,23,23,25,25,26,27,28,29,30,30,32,32,33,33,35,37,38,38,39,40,

%U 40,42,43,44,45,45,46,47,47,49,51,52,52,53,55,56,58,58,59,60,61,62,63,64,65,66,67,68,70

%N a(n) = (prime(n+2)-1)/6 if this is an integer or (prime(n+2)+ 1)/6 otherwise.

%C Also number of partitions of n-th prime > 3 into a sum of 2's or 3's (inclusive or).

%C From _Wolfdieter Lang_, Mar 13 2012: (Start)

%C The primes of the form 6*k+1 are given in A002476.

%C For n >= 1 such that prime(n+2) is from A002476, one has 8*T(prime(n+2)-1) + 1 = r(n)^2, n >= 1, with the triangular numbers T(n) = A000217(n) and r(n) = A208296(n). Therefore, 24*prime(n+2)*a(n) + 1 = r(n)^2. E.g., n=2: prime(4)=7, a(2)=1, 8*21 + 1 = 13^2 = A208296(2)^2 = 24*7*1 + 1.

%C The primes of the form 6*k-1 are given in A007528.

%C For n >= 1 such that prime(n+2) is from A007528, one has 8*T(prime(n+2)) + 1 = r(n)^2. For T and r see the preceding comment. Therefore, 24*prime(n+2)*a(n) + 1 = r(n)^2. E.g., n=1, prime(3)=5, a(1)=1, 8*15 + 1 = 11^2 = A208296(1)^2 = 24*5*1 + 1.

%C (End)

%F a(n) = A103221(prime(n+2)). - _R. J. Mathar_, May 02 2010

%F a(n) = floor((prime(n+2)+3)/6), n >= 1, prime(n)=A000040(n). Consider the two cases prime(n+2) == 1 (mod 6) and == -1 (mod 6) separately. See the formula above. - _Wolfdieter Lang_, Mar 15 2012

%p From _R. J. Mathar_, May 02 2010: (Start)

%p A103221 := proc(n) a := 0 ; for t from 0 do if 2*t > n then return a; end if; if n-2*t mod 3 = 0 then a := a+1 ; end if; end do : end proc:

%p A024699 := proc(n) A103221(ithprime(n+2)) ; end proc: seq(A024699(n),n=1..120) ; (End)

%t pi6[n_]:=Module[{p=Prime[n+2],c},c=(p-1)/6;If[IntegerQ[c],c,(p+1)/6]]; Array[pi6,80] (* _Harvey P. Dale_, Aug 19 2013 *)

%t Table[Floor[(Prime[n + 2] + 3) / 6], {n, 100}] (* _Vincenzo Librandi_, Sep 06 2016 *)

%o (PARI) a(n) = (prime(n+2)+3)\6; \\ _Michel Marcus_, Sep 06 2016; after _Wolfdieter Lang_

%o (Magma) [(NthPrime(n+2)+3) div 6: n in [1..80]]; // _Vincenzo Librandi_, Sep 06 2016

%K nonn

%O 1,3

%A _Clark Kimberling_

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 13 21:51 EDT 2024. Contains 372523 sequences. (Running on oeis4.)