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!)
A123907 a(n) = T(p(n)) - p(T(n)) = Commutator[triangular numbers, primes] at n. 1
1, 1, 2, -1, 19, 18, 46, 39, 79, 178, 179, 306, 394, 375, 469, 662, 887, 872, 1127, 1265, 1248, 1553, 1703, 2018, 2600, 2780, 2763, 2987, 2958, 3134, 4587, 4849, 5380, 5373, 6518, 6503, 7100, 7725, 8089, 8750, 9431, 9452, 10859, 10892, 11260, 11219, 13275, 15485, 15947, 15908, 16358, 17257, 17222, 19189 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Asymptotically p(T(n)) ~ (n^2 + n)*(log n) and T(p(n)) ~ (1/2)(n log n)^2, hence asymptotically a(n) ~ (1/2)(n log n)^2 - (n^2 + n)*(log n) = O((n^2)(log n)^2). a(4) = -1 should be the only negative value.
LINKS
FORMULA
a(n) = T(p(n)) - p(T(n)) where T(i) = i*(i+1)/2, p(i) = prime(i).
a(n) = A000217(A000040(n)) - A000040(A000217(n)).
a(n) = (p(n)*(p(n)+1))/2 - p(n*(n+1)/2)) where p(i) = prime(i).
a(n) = A034953(n) - A011756(n).
EXAMPLE
a(1) = T(p(1)) - p(T(1)) = T(2) - p(1) = 3 - 2 = 1.
a(2) = T(p(2)) - p(T(2)) = T(2) - p(1) = 6 - 5 = 1.
a(3) = T(p(3)) - p(T(3)) = T(2) - p(1) = 15 - 13 = 1.
a(4) = T(p(4)) - p(T(4)) = T(2) - p(1) = 28 - 29 = -1.
a(5) = T(p(5)) - p(T(5)) = T(2) - p(1) = 66 - 47 = 19.
MAPLE
A000040 := proc(n) ithprime(n) ; end; A000217 := proc(n) n*(n+1)/2 ; end; A123907 := proc(n) A000217(A000040(n))-A000040(A000217(n)) ; end ; for n from 1 to 80 do printf("%d, ", A123907(n)) ; end; # R. J. Mathar, Jan 13 2007
MATHEMATICA
With[{B=Binomial, P=Prime}, Table[B[P[n]+1, 2] -P[B[n+1, 2]], {n, 60}]] (* G. C. Greubel, Aug 06 2019 *)
PROG
(PARI) vector(60, n, p=prime; b=binomial; b(p(n)+1, 2) - p(b(n+1, 2)) ) \\ G. C. Greubel, Aug 06 2019
(Magma) P:=NthPrime; B:=Binomial; [B(P(n)+1, 2) - P(B(n+1, 2)): n in [1..60]]; // G. C. Greubel, Aug 06 2019
(Sage) p=nth_prime; b=binomial; [b(p(n)+1, 2) - p(b(n+1, 2)) for n in (1..60)] # G. C. Greubel, Aug 06 2019
CROSSREFS
Sequence in context: A349960 A181870 A070890 * A367971 A013016 A012901
KEYWORD
easy,sign,less
AUTHOR
Jonathan Vos Post, Oct 28 2006
EXTENSIONS
More terms from R. J. Mathar, Jan 13 2007
STATUS
approved

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 August 24 14:47 EDT 2024. Contains 375417 sequences. (Running on oeis4.)