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-9 of 9 results.

A024450 Sum of squares of the first n primes.

Original entry on oeis.org

4, 13, 38, 87, 208, 377, 666, 1027, 1556, 2397, 3358, 4727, 6408, 8257, 10466, 13275, 16756, 20477, 24966, 30007, 35336, 41577, 48466, 56387, 65796, 75997, 86606, 98055, 109936, 122705, 138834, 155995, 174764, 194085, 216286, 239087, 263736, 290305, 318194
Offset: 1

Views

Author

Keywords

Comments

It appears that the only square in this sequence is 4. Checked 10^11 terms. a(10^11) = 247754953701579144582110673365391267. - T. D. Noe, Sep 06 2005
a(2n-1) is divisible by 2, a(3n+1) is divisible by 3, a(4n-3) is divisible by 4, a(6n+1) is divisible by 6, a(8n-3) is divisible by 8, a(12n+1) is divisible by 12, a(24n-11) is divisible by 24. - Alexander Adamchuk, Jun 15 2006
The sequence is best looked at in base 12, with X for 10 and E for 11: 4, 11, 32, 73, 154, 275, 476, 717, X98, 1479, 1E3X, 289E, 3860, 4941, 6082, 7823, 9844, EX25, 12546, 15447, 18548, 20089, 2406X, 2876E, 320E0, 37E91, 42152, 488E3, 53754, 5E015, 68416, 76337, 85178, 94399, X51EX, E643E, 108760, 120001. Since the squares of all primes greater than 3 are always 1 mod 12, the sequence obeys the rule a(n) mod 12 = (n-1) mod 12 for n>=2. The rule gives a(2n-1) = (2n-2) mod 12 and so a(2n-1) must be divisible by 2. a(3n+1) = (3n) mod 12 so a(3n+1) is divisible by 3. The other rules are proved similarly. Remember: base 12 is a research tool! - Walter Kehowski, Jun 24 2006
For all primes p > 3, we have p^2 == 1 (mod m) for m dividing 24 (and only these m). Using a covering argument, it is not hard to show that all terms except a(24k+13) are nonsquares. Hence in the search for square a(n), only 1 out of every 24 terms needs to be checked. - T. D. Noe, Jan 23 2008

Crossrefs

Partial sums of A001248.
Cf. A007504 (sum of the first n primes).

Programs

  • Haskell
    a024450 n = a024450_list !! (n-1)
    a024450_list = scanl1 (+) a001248_list
    -- Reinhard Zumkeller, Jun 08 2015
    
  • Magma
    [&+[NthPrime(k)^2: k in [1..n]]: n in [1..40]]; // Vincenzo Librandi, Oct 11 2018
    
  • Magma
    [n le 1 select 4 else Self(n-1) + NthPrime(n)^2: n in [1..80]]; // G. C. Greubel, Jan 30 2025
    
  • Maple
    A024450:=n->add(ithprime(i)^2, i=1..n); seq(A024450(n), n=1..100); # Wesley Ivan Hurt, Nov 09 2013
  • Mathematica
    Table[ Sum[ Prime[k]^2, {k, 1, n} ], {n, 40} ]
    Accumulate[Prime[Range[40]]^2] (* Harvey P. Dale, Apr 16 2013 *)
  • PARI
    s=0;forprime(p=2,1e3,print1(s+=p^2", ")) \\ Charles R Greathouse IV, Jul 15 2011
    
  • PARI
    a(n) = norml2(primes(n)); \\ Michel Marcus, Nov 26 2020
    
  • Python
    from sympy import prime, primerange
    def a(n): return sum(p*p for p in primerange(1, prime(n)+1))
    print([a(n) for n in range(1, 40)]) # Michael S. Branicky, Apr 13 2021

Formula

a(n) = A007504(n)^2 - 2*A024447(n). - Alexander Adamchuk, Jun 15 2006
a(n) = Sum_{i=1..n} prime(i)^2. - Walter Kehowski, Jun 24 2006
a(n) = (1/3)*n^3*log(n)^2 + O(n^3*log(n)*log(log(n))). The proof is similar to proof for A007504(n) (see link of Shevelev). - Vladimir Shevelev, Aug 02 2013
a(n) = a(n-1) + prime(n)^2, with a(1) = 4. - G. C. Greubel, Jan 30 2025

