OFFSET
1,3
COMMENTS
Also number of partitions of n-th prime > 3 into a sum of 2's or 3's (inclusive or).
From Wolfdieter Lang, Mar 13 2012: (Start)
The primes of the form 6*k+1 are given in A002476.
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.
The primes of the form 6*k-1 are given in A007528.
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.
(End)
FORMULA
a(n) = A103221(prime(n+2)). - R. J. Mathar, May 02 2010
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
MAPLE
From R. J. Mathar, May 02 2010: (Start)
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:
MATHEMATICA
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 *)
Table[Floor[(Prime[n + 2] + 3) / 6], {n, 100}] (* Vincenzo Librandi, Sep 06 2016 *)
PROG
(PARI) a(n) = (prime(n+2)+3)\6; \\ Michel Marcus, Sep 06 2016; after Wolfdieter Lang
(Magma) [(NthPrime(n+2)+3) div 6: n in [1..80]]; // Vincenzo Librandi, Sep 06 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved