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

A132956 The smallest perfect square which is a sum of n consecutive primes.

Original entry on oeis.org

36, 49, 36, 961, 3600, 169, 1444, 100, 138384, 11449, 2304, 9025, 484, 60025, 7056, 35721, 8836, 85849, 25600, 6889, 40000, 961, 1156, 58081, 7056, 1369, 32400, 426409, 60516, 1849, 7396, 15129, 77284, 5329, 19600, 3249, 39204, 96721, 32400
Offset: 2

Views

Author

Enoch Haga, Sep 06 2007

Keywords

Comments

The smallest of these n consecutive primes is A132955(n).

Examples

			a(2)=36, because 2+3=5 is not a perfect square, 3+5=8 is not, 5+7=12 is not, 7+11 is not.. but 17+19=36=6^2 is.
		

Crossrefs

Programs

  • PARI
    a(n) = {ip = 1; while (! issquare(v=sum(i=ip, ip+n-1, prime(i))), ip++); v;} \\ Michel Marcus, Jun 08 2014

Extensions

Definition simplified, offset set to 2 by R. J. Mathar, Oct 30 2009

A132957 a(n) = sqrt(A132956(n)).

Original entry on oeis.org

6, 7, 6, 31, 60, 13, 38, 10, 372, 107, 48, 95, 22, 245, 84, 189, 94, 293, 160, 83, 200, 31, 34, 241, 84, 37, 180, 653, 246, 43, 86, 123, 278, 73, 140, 57, 198, 311, 180, 891, 704, 93, 558, 65, 1150, 233, 88, 429, 352, 329, 238, 485, 358, 307, 214, 163, 346, 709, 728
Offset: 2

Views

Author

Enoch Haga, Sep 06 2007

Keywords

Examples

			a(2)= sqrt(36)=6. a(3)=sqrt(49)=7.
		

Crossrefs

Programs

  • PARI
    a(n) = {ip = 1; while (! issquare(v=sum(i=ip, ip+n-1, prime(i))), ip++); sqrtint(v);} \\ Michel Marcus, Jun 08 2014

Extensions

Definition simplified, offset set to 2 by R. J. Mathar, Oct 30 2009

A382226 Smallest prime in a sequence of n consecutive primes which add to a perfect cube.

Original entry on oeis.org

3, 439, 4812191, 41051, 1753, 75869, 24359, 1674289, 17509, 6221, 771653, 29863, 6899, 35353, 1073239, 4001, 18959, 1613741, 1033, 12077759, 172433, 1548149, 364079, 199, 4580399, 373, 3847, 411396253, 41863, 1371031, 11491, 135911, 45707, 308149, 364909, 176537, 2089, 32569961, 13619, 625861
Offset: 2

Views

Author

David Dewan, Mar 19 2025

Keywords

Comments

a(1) does not exist because no single prime is a perfect cube.

Examples

			a(2)=3  :       3 + 5 = 8 = 2^3 = A382227(2).
a(3)=439 :      439 + 443 + 449 = 1331 = 11^3 = A382227(3) = A210205(1).
a(4)=4812191 :   4812191 + 4812193 + 4812209 + 4812239 = 19248832 = 268^3 = A382227(4) = A248587(1).
		

Crossrefs

Programs

  • Maple
    A382226 := proc(n)
            local i,ps,fp,lp ;
            fp := 2;
            ps := add(ithprime(j),j=1..n) ;
            lp := ithprime(n);
            for i from 1 do
                    if isA000578(ps) then #code in A000578
                            return fp;
                    end if;
                    lp := nextprime(lp) ;
                    ps := ps-fp+lp ;
                    fp := nextprime(fp) ;
            end do:
    end proc:
    for n from 2 do
            print(n,A382226(n)) ;
    end do:  # R. J. Mathar, Mar 25 2025
  • Mathematica
    a[n_]:=Do[mid=PrimePi[k^3/n]; toTest=Prime[Range[Max[mid-n, 1], mid+n]];
    t=Total/@Partition[toTest, n, 1];pos=Position[t, k^3];If[pos!={}, Return[First[toTest[[First[pos]]]]]], {k, 2 , Infinity} ];a/@Range[2, 10]

Formula

a(n) = { min prime(k): [ sum(j=k..k+n-1) prime(j)] in A000578 }.

A230327 Index of smallest prime such that the sum of n consecutive primes starting with this specific prime is a square.

Original entry on oeis.org

7, 6, 3, 42, 107, 6, 38, 1, 1631, 170, 38, 119, 5, 546, 78, 309, 85, 604, 199, 57, 270, 2, 3, 333, 45, 2, 178, 1708, 291, 2, 35, 72, 322, 19, 84, 5, 155, 346, 122, 2175, 1395, 24, 886, 2, 3108, 168, 14, 499, 340, 294, 156, 578, 325, 240, 115, 61, 283, 1035
Offset: 2

Views

Author

Michel Marcus, Oct 16 2013

Keywords

Examples

			a(2)=7 because 17+19 (2 terms) = 36 is a square, 17 being the 7th prime.
a(3)=6 because 13+17+19 (3 terms) =49 is a square, 13 being the 6th prime.
		

Crossrefs

Cf. A064397 (2 primes), A076305 (3 primes), A072849 (4 primes), A166255 (70 primes), A166261 (120 primes).
Cf. A132955 (primes themselves), A132956 (squares=sums), A132957 (square roots of sums).

Programs

  • PARI
    a(n, lim=10^5) = {n --; pr = primes(lim); for (i = 1, lim-n, s = sum(k=i, i+n, pr[k]); if (issquare(s), return (i));); return (0);} \\ Michel Marcus, Oct 16 2013
Showing 1-4 of 4 results.