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

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 }.

A227475 Cubes which are sum of three consecutive primes.

Original entry on oeis.org

1331, 103823, 3048625, 11089567, 12008989, 19034163, 30664297, 43986977, 48627125, 59776471, 62570773, 68417929, 130323843, 180362125, 182284263, 186169411, 188132517, 263374721, 288804781, 377933067, 498677257, 510082399, 594823321, 697864103, 716917375
Offset: 1

Views

Author

K. D. Bajpai, Sep 02 2013

Keywords

Examples

			a(2) = 103823 because prime(3696) + prime(3697) + prime(3698) = 34603 + 34607 + 34613 = 103823 = 47^3.
		

Crossrefs

Programs

  • Mathematica
    Select[Total[#]&/@Partition[Prime[Range[132*10^5]],3,1],IntegerQ[ Surd[ #,3]]&] (* Harvey P. Dale, May 08 2018 *)
  • PARI
    n=0; forstep(j=3, 86231, 2, c=j^3; c3=c/3; f=0; if(denominator(c3)==1, if(isprime(c3), if(precprime(c3-1)+c3+nextprime(c3+1)==c, f=1))); p2=precprime(c3); p1=precprime(p2-1); p3=nextprime(c3); p4=nextprime(p3+1); if(p1+p2+p3==c, f=1); if(p2+p3+p4==c, f=1); if(f==1, n++; write("b227475.txt", n " " c))) /* Donovan Johnson, Sep 02 2013 */

Formula

a(n) = (A076306(n))^3. - R. J. Mathar, Sep 02 2013

A248587 The smallest of four consecutive primes whose sum is a perfect cube.

Original entry on oeis.org

4812191, 6353029, 8039333, 8821867, 19876711, 60742631, 85017061, 108879847, 127042367, 138853049, 170367959, 238190951, 259108427, 414949357, 485941193, 512095739, 529218559, 582868471, 623331491, 648485381, 771656657, 1001132351, 1098706507, 1172752457
Offset: 1

Views

Author

K. D. Bajpai, Oct 09 2014

Keywords

Examples

			a(2) = 6353029 is prime. Next three primes are 6353033, 6353051 and 6353071. Their sum = 6353029 + 6353033 + 6353051 + 6353071 = 25412184 = 294^3.
a(3) = 8039333 is prime. Next three primes are 8039359, 8039363 and 8039377. Their sum = 8039333 + 8039359 + 8039363 + 8039377 = 32157432 = 318^3.
		

Crossrefs

Cf. A000040 (primes), A000578 (cubes).
Cf. A061308 (two consecutive primes), A210205 (three consecutive primes).

Programs

  • Mathematica
    t = {}; p = 2; q = 3; r = 5; Do[v = NextPrime[r]; If[IntegerQ[(p + q + r + v)^(1/3)], AppendTo[t, p]; Print[p]]; p = q; q = r; r = v, {5*10^8}]; t
    Select[Partition[Prime[Range[6*10^7]], 4, 1],IntegerQ[Surd[Total[#], 3]] &] [[All, 1]] (* Harvey P. Dale, Oct 07 2016 *)
  • PARI
    lista(nn) = {vp = primes(nn); for (i=1, #vp - 3, if (ispower(vp[i]+vp[i+1]+vp[i+2]+vp[i+3], 3), print1(vp[i], ", ")););} \\ Michel Marcus, Oct 24 2014
    
  • Python
    from sympy import nextprime, prevprime
    A248587_list = []
    for i in range(3,10**6):
        n = i**3
        p3 = prevprime(n//4)
        p2, p4 = prevprime(p3), nextprime(p3)
        p1 = prevprime(p2)
        q = p1+p2+p3+p4
        while q <= n:
            if q == n:
                A248587_list.append(p1)
            p1, p2, p3, p4 = p2, p3, p4, nextprime(p4)
            q = p1+p2+p3+p4 # Chai Wah Wu, Dec 31 2015
Showing 1-3 of 3 results.