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.

Previous Showing 11-20 of 52 results. Next

A082749 Difference between the sum of next prime(n) natural numbers and the sum of next n primes.

Original entry on oeis.org

1, 4, 9, 10, 54, 71, 191, 236, 446, 1025, 1310, 2259, 3245, 3820, 5048, 7321, 10060, 11473, 15328, 18358, 20381, 25672, 30222, 36561, 46367, 53031, 58108, 65444, 70971, 78391, 104184, 116542, 133095, 142728, 169931, 181324, 203429, 226622
Offset: 1

Views

Author

Amarnath Murthy, Apr 17 2003

Keywords

Comments

Group the natural numbers with prime(n) elements in each group. (1,2),(3,4,5),(6,7,8,9,10),(11,12,13,14,15,16,17),... The sum corresponding the groups is 3,12,40,98,... Group the prime numbers such that the n-th group contains n primes. (2),(3,5),(7,11,13),(17,19,23,29),... The sum corresponding the groups is 2,8,31,88,... The required difference is 1,4,9,10,...
The following sequences (allowing offset of first term) all appear to have the same parity: A034953, triangular numbers with prime indices; A054269, length of period of continued fraction for sqrt(p), p prime; A082749, difference between the sum of next prime(n) natural numbers and the sum of next n primes; A006254, numbers n such that 2n-1 is prime; A067076, 2n+3 is a prime. - Jeremy Gardiner, Sep 10 2004

Programs

  • Mathematica
    Module[{nn=80,trms=40,c,nat,pr},c=(nn(nn+1))/2;nat=Total/@TakeList[Range[c],Prime[Range[trms]]];pr=Total/@TakeList[Prime[Range[c]], Range[trms]]; Differences/@ Thread[{pr,nat}]]//Flatten (* Harvey P. Dale, Apr 13 2025 *)

Formula

a(n) = ((A061802(n-1) + 1)*A000040(n))/2 - A007468(n). - Gionata Neri, May 17 2015

Extensions

More terms from Ray Chandler, May 13 2003

A127920 1/6 of product of three numbers: n-th prime, previous and following number.

Original entry on oeis.org

1, 4, 20, 56, 220, 364, 816, 1140, 2024, 4060, 4960, 8436, 11480, 13244, 17296, 24804, 34220, 37820, 50116, 59640, 64824, 82160, 95284, 117480, 152096, 171700, 182104, 204156, 215820, 240464, 341376, 374660, 428536, 447580, 551300, 573800, 644956
Offset: 1

Views

Author

Artur Jasinski, Feb 06 2007

Keywords

Crossrefs

