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-10 of 31 results. Next

A036689 Product of a prime and the previous number.

Original entry on oeis.org

2, 6, 20, 42, 110, 156, 272, 342, 506, 812, 930, 1332, 1640, 1806, 2162, 2756, 3422, 3660, 4422, 4970, 5256, 6162, 6806, 7832, 9312, 10100, 10506, 11342, 11772, 12656, 16002, 17030, 18632, 19182, 22052, 22650, 24492, 26406, 27722, 29756, 31862, 32580, 36290, 37056, 38612, 39402, 44310
Offset: 1

Views

Author

Keywords

Comments

Records in A002618. - Artur Jasinski, Jan 23 2008
Also records in A174857. - Vladimir Shevelev, Mar 31 2010

Examples

			2*1, 3*2, 5*4, 7*6, 11*10, 13*12, 17*16, ...
		

Crossrefs

Twice the terms of A008837.
Subsequence of A002378 (oblong numbers).
Column 1 of A257251. (Row 1 of A257252.)
Column 2 of A379010.

Programs

Formula

a(n) = prime(n) * (prime(n) - 1).
a(n) = phi(prime(n)^2) = A000010(A001248(n)).
a(n) = prime(n) * phi(prime(n)). - Artur Jasinski, Jan 23 2008
From Reinhard Zumkeller, Sep 17 2011: (Start)
a(n) = A000040(n) * A006093(n) = A001248(n) - A000040(n).
A006530(a(n)) = A000040(n). (End)
a(n) = A009262(prime(n)). - Enrique Pérez Herrero, May 12 2012
a(n) = prime(n)! mod (prime(n)^2). - J. M. Bergot, Apr 10 2014
a(n) = 2*A008837(n). - Antti Karttunen, May 01 2015
Sum_{n>=1} 1/a(n) = A136141. - Amiram Eldar, Nov 09 2020
From Amiram Eldar, Jan 23 2021: (Start)
Product_{n>=1} (1 + 1/a(n)) = zeta(2)*zeta(3)/zeta(6) (A082695).
Product_{n>=1} (1 - 1/a(n)) = A005596. (End)

Extensions

Deleted two incorrect comments. - N. J. A. Sloane, May 07 2020

A371201 a(n) = Sum_{k=prime(n)..prime(n+1)-1} k, with a(0) = 1.

Original entry on oeis.org

1, 2, 7, 11, 34, 23, 58, 35, 82, 153, 59, 201, 154, 83, 178, 297, 333, 119, 381, 274, 143, 453, 322, 513, 740, 394, 203, 418, 215, 442, 1673, 514, 801, 275, 1435, 299, 921, 957, 658, 1017, 1053, 359, 1855, 383, 778, 395, 2454, 2598, 898, 455, 922, 1413, 479, 2455, 1521, 1557, 1593
Offset: 0

Views

Author

Raul Prisacariu, Mar 15 2024

Keywords

Comments

The sequence can be obtained graphically using the following grid walk rules. From an origin the first movement iteration consists of moving 1 unit in any direction. The n-th movement iteration consists of moving in the same direction n units. If n is a prime number, the movement iteration consists of first changing the movement direction by 90 degrees and then moving n units in the new direction. If n is a nonprime number, the movement iteration consists of moving n units in the same direction as the previous movement iteration. The sequence is obtained by measuring the length of each 90-degree turn.
a(0) is the length of the grid segment before doing any 90-degree turns and a(1) is the length of the first 90-degree turn.

Examples

			a(0) = 1.
a(1) = 2.
a(2) = 3 + 4 = 7.
a(3) = 5 + 6 = 11.
a(4) = 7 + 8 + 9 + 10 = 34.
a(5) = 11 + 12 = 23.
a(6) = 13 + 14 + 15 + 16 = 58.
a(7) = 17 + 18 = 35.
The natural numbers are summed in groups where each prime begins a new group,
  primes     v   v       v       v
         1   2   3   4   5   6   7   8   9  10  ...
        \-/ \-/ \-----/ \-----/ \-------------/
  a(n) = 1   2     7       11          34
    n  = 0   1     2       3           4
		

Crossrefs

Cf. A008837 (partial sums).

