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

A138420 a(n) = ((prime(n))^4-(prime(n))^2)/4.

Original entry on oeis.org

3, 18, 150, 588, 3630, 7098, 20808, 32490, 69828, 176610, 230640, 468198, 706020, 854238, 1219368, 1971918, 3028470, 3460530, 5036658, 6351660, 7098228, 9735960, 11862858, 15683580, 22129968, 26012550, 28135068, 32767038, 35286570
Offset: 1

Views

Author

Artur Jasinski, Mar 19 2008

Keywords

Comments

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

Crossrefs

Programs

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

Formula

a(n) = A138402(n)/4. - R. J. Mathar, Oct 15 2017

Extensions

Name edited by Robert Israel, Jan 07 2015

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

A372933 Records in A071961, divided by 2.

Original entry on oeis.org

0, 1, 2, 3, 4, 10, 21, 27, 55, 78, 136, 171, 253, 406, 465, 666, 820, 903, 1081, 1378, 1711, 1830, 2211, 2485, 2628, 3081, 3403, 3916, 4656, 5050, 5253, 5671, 5886, 6328, 6655, 8001, 8515, 9316, 9591, 11026, 11325, 12246, 13203, 13861, 14878, 15931, 16290, 18145, 18528
Offset: 1

Views

Author

Hugo Pfoertner, May 17 2024

Keywords

Crossrefs

A372934 are the corresponding positions in A071961.
Cf. A372728.

Programs

  • PARI
    a372933(upto) = {my (m=-oo); for (n=0, 2*upto, my (s = sum(k=0, n, kronecker(n,k))); if (s>m, print1(s/2,", "); m=s))};
    a372933(10000)

A072205 a(n) = (p^2 - p + 2)/2 for p = prime(n); number of squares modulo p^2.

Original entry on oeis.org

2, 4, 11, 22, 56, 79, 137, 172, 254, 407, 466, 667, 821, 904, 1082, 1379, 1712, 1831, 2212, 2486, 2629, 3082, 3404, 3917, 4657, 5051, 5254, 5672, 5887, 6329, 8002, 8516, 9317, 9592, 11027, 11326, 12247, 13204, 13862, 14879, 15932, 16291, 18146, 18529
Offset: 1

Views

Author

Robert G. Wilson v, Jul 03 2002

Keywords

Comments

Second terms of triple Peano sequence A071988. [Robert G. Wilson v, Jul 03 2002]
Positions of primes in A075383: A000040(n) = A075383(a(n)). [Reinhard Zumkeller, Jun 22 2009]
Number of different squares modulo p^2, for p ranging over the primes. Proof: the p multiples of p (0, p, 2p...) have the same square: 0 mod p^2. The other elements have the same square iff they are opposite: x^2 == y^2 (mod p^2) iff (x - y)(x + y) == 0 (mod p^2) iff x == y (mod p) or x == -y (mod p) or 2y == 0 (mod p). So the (p^2 - p) non-p-multiples account for (p^2 - p)/2 different squares and the p-multiples for 1 extra square, giving a total of (p^2 - p + 2)/2. [Bert Seghers, Dec 21 2011]
From Jianing Song, Apr 13 2019: (Start)
For k coprime to prime(n), k^a(n) == +-k (mod prime(n)^2).
For every integer k, k^(2a(n)) == k^2 (mod prime(n)^2). (End)

Crossrefs

Programs

  • Mathematica
    seq[n_Integer?Positive] := Module[{fn01 = 1, fn10 = 1, fnout = 1}, Do[{fn10, fn01, fnout} = {fn10 + 1, fn01 + fn10, fn01 + fnout}, {n - 1}]; {fn10, fn01, fnout}]; Ar = Flatten[ Table[ seq[ Prime[n]], {n, 1, 50}]]; a = {}; Do[a = Append[a, Ar[[n]]], {n, 2, 150, 3}]; a
  • PARI
    a(n)=binomial(prime(n),2)+1 \\ Charles R Greathouse IV, Jan 11 2012
  • Sage
    [(p^2 - p + 2)/2 for p in prime_range(200)]
    

Formula

a(n) = A008837(n) + 1.
a(n) = A000124(A000040(n)) by definition [Bert Seghers, Jan 01 2012]

Extensions

Name edited by Bert Seghers, Jan 01 2012

A072230 a(n) = n! (mod n^2), that is, n factorial modulo n^2.

Original entry on oeis.org

