login
A024699
a(n) = (prime(n+2)-1)/6 if this is an integer or (prime(n+2)+ 1)/6 otherwise.
5
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, 19, 21, 22, 23, 23, 25, 25, 26, 27, 28, 29, 30, 30, 32, 32, 33, 33, 35, 37, 38, 38, 39, 40, 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
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:
A024699 := proc(n) A103221(ithprime(n+2)) ; end proc: seq(A024699(n), n=1..120) ; (End)
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
Sequence in context: A209081 A248610 A168581 * A083479 A112231 A334742
KEYWORD
nonn
STATUS
approved