Programs

  • Maple
    ithprime(0):=1:
    a:= n-> ((j, k)-> (k-1+j)*(k-j)/2)(map(ithprime, [n, n+1])[]):
    seq(a(n), n=0..56);  # Alois P. Heinz, Mar 16 2024
  • Mathematica
    Join[{1},Table[Prime[n]+(Prime[n+1]+Prime[n])*(Prime[n+1]-Prime[n]-1)/2,{n,56}]] (* James C. McMahon, Apr 20 2024 *)
  • PARI
    first(n) = {
    	my(res = primes(n), t = 0);
    	for(i = 1, n,
    		res[i] = binomial(res[i],2) - t;
    		t+=res[i];
    	);
    	res	
    } \\ David A. Corneth, Mar 16 2024
    
  • Python
    from sympy import nextprime, prime
    def A371201(n):
        if n == 0: return 1
        q = nextprime(p:=prime(n))
        return (q-p)*(p+q-1)>>1 # Chai Wah Wu, Jun 01 2024

Formula

For n > 0, a(n) = A138383(n) - (prime(n+1) - prime(n)).
a(n) = binomial(prime(n+1), 2) - Sum_{k=0..n-1} a(k). - David A. Corneth, Mar 15 2024
a(n) = prime(n) + A054265(n), for n >= 1. - Michel Marcus, Mar 15 2024
a(n) = (prime(n+1)-prime(n))*(prime(n+1)+prime(n)-1)/2 for n>=1. - Chai Wah Wu, Jun 01 2024

Extensions

More terms from Michel Marcus, Mar 15 2024

A126995 a(n) = binomial(prime(n+2), 3).

Original entry on oeis.org

1, 10, 35, 165, 286, 680, 969, 1771, 3654, 4495, 7770, 10660, 12341, 16215, 23426, 32509, 35990, 47905, 57155, 62196, 79079, 91881, 113564, 147440, 166650, 176851, 198485, 209934, 234136, 333375, 366145, 419220, 437989, 540274, 562475, 632710, 708561, 762355
Offset: 0

Views

Author

Artur Jasinski, Jan 01 2007

Keywords

Crossrefs

Programs

  • Magma
    [Binomial(NthPrime(n), 3): n in [3..40]]; // Vincenzo Librandi, May 10 2017
    
  • Mathematica
    Table[Binomial[Prime[n + 2], Prime[2]], {n, 1, 40}]
    Table[Binomial[Prime[n], 3], {n, 3, 40}] (* Vincenzo Librandi, May 10 2017 *)
  • PARI
    a(n)=binomial(prime(n+2),3) \\ Charles R Greathouse IV, May 10 2017
    
  • Sage
    [binomial(nth_prime(n+2), 3) for n in (1..40)] # G. C. Greubel, May 29 2019

Formula

a(n) ~ (n log n)^3 / 6. - Charles R Greathouse IV, May 10 2017

Extensions

Missing n=0 term added by N. J. A. Sloane, May 17 2020

A171555 Numbers of the form prime(n)*(prime(n)-1)/4.

Original entry on oeis.org

5, 39, 68, 203, 333, 410, 689, 915, 1314, 1958, 2328, 2525, 2943, 3164, 4658, 5513, 6123, 7439, 8145, 9264, 9653, 13053, 13514, 14460, 16448, 18023, 19113, 19670, 21389, 24414, 25043, 28308, 30363, 31064, 34689, 37733, 39303, 40100, 41718, 44205, 46764, 50288
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 11 2009

Keywords

Comments

The halves of even numbers of the form p(p-1)/2 for p prime.
Sum of the quadratic residues of primes of the form 4k + 1. For example, a(3)=68 because 17 is the 3rd prime of the form 4k + 1 and the quadratic residues of 17 are 1, 4, 9, 16, 8, 2, 15, 13 which sum to 68. This sum is also the sum of the quadratic nonresidues. Cf. A230077. - Geoffrey Critzer, May 07 2015

References

  • R. Crandall and C. Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see Exercise 2.21 p. 110.

Crossrefs

Sums of residues, nonresidues, and their differences, for p == 1 (mod 4), p == 3 (mod 4), and all p: A171555; A282035, A282036, A282037; A076409, A125615, A282038.