A339194 Sum of all squarefree semiprimes with greater prime factor prime(n).

Original entry on oeis.org

0, 6, 25, 70, 187, 364, 697, 1102, 1771, 2900, 3999, 5920, 8077, 10234, 13207, 17384, 22479, 26840, 33567, 40328, 46647, 56248, 65653, 77786, 93411, 107060, 119583, 135248, 149439, 167240, 202311, 225320, 253587, 276332, 316923, 343676, 381039, 421192, 458749
Offset: 1

Views

Author

Gus Wiseman, Dec 02 2020

Keywords

Examples

			The triangle A339116 with row sums equal to this sequence begins (n > 1):
    6 = 6
   25 = 10 + 15
   70 = 14 + 21 + 35
  187 = 22 + 33 + 55 + 77
		

Crossrefs

A025129 gives sums of squarefree semiprimes by weight, row sums of A338905.
A143215 is the not necessarily squarefree version, row sums of A087112.
A339116 is a triangle of squarefree semiprimes with these row sums.
A339360 looks at all squarefree numbers, row sums of A339195.
A001358 lists semiprimes.
A005117 lists squarefree numbers.
A006881 lists squarefree semiprimes, with odd terms A046388.
A024697 is the sum of semiprimes of weight n.
A168472 gives partial sums of squarefree semiprimes.
A332765 gives the greatest squarefree semiprime of weight n.
A338898/A338912/A338913 give the prime indices of semiprimes, with product A087794, sum A176504, and difference A176506.
A338899/A270650/A270652 give the prime indices of squarefree semiprimes, with difference A338900.
A338904 groups semiprimes by weight.
A338907/A338908 list squarefree semiprimes of odd/even weight.

Programs

  • Mathematica
    Table[Sum[Prime[i]*Prime[j],{j,i-1}],{i,10}]
  • PARI
    a(n) = prime(n)*vecsum(primes(n-1)); \\ Michel Marcus, Jun 15 2024

Formula

a(n) = prime(n) * Sum_{k=1..n-1} prime(k) = prime(n) * A007504(n-1).
a(n) = A024447(n) - A024447(n-1).
a(n) = A034960(n) - A143215(n). - Marco Zárate, Jun 14 2024

A238146 Triangle read by rows: T(n,k) is coefficient of x^(n-k) in consecutive prime rooted polynomial of degree n, P(x) = Product_{k=1..n} (x-p(k)) = 1*x^n + T(n,1)*x^(n-1)+ ... + T(n,k-1)*x + T(n,k), for 1 <= k <= n.

Original entry on oeis.org

-2, -5, 6, -10, 31, -30, -17, 101, -247, 210, -28, 288, -1358, 2927, -2310, -41, 652, -5102, 20581, -40361, 30030, -58, 1349, -16186, 107315, -390238, 716167, -510510, -77, 2451, -41817, 414849, -2429223, 8130689, -14117683, 9699690
Offset: 1

Views

Author

Fedor Igumnov, Feb 18 2014

Keywords

Comments

The coefficient of first polynomial term with highest degree is always 1.
Each number in triangle is the sum of radicals of integers.
The absolute value of the entry in the k-th column is the k-th elementary symmetric function of the first n+(k-1) primes.

Examples

			Triangle begins:
================================================
\k |    1     2     3     4     5     6     7
n\ |
================================================
1  |  -2;
2  |  -5,   6;
3  |  -10,  31,   -30;
4  |  -17, 101,  -247,  210;
5  |  -28, 288, -1358,  2927,  -2310;
6  |  -41, 652, -5102, 20581, -40361, 30030;
7  |  -58,1349,-16186,107315,-390238,716167,-510510;
So equation x^7 -58*x^6 + 1349*x^5 -16186*x^4 + 107315*x^3 -390238*x^2+ 716167*x -510510 = 0 has 7 consecutive prime roots: 2,3,5,7,11,13,17
		

Crossrefs

Cf. A007504 (abs of column 1) A002110(abs of right border). Also:
A024447 is the abs of column 2;
A024448 is the abs of column 3;
A024449 is the abs of column 4;
A006939 is the determinant of triangle matrix, considering T(n,k) k>n = 0;
A007947 = radicals of integers.