0, 2, 6, 8, 20, 0, 42, 0, 0, 0, 110, 0, 156, 0, 0, 0, 272, 0, 342, 0, 0, 0, 506, 0, 0, 0, 0, 0, 812, 0, 930, 0, 0, 0, 0, 0, 1332, 0, 0, 0, 1640, 0, 1806, 0, 0, 0, 2162, 0, 0, 0, 0, 0, 2756, 0, 0, 0, 0, 0, 3422, 0, 3660, 0, 0, 0, 0, 0, 4422, 0, 0, 0, 4970, 0, 5256, 0, 0, 0, 0, 0, 6162
Offset: 1

Views

Author

Roman Stawski, Jul 05 2002

Keywords

Comments

With the exception of n=4, if n is composite, a(n) = 0. If n is prime, a(n) = n*(n-1). For example, a(11) = 11*10 = 110, a(41) = 41*40 = 1640. - Gary Detlefs, May 01 2010

Crossrefs

Programs

  • Mathematica
    Table[Mod[n!, n^2], {n, 79}] (* or *)
    Table[Which[n == 4, Mod[n!, n^2], PrimeQ@ n, n (n - 1), True, 0], {n, 79}] (* Michael De Vlieger, Oct 14 2016 *)
  • PARI
    a(n)=if(isprime(n), n*(n-1), if(n==4, 8, 0)) \\ Charles R Greathouse IV, Dec 14 2015

Formula

a(n) = A174530(n)*(A174530(n)-1) for n>=5. - Filip Zaludek, Oct 13 2016

A138416 a(n) = (p^3 - p^2)/2, where p = prime(n).

Original entry on oeis.org

2, 9, 50, 147, 605, 1014, 2312, 3249, 5819, 11774, 14415, 24642, 33620, 38829, 50807, 73034, 100949, 111630, 148137, 176435, 191844, 243399, 282449, 348524, 451632, 510050, 541059, 606797, 641574, 715064, 1016127, 1115465, 1276292, 1333149
Offset: 1

Views

Author

Artur Jasinski, Mar 19 2008

Keywords

Comments

Differences (p^k - p^m)/q with k > m:
expression OEIS sequence
-------------- -------------
p^2 - p A036689
(p^2 - p)/2 A008837
p^3 - p A127917
(p^3 - p)/2 A127918
(p^3 - p)/3 A127919
(p^3 - p)/6 A127920
p^3 - p^2 A135177
(p^3 - p^2)/2 this sequence
p^4 - p A138401
(p^4 - p)/2 A138417
p^4 - p^2 A138402
(p^4 - p^2)/2 A138418
(p^4 - p^2)/3 A138419
(p^4 - p^2)/4 A138420
(p^4 - p^2)/6 A138421
(p^4 - p^2)/12 A138422
p^4 - p^3 A138403
(p^4 - p^3)/2 A138423
p^5 - p A138404
(p^5 - p)/2 A138424
(p^5 - p)/3 A138425
(p^5 - p)/5 A138426
(p^5 - p)/6 A138427
(p^5 - p)/10 A138428
(p^5 - p)/15 A138429
(p^5 - p)/30 A138430
p^5 - p^2 A138405
(p^5 - p^2)/2 A138431
p^5 - p^3 A138406
(p^5 - p^3)/2 A138432
(p^5 - p^3)/3 A138433
(p^5 - p^3)/4 A138434
(p^5 - p^3)/6 A138435
(p^5 - p^3)/8 A138436
(p^5 - p^3)/12 A138437
(p^5 - p^3)/24 A138438
p^5 - p^4 A138407
(p^5 - p^4)/2 A138439
p^6 - p A138408
(p^6 - p)/2 A138440
p^6 - p^2 A138409
(p^6 - p^2)/2 A138441
(p^6 - p^2)/3 A138442
(p^6 - p^2)/4 A138443
(p^6 - p^2)/5 A138444
(p^6 - p^2)/6 A138445
(p^6 - p^2)/10 A138446
(p^6 - p^2)/12 A138447
(p^6 - p^2)/15 A138448
(p^6 - p^2)/20 A122220
(p^6 - p^2)/30 A138450
(p^6 - p^2)/60 A138451
p^6 - p^3 A138410
(p^6 - p^3)/2 A138452
p^6 - p^4 A138411
(p^6 - p^4)/2 A138453
(p^6 - p^4)/3 A138454
(p^6 - p^4)/4 A138455
(p^6 - p^4)/6 A138456
(p^6 - p^4)/8 A138457
(p^6 - p^4)/12 A138458
(p^6 - p^4)/24 A138459
p^6 - p^5 A138412
(p^6 - p^5)/2 A138460
.
We can prove that for n>1, a(n) is the remainder of the Euclidean division of Sum_{k=0..p-1} k^p by p^3 where p = prime(n). - Pierre Vandaƫle, Nov 30 2024