Programs

  • Mathematica
    Table[Table[Mod[a^2, p], {a, 1, (p - 1)/2}] // Total, {p,
    Select[Prime[Range[100]], Mod[#, 4] == 1 &]}] (* Geoffrey Critzer, May 07 2015 *)
    Select[(# (#-1))/4&/@Prime[Range[100]],IntegerQ] (* Harvey P. Dale, Dec 24 2022 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if ((p % 4)==1, print1(p*(p-1)/4, ", "))); \\ Michel Marcus, Mar 23 2016

Extensions

Corrected (16448 inserted, 25043 inserted) by R. J. Mathar, May 22 2010

A126996 a(n) = binomial(prime(3+n), prime(3)).

Original entry on oeis.org

1, 21, 462, 1287, 6188, 11628, 33649, 118755, 169911, 435897, 749398, 962598, 1533939, 2869685, 5006386, 5949147, 9657648, 13019909, 15020334, 22537515, 29034396, 41507642, 64446024, 79208745, 87541245, 106308566, 116828271, 140364532, 254231775
Offset: 0

Views

Author

Artur Jasinski, Jan 01 2007

Keywords

Crossrefs

Programs

  • Magma
    [Binomial(NthPrime(n+3), 5): n in [0..30]]; // Vincenzo Librandi, May 21 2019
    
  • Mathematica
    Table[Binomial[Prime[n + 3], Prime[3]], {n, 0, 30}]
    Binomial[Prime[Range[3,40]],5] (* Harvey P. Dale, Mar 20 2021 *)
  • PARI
    vector(30, n, binomial(prime(n+3), 5)) \\ G. C. Greubel, May 29 2019
    
  • Sage
    [binomial(nth_prime(n+3), 5) for n in (1..30)] # G. C. Greubel, May 29 2019

Extensions

Missing n=0 term added by N. J. A. Sloane, May 17 2020

A126997 a(n) = binomial(prime(4+n), prime(4)).

Original entry on oeis.org

1, 330, 1716, 19448, 50388, 245157, 1560780, 2629575, 10295472, 22481940, 32224114, 62891499, 154143080, 341149446, 436270780, 869648208, 1329890705, 1629348612, 2898753715, 4151918628, 6890268572, 12846240784, 17199613200, 19813501785, 26075972546, 29796772356, 38620298376
Offset: 0

Views

Author

Artur Jasinski, Jan 01 2007

Keywords

Crossrefs

Programs

  • Magma
    [Binomial(NthPrime(n+4), 7): n in [1..30]]; // Vincenzo Librandi, May 21 2019
    
  • Mathematica
    Table[Binomial[Prime[n + 4], Prime[4]], {n, 1, 30}]
  • PARI
    vector(30, n, binomial(prime(n+4), prime(4)) ) \\ G. C. Greubel, May 29 2019
    
  • Sage
    [binomial(nth_prime(n+4), 7) for n in (1..30)] # G. C. Greubel, May 29 2019

Extensions

Terms a(24) onward added by G. C. Greubel, May 30 2019
Missing n=0 term added by N. J. A. Sloane, May 17 2020

A126998 a(n) = binomial(prime(n+5), prime(5)).

Original entry on oeis.org

1, 78, 12376, 75582, 1352078, 34597290, 84672315, 854992152, 3159461968, 5752004349, 17417133617, 76223753060, 279871768995, 418094152866, 1285063345176, 2560547383576, 3558497368608, 9036996468045, 16141841823510, 36519676207704, 99468442390512, 158940114100040
Offset: 0

Views

Author

Artur Jasinski, Jan 01 2007

Keywords

Crossrefs

Programs

  • Magma
    [Binomial(NthPrime(n+5), NthPrime(5)): n in [1..30]]; // G. C. Greubel, May 29 2019
    
  • Mathematica
    Table[Binomial[Prime[n+5], Prime[5]], {n, 1, 30}]
  • PARI
    vector(30, n, binomial(prime(n+5), prime(5)) ) \\ G. C. Greubel, May 29 2019
    
  • Sage
    [binomial(nth_prime(n+5), nth_prime(5)) for n in (1..30)] # G. C. Greubel, May 29 2019

Extensions

Terms a(19) onward added by G. C. Greubel, May 30 2019
Missing n=0 term added by N. J. A. Sloane, May 17 2020

A138426 a(n) = ((prime(n))^5-prime(n))/5.

Original entry on oeis.org

6, 48, 624, 3360, 32208, 74256, 283968, 495216, 1287264, 4102224, 5725824, 13868784, 23171232, 29401680, 45868992, 83639088, 142984848, 168919248, 270025008, 360845856, 414614304, 615411264, 787808112, 1116811872
Offset: 1

Views

Author

Artur Jasinski, Mar 19 2008

Keywords

Comments

Number of monic irreducible polynomials of degree 5 over GF(prime(n)). - Robert Israel, Jan 07 2015

Crossrefs

Programs

  • Magma
    [(NthPrime((n))^5 - NthPrime((n)))/5: n in [1..30] ]; // Vincenzo Librandi, Jun 18 2011
    
  • Maple
    seq((ithprime(i)^5-ithprime(i))/5, i = 1 .. 50); # Robert Israel, Jan 07 2015
  • Mathematica
    a = {}; Do[p = Prime[n]; AppendTo[a, (p^5 - p)/5], {n, 1, 50}]; a
    (#^5-#)/5&/@Prime[Range[30]] (* Harvey P. Dale, Mar 12 2018 *)
  • PARI
    forprime(p=2,1e3,print1((p^5-p)/5", ")) \\ Charles R Greathouse IV, Jul 15 2011

Formula

a(n) = A138404(n)/5. - R. J. Mathar, Oct 15 2017

A217983 If n = floor(p/2) * p^e, for some (by necessity unique) prime p and exponent e > 0, then a(n) = p, otherwise a(n) = 1.

Original entry on oeis.org

1, 2, 3, 2, 1, 1, 1, 2, 3, 5, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Johannes W. Meijer, Oct 25 2012

Keywords

Comments

a(A130290(n) * A000040(n)^n1) = A000040(n), n >= 1 and n1 >= 1, and a(n) = 1 elsewhere. - The original name of the sequence.
The a(n) are related to the prime numbers A000040 and the number of nonzero quadratic residues modulo the n-th prime A130290, see the first formula and the Maple program.
This sequence resembles the exponential of the von Mangoldt function A014963; for the latter sequence a(A000040(n)^n1) = A000040(n), n >= 1 and n1 >= 1, and a(n) = 1 elsewhere.
Positions of the first occurrence of each successive noncomposite number (and also the records) is given by the union of {2} and A008837. - Antti Karttunen, Jan 17 2025

Crossrefs

Cf. A000079, A000244 (after their initial 1's, the positions of 2's and 3's respectively), A020699 (positions of 5's from its third term 10 onward), A169634 (positions of 7's from the second term onward), A379956 (positions of terms > 1).

Programs

  • Maple
    nmax := 78: A000040 := proc(n): ithprime(n) end: A130290 := proc(n): if n =1 then 1 else (A000040(n)-1)/2 fi: end: for n from 1 to nmax do A217983(n) := 1 od: for n from 1 to nmax do for n1 from 1 to floor(log[A000040(n)](nmax)) do A217983(A130290(n) * A000040(n)^n1) := A000040(n) od: od: seq(A217983(n), n=1..nmax);
  • PARI
    A217983(n) = { my(f=factor(n)); for(i=1,#f~,if((n/(f[i,1]^f[i,2])) == (f[i,1]\2), return(f[i,1]))); (1); }; \\ Antti Karttunen, Jan 16 2025

Formula

a(A130290(n) * A000040(n)^n1) = A000040(n), n >= 1 and n1 >= 1, and a(n)= 1 elsewhere.
a(n) = (A160479(n+1) * A128060(n+1))/(2*n+1) for n >= 2.

Extensions

Definition simplified, original definition moved to comments; more terms added by Antti Karttunen, Jan 16 2025

A006308 Coefficients of period polynomials.

Original entry on oeis.org

3, 10, 21, 55, 78, 136, 171, 253, 406, 465, 666, 820, 903, 1081, 1378, 1711, 1830, 2211, 2485, 2628, 3081, 3403, 3916, 4656, 5050
Offset: 2

Views

Author

Keywords

Comments

Conjecture: a(n) = A008837(n) = p*(p-1)/2 = Sum_{k=0..p-1} mod(k^3, p) where p = prime(n). - Michael Somos, Feb 17 2020

References

  • D. H. and Emma Lehmer, Cyclotomy for nonsquarefree moduli, pp. 276-300 of Analytic Number Theory (Philadelphia 1980), Lect. Notes Math. 899 (1981).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 243.

Crossrefs

Cf. A008837. [From R. J. Mathar, Oct 28 2008]

Formula

For an odd prime p, let g be a primitive root of p^2, q=g^p, and zeta=exp(2*pi*i/p^2). Define h(p,k) = Sum_{j=0..p-2} zeta^((q+k*p)*q^j) and a polynomial f(p,x) = Product_{k=0..p-1} (x-h(p,k)). Finally, a(n) = -[x^(p-2)] f(p,x) where p = A000040(n) is the n-th prime. - Sean A. Irvine, Mar 07 2017

Extensions

More terms and offset corrected by Sean A. Irvine, Mar 07 2017
Showing 1-10 of 31 results. Next