Programs

  • Maple
    T:= n-> (p-> seq(coeff(p, x, n-i), i=1..n))(mul(x-ithprime(i), i=1..n)):
    seq(T(n), n=1..10);  # Alois P. Heinz, Aug 18 2019
  • Mathematica
    a = 1
    For [i = 1, i < 10, i++,
    a *= (x - Prime[i]);
    Print[Drop[Reverse[CoefficientList[Expand[a], x]], 1]]
    ]

Extensions

Name edited by Alois P. Heinz, Aug 18 2019

A260613 Triangle read by rows: T(n, k) = coefficient of x^(n-k) in Product_{m=1..n} (x+prime(m)); 0 <= k <= n, n >= 0.

Original entry on oeis.org

1, 1, 2, 1, 5, 6, 1, 10, 31, 30, 1, 17, 101, 247, 210, 1, 28, 288, 1358, 2927, 2310, 1, 41, 652, 5102, 20581, 40361, 30030, 1, 58, 1349, 16186, 107315, 390238, 716167, 510510, 1, 77, 2451, 41817, 414849, 2429223, 8130689, 14117683, 9699690
Offset: 0

Views

Author

Matthew Campbell, Aug 10 2015

Keywords

Comments

Up to signs and order of coefficients the same as A070918. Except for signs and the first column the same as A238146. - M. F. Hasler, Aug 13 2015

Examples

			The triangle starts:
Row 0: 1;
Row 1: 1, 2;  Coefficients of x + 2.
Row 2: 1, 5, 6;  Coefficients of (x+2)(x+3) = x^2 + 5x + 6.
Row 3: 1, 10, 31, 30; Coeff's of (x+2)(x+3)(x+5) = x^3 + 10x^2 + 31x + 30.
Row 5: 1, 17, 101, 247, 210;
Row 6: 1, 28, 288, 1358, 2927, 2310;
...
		

Crossrefs

Main diagonal gives A002110.
Row sums give A054640.
Cf. A000040.

Programs

  • Maple
    T:= n-> (p-> seq(coeff(p, x, n-i), i=0..n))(mul(x+ithprime(i), i=1..n)):
    seq(T(n), n=0..10);  # Alois P. Heinz, Aug 18 2019
  • Mathematica
    row[n_] := CoefficientList[Product[x + Prime[m], {m, 1, n}] + O[x]^(n+1), x] // Reverse;
    row /@ Range[0, 8] // Flatten (* Jean-François Alcover, Sep 16 2019 *)
  • PARI
    tabl(nn) = {for (n=0, nn, polp = prod(k=1, n, x+prime(k)); forstep (k= n, 0, -1, print1(polcoeff(polp, k), ", ");); print(););} \\ Michel Marcus, Aug 10 2015

Formula

T(n, 1) = A007504(n) for n >= 1.
T(n, 2) = A024447(n) for n >= 2.

Extensions

Corrected and edited by M. F. Hasler, Aug 13 2015
a(20) in b-file corrected by Andrew Howroyd, Dec 31 2017

A309802 a(n) is the coefficient of x^n in the polynomial Product_{i=1..n+2} (prime(i)*x-1).

Original entry on oeis.org

1, 10, 101, 1358, 20581, 390238, 8130689, 201123530, 6166988769, 201097530280, 7754625545261, 329758834067168, 14671637258193181, 711027519310719868, 38706187989054920001, 2338431642812927422310, 145908145906128304198449, 9976861293427674211625032
Offset: 0

Views

Author

Alexey V. Bazhin, Aug 17 2019

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> coeff(mul(ithprime(i)*x-1, i=1..n+2), x, n):
    seq(a(n), n=0..20);  # Alois P. Heinz, Aug 18 2019

Formula

a(n) = [x^n] Product_{i=1..n+2} (prime(i)*x-1).
a(n) = abs(A070918(n+2,2)).
a(n) = abs(A238146(n+2,n)) for n>0.
a(n) = A260613(n+2,n).

A309803 a(n) is the coefficient of x^n in the polynomial Product_{i=1..n+3} (prime(i)*x-1).

Original entry on oeis.org

-1, -17, -288, -5102, -107315, -2429223, -64002818, -2057205252, -69940351581, -2788890538777, -122099137635118, -5580021752377242, -276932659619923555, -15388458479166668283, -946625238259888348698, -60082571176666116692888, -4171440414742758122621945
Offset: 0

Views

Author