Programs

  • Magma
    [(NthPrime(n) + 1)*NthPrime(n)*(NthPrime(n) - 1)/6: n in [1..40]]; // Vincenzo Librandi, Apr 09 2017
  • Mathematica
    Table[(Prime[n] + 1) Prime[n](Prime[n] - 1)/6, {n, 1, 100}]
    ((#-1)#(#+1))/6&/@Prime[Range[40]] (* Harvey P. Dale, Dec 23 2019 *)
  • PARI
    forprime(p=2,1e3,print1(binomial(p+1,3)", ")) \\ Charles R Greathouse IV, Jun 16 2011
    
  • Python
    from sympy import prime
    print([(prime(n) - 1)*prime(n)*(prime(n) + 1)//6 for n in range(1, 101)]) # Indranil Ghosh, Apr 09 2017
    

Formula

a(n) = A127918(n)/3. - Michel Marcus, Apr 09 2017

A116995 Pentagonal numbers with prime indices.

Original entry on oeis.org

5, 12, 35, 70, 176, 247, 425, 532, 782, 1247, 1426, 2035, 2501, 2752, 3290, 4187, 5192, 5551, 6700, 7526, 7957, 9322, 10292, 11837, 14065, 15251, 15862, 17120, 17767, 19097, 24130, 25676, 28085, 28912, 33227, 34126, 36895, 39772, 41750, 44807
Offset: 1

Views

Author

Jonathan Vos Post, Apr 02 2006

Keywords

Comments

See also: A001248 Squares of primes. A034953 Triangular numbers (A000217) with prime indices.

Examples

			a(1) = Pentagonal(prime(1)) = A000326(2) = 2*(3*2-1)/2 = 5.
a(2) = Pentagonal(prime(2)) = A000326(3) = 3*(3*3-1)/2 = 12.
a(3) = Pentagonal(prime(3)) = A000326(5) = 5*(3*5-1)/2 = 35.
		

Crossrefs

Programs

  • Mathematica
    Table[Prime[n]*(3*Prime[n] - 1)/2, {n, 1, 60}] (* Stefan Steinerberger, Apr 04 2006 *)

Formula

a(n) = Prime(n)*(3*Prime(n)-1)/2. a(n) = A000326(A000040(n)).

A127922 1/24 of product of three numbers: n-th prime, previous and following number.

Original entry on oeis.org

1, 5, 14, 55, 91, 204, 285, 506, 1015, 1240, 2109, 2870, 3311, 4324, 6201, 8555, 9455, 12529, 14910, 16206, 20540, 23821, 29370, 38024, 42925, 45526, 51039, 53955, 60116, 85344, 93665, 107134, 111895, 137825, 143450, 161239, 180441, 194054
Offset: 2

Views

Author

Artur Jasinski, Feb 06 2007

Keywords

Comments

The product of (n-1), n, and (n+1) = n^3 - n. - Harvey P. Dale, Jan 17 2011
For n > 2, a(n) = A001318(n-2) * A007310(n-1), if A007310(n-1) is prime. Also a(n) is a subsequence of A000330. - Richard R. Forberg, Dec 25 2013
If p is an odd prime it can always be the side length of a leg of a primitive Pythagorean triangle. However it constrains the other leg to have a side length of (p^2-1)/2 and the hypotenuse to have a side length of (p^2+1)/2. The resulting triangle has an area equal to (p-1)*p*(p+1)/4. a(n) is 1/6 the area of such triangles. - Frank M Jackson, Dec 06 2017

Crossrefs

Programs

  • Mathematica
    Table[(Prime[n] + 1) Prime[n](Prime[n] - 1)/24, {n, 1, 100}] (#^3-#)/ 24&/@ Prime[Range[2,40]] (* Harvey P. Dale, Jan 17 2011 *)
    ((#-1)#(#+1))/24&/@Prime[Range[2,40]] (* Harvey P. Dale, Jan 20 2023 *)
  • PARI
    for(n=2,25, print1((prime(n)+1)*prime(n)*(prime(n)-1)/24, ", ")) \\ G. C. Greubel, Jun 19 2017

Formula

a(n) = A011842(A000040(n) + 1) = A000330((A000040(n) - 1) / 2).

A147846 Triangular numbers n*(n+1)/2 with n or n+1 prime.

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 55, 66, 78, 91, 136, 153, 171, 190, 253, 276, 406, 435, 465, 496, 666, 703, 820, 861, 903, 946, 1081, 1128, 1378, 1431, 1711, 1770, 1830, 1891, 2211, 2278, 2485, 2556, 2628, 2701, 3081, 3160, 3403, 3486, 3916, 4005, 4656, 4753, 5050
Offset: 1

Views

Author

Giovanni Teofilatto, Nov 15 2008

Keywords

Crossrefs

Programs

  • PARI
    lista(nn) = {for (n=1, nn, if (isprime(n) || isprime(n+1), print1(n*(n+1)/2, ", ")););} \\ Michel Marcus, Jun 03 2013
    
  • PARI
    print1(1);forprime(p=3,7,print1(", "p*(p-1)/2", "p*(p+1)/2)) \\ Charles R Greathouse IV, Jun 03 2013

Formula

a(n) ~ (n^2 log^2 n)/8. - Charles R Greathouse IV, Jun 03 2013
A034953 UNION A008837. - R. J. Mathar, Jun 13 2025

Extensions

Missing terms 28=7*8/2, 91=13*14/2 etc. inserted by R. J. Mathar, Jan 30 2010

A117961 Hexagonal numbers with prime indices.

Original entry on oeis.org

6, 15, 45, 91, 231, 325, 561, 703, 1035, 1653, 1891, 2701, 3321, 3655, 4371, 5565, 6903, 7381, 8911, 10011, 10585, 12403, 13695, 15753, 18721, 20301, 21115, 22791, 23653, 25425, 32131, 34191, 37401, 38503, 44253, 45451, 49141, 52975, 55611
Offset: 1

Views

Author

Jonathan Vos Post, Apr 05 2006

Keywords

Comments

See also: A034953 Triangular numbers (A000217) with prime indices. A001248 Squares of primes. A116995 Pentagonal numbers with prime indices. A000384 Hexagonal numbers: n(2n-1). There are no prime hexagonal numbers. The n-th Hexagonal number A000384(n) = n*(2*n-1) is semiprime iff both n and 2*n-1 are prime iff A000384(n) is an element of A001358 iff n is an element of A005382.

Crossrefs

Programs

  • Mathematica
    With[{hex=Table[n(2n-1),{n,250}]},Flatten[Table[Take[hex,{Prime[n]}],{n, 40}]]] (* Harvey P. Dale, Dec 04 2011 *)

Formula

a(n) = A000040(n)*(2*A000040(n)-1). a(n) = A000384(prime(n)). a(n) = number of divisors of 12^(prime(n)-1) = A000005(A001021(A000040(n)-1)).

A034954 Odd triangular numbers with prime indices.

Original entry on oeis.org

3, 15, 91, 153, 435, 703, 861, 1431, 1891, 2701, 4005, 4753, 5151, 5995, 6441, 9453, 11175, 12403, 15051, 16471, 18721, 19503, 26335, 27261, 29161, 33153, 36315, 38503, 39621, 43071, 49141, 50403, 56953, 61075, 62481, 69751, 75855, 79003
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

For prime indices p such that p(p+1)/2 is 'odd' see A002313 (primes of form 4n+1).

Crossrefs

Programs

  • Mathematica
    Select[Table[Prime[n] (Prime[n] + 1)/2, {n, 500}], OddQ[#] &] (* G. C. Greubel, Nov 03 2017 *)
    With[{nn=400},Select[Thread[{Accumulate[Range[nn]],Range[nn]}],OddQ[ #[[1]]] && PrimeQ[#[[2]]]&]][[All,1]] (* Harvey P. Dale, Mar 06 2019 *)

Formula

a(n) = A000217(A002313(n)). - Michel Marcus, Nov 04 2017

A034955 Even triangular numbers with prime indices.

Original entry on oeis.org

6, 28, 66, 190, 276, 496, 946, 1128, 1770, 2278, 2556, 3160, 3486, 5356, 5778, 8128, 8646, 9730, 11476, 13366, 14028, 16110, 18336, 19900, 22366, 24976, 25878, 28680, 31626, 34716, 36856, 40186, 47278, 48516, 54946, 60378, 64620, 67528, 72010, 73536, 87990
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

For prime indices p such that p(p+1)/2 is even, see A002145 (Primes of form 4n+3).

Crossrefs

Programs

  • Mathematica
    Select[Table[Prime[n] (Prime[n] + 1)/2, {n, 500}], EvenQ[#] &] (* G. C. Greubel, Nov 03 2017 *)
  • Python
    from sympy import primerange
    def aupto(lim):
        pitri = (p*(p+1)//2 for p in primerange(2, int((2*lim)**.5)+1))
        return [t for t in pitri if t%2 == 0]
    print(aupto(90000)) # Michael S. Branicky, Jun 28 2021

Formula

a(n) = A000217(A002145(n)). - Michel Marcus, Nov 04 2017

A050482 Sum of remainders when n-th prime is divided by all preceding integers.

Original entry on oeis.org

0, 1, 4, 8, 22, 28, 51, 64, 98, 151, 167, 233, 297, 325, 403, 505, 635, 645, 790, 904, 923, 1113, 1244, 1422, 1654, 1800, 1888, 2056, 2098, 2256, 2849, 3066, 3326, 3450, 3969, 4045, 4329, 4696, 5014, 5325, 5767, 5759, 6499, 6565, 6898
Offset: 1

Views

Author

Brian Wallace (wallacebrianedward(AT)yahoo.co.uk), Dec 26 1999

Keywords

Comments

a(n)/(n*log(n))^2 appears to approach a constant ~0.22... for large n. - Benedict W. J. Irwin, Dec 07 2016
Irwin's comment is incorrect. - Bill McEachen, Feb 04 2024. [Indeed, according to the first formula in A004125, a(n)/(n*log(n))^2 approaches a constant, which is not 0.22 but 1-Pi^2/12 = 0.1775... - Amiram Eldar, Feb 04 2024]

Examples

			a(4) = 8 because remainders when 7 is divided by 1..6 are 0,1,1,3,2,1, which add to 8.
a(2) = 3 mod (3-1) = 1.
a(3) = (5 mod (5-1)) + (5 mod (5-2)) + (5 mod (5-3)) = 2 + 1 + 1 = 4.
		

Crossrefs

Programs

  • Maple
    A050482 := proc(n) local a,i; a := 0; for i from 1 to ithprime(n)-1 do a := a+(ithprime(n) mod i); od: end;
  • Mathematica
    Table[Sum[Mod[Prime[n],k],{k,Prime[n]-1}],{n,45}] (* James C. McMahon, Feb 08 2024 *)
  • PARI
    a(n)=my(p=prime(n));sum(k=2, p, p%k) \\ Charles R Greathouse IV, Jun 03 2013
    
  • Python
    from math import isqrt
    from sympy import prime
    def A050482(n): return (p:=prime(n))**2+((s:=isqrt(p))**2*(s+1)-sum((q:=p//k)*((k<<1)+q+1) for k in range(1,s+1))>>1) # Chai Wah Wu, Nov 01 2023

Formula

a(n) = A004125(A000040(n)). - R. J. Mathar, Jun 12 2009

A064366 a(n) = binomial(sigma(n), phi(n)).

Original entry on oeis.org

1, 3, 6, 21, 15, 66, 28, 1365, 1716, 3060, 66, 20475, 91, 134596, 735471, 7888725, 153, 3262623, 190, 118030185, 225792840, 254186856, 276, 2558620845, 84672315, 11058116888, 113380261800, 558383307300, 435, 11969016345, 496, 366395202809685, 16735679449896, 21094923659355
Offset: 1

Views

Author

Labos Elemer, Sep 27 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Array[Binomial[DivisorSigma[1, #], EulerPhi@ #] &, 31] (* Michael De Vlieger, Nov 03 2017 *)
  • PARI
    a(n) = { binomial(sigma(n), eulerphi(n)) } \\ Harry J. Smith, Sep 12 2009

Formula

a(n) = binomial(A000203(n), A000010(n));
a(p) = A000217(p) for prime p.
Previous Showing 11-20 of 52 results. Next