cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A048852 Difference between b^2 (in c^2=a^2+b^2) and product of successive prime pairs.

Original entry on oeis.org

0, 3, 10, 14, 44, 26, 68, 38, 92, 174, 62, 222, 164, 86, 188, 318, 354, 122, 402, 284, 146, 474, 332, 534, 776, 404, 206, 428, 218, 452, 1778, 524, 822, 278, 1490, 302, 942, 978, 668, 1038, 1074, 362, 1910, 386, 788, 398, 2532, 2676, 908, 458, 932, 1434, 482
Offset: 0

Views

Author

Keywords

Examples

			a(3)=10. Product of 3rd prime pair 3*5=15 (after 2*2=4 and 2*3=6). b^2=25 (in c^2=a^2+b^2) where c^2=34 and a^2=9. Then 25-15=10.
		

Crossrefs

Programs

  • Magma
    [0] cat [NthPrime(n+1)*(NthPrime(n+1)-NthPrime(n)): n in [1..60]]; // G. C. Greubel, Feb 22 2024
    
  • Mathematica
    With[{P=Prime}, Table[If[n==0, 0, P[n+1]*(P[n+1]-P[n])], {n,0,60}]] (* G. C. Greubel, Feb 22 2024 *)
  • SageMath
    p=nth_prime; [0]+[p(n+1)*(p(n+1)-p(n)) for n in range(1,61)] # G. C. Greubel, Feb 22 2024

Formula

Find b^2 in Pythagorean formula c^2=a^2+b^2. Subtract product of successive prime pair at same a(n) beginning at 2*2.
For n>0, a(n) = A000040(n+1)^2 - A000040(n) * A000040(n+1). - Mamuka Jibladze, Mar 24 2017

A064009 a(n) = Sum_{k=1..n} d(k)*prime(k), where d(k) = A001223.

Original entry on oeis.org

2, 8, 18, 46, 68, 120, 154, 230, 368, 426, 612, 760, 842, 1014, 1296, 1614, 1732, 2098, 2366, 2508, 2946, 3262, 3760, 4472, 4860, 5062, 5474, 5688, 6124, 7706, 8214, 9000, 9274, 10664, 10962, 11868, 12810, 13462, 14464, 15502, 15860, 17670, 18052
Offset: 1

Views

Author

Jason Earls, Sep 06 2001

Keywords

Examples

			a(4) = 2*(3-2) + 3*(5-3) + 5*(7-5) + 7*(11-7) = 46.
		

Crossrefs

Cf. A001223.
Partial sums of A291463.

Programs

  • Mathematica
    Accumulate@ Array[# (NextPrime@ # - #) &@ Prime@ # &, {43}] (* Michael De Vlieger, May 05 2016 *)
  • PARI
    d(n) = prime(n+1)-prime(n); j=[]; for(n=1,150,j=concat(j,sum(k=1,n, prime(k)*d(k)))); j
    
  • PARI
    d(n)= { prime(n + 1) - prime(n) }
    { a=0; for (n=1, 1000, write("b064009.txt", n, " ", a+=prime(n)*d(n)) ) } \\ Harry J. Smith, Sep 05 2009
    
  • Sage
    p=primes_first_n(44); d=differences(p); v=[]; a=0
    for k in range(len(d)):
       a+=p[k]*d[k]; v.append(a)
    print(v)  # Giuseppe Coppoletta, May 05 2016
Showing 1-2 of 2 results.