Alexey V. Bazhin, Aug 17 2019

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> coeff(mul(ithprime(i)*x-1, i=1..n+3), x, n):
    seq(a(n), n=0..20);  # Alois P. Heinz, Aug 19 2019

Formula

a(n) = [x^n] Product_{i=1..n+3} (prime(i)*x-1).
a(n) = -abs(A070918(n+3,3)).
a(n) = -abs(A238146(n+3,n)) for n>0.
a(n) = -A260613(n+3,n).

A357251 a(n) = Sum_{1<=i<=j<=n} prime(i)*prime(j).

Original entry on oeis.org

4, 19, 69, 188, 496, 1029, 2015, 3478, 5778, 9519, 14479, 21768, 31526, 43609, 59025, 79218, 105178, 135739, 173795, 219164, 271140, 333629, 406171, 491878, 594698, 711959, 842151, 988848, 1150168, 1330177, 1548617, 1791098, 2063454, 2359107, 2698231, 3064708, 3470396, 3918157, 4404795, 4938846
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Sep 20 2022

Keywords

Comments

a(n) is the sum of products of unordered pairs of (not necessarily distinct) elements from the first n primes.
It appears that 4 is the only square in the sequence.

Examples

			a(3) = 2*2 + 2*3 + 2*5 + 3*3 + 3*5 + 5*5 = 69.
		

Crossrefs

Partial sums of A143215.
Row n=2 of A343751.

Programs

  • Maple
    P:= [seq(ithprime(i),i=1..100)]:
    S:= ListTools:-PartialSums(P):
    ListTools:-PartialSums(zip(`*`,P,S));
  • Mathematica
    Accumulate[(p = Prime[Range[40]]) * Accumulate[p]] (* Amiram Eldar, Sep 20 2022 *)
  • Python
    from itertools import accumulate
    from sympy import prime, primerange
    def aupton(nn):
        p = list(primerange(2, prime(nn)+1))
        return list(accumulate(c*d for c, d in zip(p, accumulate(p))))
    print(aupton(40)) # Michael S. Branicky, Sep 24 2022 after Amiram Eldar

Formula

a(n) = (A007504(n)^2 + A024450(n))/2.
a(n) = A024447(n) + A024450(n).
a(n) = A065762(n)/2. - Hugo Pfoertner, Sep 24 2022

A309804 a(n) is the coefficient of x^n in the polynomial Product_{i=1..n+4} (prime(i)*x-1).

Original entry on oeis.org

1, 28, 652, 16186, 414849, 11970750, 411154568, 14802996860, 617651235401, 28112591190218, 1330940558814492, 68134228016658366, 3888046744502816953, 244783216404832868510, 15878401438954693327808, 1123935467586630569656024, 83970858613393528568199649
Offset: 0

Views

Author

Alexey V. Bazhin, Aug 17 2019

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> coeff(mul(ithprime(i)*x-1, i=1..n+4), x, n):
    seq(a(n), n=0..20);  # Alois P. Heinz, Aug 19 2019
  • Mathematica
    a[n_] := CoefficientList[Series[Product[Prime[i]*x - 1, {i, 1, n+4}], {x, 0, 25}], x] [[n+1]]; Array[a, 17, 0] (* Amiram Eldar, Aug 24 2019 *)
  • PARI
    a(n) = polcoef(prod(i=1, n+4, prime(i)*x-1), n); \\ Michel Marcus, Aug 25 2019

Formula

a(n) = [x^n] Product_{i=1..n+4} (prime(i)*x-1).
a(n) = abs(A070918(n+4,4)).
a(n) = abs(A238146(n+4,n)) for n>0.
a(n) = A260613(n+4,n).

A024452 a(n) = [ (2nd elementary symmetric function of P(n))/(first elementary symmetric function of P(n)) ], where P(n) = {first n+1 primes}.

Original entry on oeis.org

1, 3, 5, 10, 15, 23, 31, 42, 55, 69, 86, 105, 125, 148, 173, 200, 230, 262, 296, 331, 369, 409, 452, 498, 547, 597, 649, 702, 757, 819, 883, 950, 1017, 1090, 1164, 1240, 1320, 1402, 1487, 1574, 1663, 1757, 1851, 1948
Offset: 1

Views

Author

Keywords

Crossrefs

Showing 1-9 of 9 results.