Programs

  • Magma
    [(p^3-p^2)/2: p in PrimesUpTo(1000)]; // Vincenzo Librandi, Jun 17 2011
  • Mathematica
    a = {}; Do[p = Prime[n]; AppendTo[a, (p^3 - p^2)/2], {n, 1, 50}]; a
    (#^3-#^2)/2&/@Prime[Range[50]] (* Harvey P. Dale, Nov 01 2020 *)
  • PARI
    forprime(p=2,1e3,print1((p^3-p^2)/2", ")) \\ Charles R Greathouse IV, Jun 16 2011
    

Extensions

Definition corrected by T. D. Noe, Aug 25 2008

A257253 Square array A(row,col) = (1/2) * (A083221(row,col+1) - A083221(row,col)): half of the first differences of each row of array constructed from the sieve of Eratosthenes.

Original entry on oeis.org

1, 1, 3, 1, 3, 10, 1, 3, 5, 21, 1, 3, 10, 14, 55, 1, 3, 5, 7, 11, 78, 1, 3, 10, 14, 22, 26, 136, 1, 3, 5, 7, 11, 13, 17, 171, 1, 3, 10, 14, 22, 26, 34, 38, 253, 1, 3, 5, 21, 33, 39, 51, 57, 69, 406, 1, 3, 10, 7, 11, 13, 17, 19, 23, 29, 465
Offset: 1

Views

Author

Antti Karttunen, Apr 29 2015

Keywords

Comments

The array A(row,col) is read by its downwards antidiagonals as A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

Examples

			The top left corner of the array:
     1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1
     3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3
    10,   5,  10,   5,  10,   5,  10,   5,  10,   5,  10,   5,  10,   5,  10
    21,  14,   7,  14,   7,  14,  21,   7,  21,  14,   7,  14,   7,  14,  21
    55,  11,  22,  11,  22,  33,  11,  33,  22,  11,  22,  33,  33,  11,  33
    78,  26,  13,  26,  39,  13,  39,  26,  13,  26,  39,  39,  13,  39,  26
   136,  17,  34,  51,  17,  51,  34,  17,  34,  51,  51,  17,  51,  34,  17
   171,  38,  57,  19,  57,  38,  19,  38,  57,  57,  19,  57,  38,  19,  57
   253,  69,  23,  69,  46,  23,  46,  69,  69,  23,  69,  46,  23,  69,  46
   406,  29,  87,  58,  29,  58,  87,  87,  29,  87,  58,  29,  87,  58,  87
   465,  93,  62,  31,  62,  93,  93,  31,  93,  62,  31,  93,  62,  93, 124
   666,  74,  37,  74, 111, 111,  37, 111,  74,  37, 111,  74, 111, 148,  74
   820,  41,  82, 123, 123,  41, 123,  82,  41, 123,  82, 123, 164,  82,  41
   903,  86, 129, 129,  43, 129,  86,  43, 129,  86, 129, 172,  86,  43,  86
  1081, 141, 141,  47, 141,  94,  47, 141,  94, 141, 188,  94,  47,  94,  47
  1378, 159,  53, 159, 106,  53, 159, 106, 159, 212, 106,  53, 106,  53, 106
  ...
		

Crossrefs

Transpose: A257254.
Cf. A083221, A257251 (same array but with terms multiplied by 2).
Column 1: A008837.
Row 4: (7/2) * A145011.

Programs

Formula

A(row,col) = (1/2) * (A083221(row,col+1) - A083221(row,col)).
A(row,col) = A257251(row,col)/2.

A257254 Transpose of square array A257253.

Original entry on oeis.org

1, 3, 1, 10, 3, 1, 21, 5, 3, 1, 55, 14, 10, 3, 1, 78, 11, 7, 5, 3, 1, 136, 26, 22, 14, 10, 3, 1, 171, 17, 13, 11, 7, 5, 3, 1, 253, 38, 34, 26, 22, 14, 10, 3, 1, 406, 69, 57, 51, 39, 33, 21, 5, 3, 1, 465, 29, 23, 19, 17, 13, 11, 7, 10, 3, 1, 666, 93, 87, 69, 57, 51, 39, 33, 21, 5, 3, 1
Offset: 1

Views

Author

Antti Karttunen, Apr 29 2015

Keywords

Comments

See A257253.

Examples

			The top left corner of the array:
  1, 3, 10, 21, 55, 78, 136, 171, 253, 406, 465, 666, 820, 903
  1, 3,  5, 14, 11, 26,  17,  38,  69,  29,  93,  74,  41,  86
  1, 3, 10,  7, 22, 13,  34,  57,  23,  87,  62,  37,  82, 129
  1, 3,  5, 14, 11, 26,  51,  19,  69,  58,  31,  74, 123, 129
  1, 3, 10,  7, 22, 39,  17,  57,  46,  29,  62, 111, 123,  43
  1, 3,  5, 14, 33, 13,  51,  38,  23,  58,  93, 111,  41, 129
  1, 3, 10, 21, 11, 39,  34,  19,  46,  87,  93,  37, 123,  86
  1, 3,  5,  7, 33, 26,  17,  38,  69,  87,  31, 111,  82,  43
  1, 3, 10, 21, 22, 13,  34,  57,  69,  29,  93,  74,  41, 129
  1, 3,  5, 14, 11, 26,  51,  57,  23,  87,  62,  37, 123,  86
  1, 3, 10,  7, 22, 39,  51,  19,  69,  58,  31, 111,  82, 129
  1, 3,  5, 14, 33, 39,  17,  57,  46,  29,  93,  74, 123, 172
  1, 3, 10,  7, 33, 13,  51,  38,  23,  87,  62, 111, 164,  86
  1, 3,  5, 14, 11, 39,  34,  19,  69,  58,  93, 148,  82,  43
  1, 3, 10, 21, 33, 26,  17,  57,  46,  87, 124,  74,  41,  86
  1, 3,  5,  7, 22, 13,  51,  38,  69, 116,  62,  37,  82,  43
  ...
		

Crossrefs

Transpose: A257253.
Row 1: A008837.
Cf. A083140, A083221, A257252 (same array but with terms multiplied by 2).

Programs

A273221 a(n) = p*(p - 1)*(13*p - 5)/6, where p = prime(n).

Original entry on oeis.org

7, 34, 200, 602, 2530, 4264, 9792, 13794, 24794, 50344, 61690, 105672, 144320, 166754, 218362, 314184, 434594, 480680, 638242, 760410, 826944, 1049594, 1218274, 1503744, 1949312, 2201800, 2335834, 2620002, 2770344, 3088064, 4389882, 4819490, 5515072
Offset: 1

Views

Author

Vincenzo Librandi, May 18 2016

Keywords

Crossrefs

Programs

  • Magma
    [p*(p-1)*(13*p-5)/6: p in PrimesUpTo(200)];
    
  • Mathematica
    Table[p = Prime[n]; p (p - 1) (13 p - 5) / 6, {n, 40}]
    #(#-1) (13#-5)/6&/@Prime[Range[40]] (* Harvey P. Dale, Aug 04 2021 *)
  • Ruby
    require 'prime'
    p Prime.each.take(n).map{|i| i * (i - 1) * (13 * i - 5) / 6} # Seiichi Manyama, May 25 2016

A112456 Least triangular number divisible by n-th prime.

Original entry on oeis.org

6, 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, 5253, 5671, 5886, 6328, 8001, 8515, 9316, 9591, 11026, 11325, 12246, 13203, 13861, 14878, 15931, 16290, 18145, 18528, 19306
Offset: 1

Views

Author

Rick L. Shepherd, Sep 06 2005

Keywords

Comments

Essentially the same as A008837; only the first terms differ.

Crossrefs

Cf. A000217 (triangular numbers), A008837 (p(p-1)/2 for p prime).

Programs

  • Mathematica
    With[{tr=Accumulate[Range[300]]},Table[SelectFirst[tr,Divisible[#,Prime[n]]&],{n,50}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 06 2018 *)
  • PARI
    T(n) = n*(n+1)/2
    for(n=1,100, p=prime(n); tr=1; while(T(tr)%p<>0, tr++); print1(T(tr),","))
    
  • Python
    from sympy import prime
    def a(n):
        if n == 1: return 6
        p = prime(n)
        return p*(p-1)//2
    print([a(n) for n in range(1, 46)]) # Michael S. Branicky, Jun 03 2021

Formula

a(n) = p*(p-1)/2, for p = prime(n) and n >= 2. - Michael S. Branicky, Jun 03 2021
Previous Showing 11-20 of 31 results. Next