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

A074924 Numbers whose square is the sum of two successive primes.

Original entry on oeis.org

6, 10, 12, 24, 42, 48, 62, 72, 84, 90, 110, 120, 122, 174, 204, 208, 220, 232, 240, 264, 306, 326, 336, 372, 386, 408, 410, 444, 454, 456, 468, 470, 474, 522, 546, 550, 594, 600, 630, 640, 642, 686, 740, 750, 762, 766, 788, 802, 852, 876, 882, 920, 936, 970
Offset: 1

Views

Author

Zak Seidov, Oct 02 2002

Keywords

Examples

			6^2 = 17 + 19, 1610^2 = 1296041 + 1296059.
		

Crossrefs

Square roots of squares in A001043.
Cf. A062703 (the squares), A061275 (lesser of the primes), A064397 (index of that prime).
Cf. A064397 (numbers n such that prime(n) + prime(n+1) is a square), A071220 (prime(n) + prime(n+1) is a cube), A074925 (n^3 is sum of 2 consecutive primes).

Programs

  • Maple
    filter:= proc(n) local t; t:= n^2/2; prevprime(ceil(t)) + nextprime(floor(t)) = n^2 end proc:
    select(filter, [$3..1000]); # Robert Israel, Nov 19 2024
  • Mathematica
    Select[Sqrt[#]&/@(Total/@Partition[Prime[Range[50000]],2,1]),IntegerQ] (* Harvey P. Dale, Oct 04 2014 *)
    f@n_ := Sqrt@Select[(2*Range@n)^2, # == Plus @@ NextPrime[#/2, {-1, 1}] &]; f@485 (* Hans Rudolf Widmer, Nov 19 2024 *)
  • PARI
    is(n)=if(n%2, return(0)); nextprime(n^2/2+1)+precprime(n^2/2)==n^2 \\ Charles R Greathouse IV, Apr 29 2015
    
  • PARI
    select( {is_A074924(n)=!bittest(n=n^2,0) && precprime(n\2)+nextprime(n\/2)==n}, [1..999]) \\ M. F. Hasler, Jan 03 2020
    
  • PARI
    A74924=[6]; apply( A074924(n)={while(n>#A74924, my(N=A74924[#A74924]); until( is_A074924(N+=2),);A74924=concat(A74924,N));A74924[n]}, [1..99]) \\ M. F. Hasler, Jan 03 2020
    
  • Python
    from itertools import count, islice
    from sympy import nextprime, prevprime
    def agen(): # generator of terms
        for k in count(4, step=2):
            kk = k*k
            if prevprime(kk//2+1) + nextprime(kk//2-1) == kk:
                yield k
    print(list(islice(agen(), 54))) # Michael S. Branicky, May 24 2022

Formula

a(n) = sqrt(A062703(n)). - Zak Seidov, May 26 2013
a(n) = A000040(i) + A000040(i+1) with i = A064397(n) = A000720(A061275(n)). - M. F. Hasler, Jan 03 2020

Extensions

Crossrefs section corrected and extended by M. F. Hasler, Jan 03 2020

A179975 Smallest k such that k*10^n is a sum of two successive primes.

Original entry on oeis.org

5, 3, 1, 6, 6, 6, 14, 6, 9, 19, 21, 21, 42, 93, 21, 6, 11, 2, 12, 111, 37, 39, 63, 38, 42, 24, 15, 15, 60, 6, 39, 82, 47, 58, 337, 49, 72, 25, 34, 21, 6, 107, 128, 96, 20, 2, 63, 231, 70, 7, 62, 144, 28, 151, 157, 33, 98, 55, 134, 162, 87, 201, 124, 303, 64, 106, 130, 13, 43
Offset: 0

Views

Author

Zak Seidov, Aug 04 2010

Keywords

Comments

From Robert G. Wilson v, Aug 11 2010: (Start)
A179975 n's such that a(n)=1: 3, 335, ..., .
A179975 First occurrence of k: 3, 18, 2, ???, 1, 4, 50, 162, 9, 335, 17, 19, 68, 7, 27, ..., .
Records: 5, 6, 14, 19, 21, 42, 93, 111, 337, 449, 862, 1049, 1062, 1122, 1280, 2278, 3168, 4290, ..., . (End)

Examples

			a(0)=5 because 5=2+3
a(1)=3 because 30=13+17
a(2)=1 because 100=47+53
a(3)=6 because 6000=2999+3001.
		

Crossrefs

Programs

  • Mathematica
    Join[{5,3},Reap[Do[Do[n=10^m k; If[n==PreviousPrime[n/2]+NextPrime[n/2],Sow[k];Break[]],{k,2000}],{m,2,50}]][[2,1]]]
    f[n_] := Block[{k = 1, tn = 10^n}, While[h = k*tn/2; NextPrime[h, -1] + NextPrime@h != k*tn, k++ ]; k]; f[1] = 3; Array[f, 70, 0] (* Robert G. Wilson v, Aug 11 2010 *)

Extensions

More terms from Robert G. Wilson v, Aug 11 2010

A061308 Smaller of two consecutive primes whose sum is a cube.

Original entry on oeis.org

3, 107, 10973, 37039, 186619, 2125757, 2634011, 5323949, 5470519, 6406447, 7443463, 8001491, 12967153, 20353771, 27435973, 29659499, 57395627, 66325487, 99588343, 104792291, 129847021, 134793059, 153090997, 172974199, 186623993, 271669247, 283831771, 343064479
Offset: 1

Views

Author

Amarnath Murthy, Apr 26 2001

Keywords

Examples

			a(2) = 107 as 107 + 109 = 216 = 6^3; a(3) = 10973 as 10973 + 10979 = 21952 = 28^3.
		

Crossrefs

Programs

  • Python
    from _future_ import division
    from sympy import prevprime, nextprime
    A061308_list = [prevprime(n**3//2) for n in range(2,10**4) if prevprime(n**3//2)+nextprime(n**3//2) == n**3] # Chai Wah Wu, Feb 11 2018

Formula

a(n) = prime(A071220(n)). - R. J. Mathar, Aug 11 2012

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 15 2001

A074925 Numbers n such that n^3 is a sum of two successive primes.

Original entry on oeis.org

2, 6, 28, 42, 72, 162, 174, 220, 222, 234, 246, 252, 296, 344, 380, 390, 486, 510, 584, 594, 638, 646, 674, 702, 720, 816, 828, 882, 942, 948, 990, 1044, 1056, 1146, 1200, 1314, 1422, 1436, 1554, 1566, 1596, 1602, 1632, 1740, 1770, 1778, 1806, 1818, 1824
Offset: 1

Views

Author

Zak Seidov, Oct 02 2002

Keywords

Comments

Prime(n)+ prime(n+1) as a square in A064397; n^2 as a sum of two successive primes in A074924; prime(n)+ prime(n+1) as a cube in A071220.

Examples

			6^3 = 216 = 107 + 109.
		

Crossrefs

Programs

  • Mathematica
    Surd[#,3]&/@Select[Total/@Partition[Prime[Range[150*10^6]],2,1], IntegerQ[ Surd[#,3]]&] (* Harvey P. Dale, Jun 05 2018 *)
  • Python
    from sympy import nextprime, prevprime
    A074925_list = [i for i in range(2,10**4,2) if prevprime(i**3//2) + nextprime(i**3//2) == i**3] # Chai Wah Wu, Feb 22 2017

Extensions

More terms from Zak Seidov, Jul 22 2009

A226524 Cubes which are the sum of two consecutive primes.

Original entry on oeis.org

8, 216, 21952, 74088, 373248, 4251528, 5268024, 10648000, 10941048, 12812904, 14886936, 16003008, 25934336, 40707584, 54872000, 59319000, 114791256, 132651000, 199176704, 209584584, 259694072, 269586136, 306182024, 345948408, 373248000, 543338496, 567663552
Offset: 1

Views

Author

K. D. Bajpai, Aug 31 2013

Keywords

Examples

			a(2) = 216: prime(28) + prime(29) = 107 + 109 = 216 = 6^3.
		

Crossrefs

Cubes in A001043.
Cf. A062703 (analog for squares), A061308 (lesser of the consecutive primes), A071220 (index of that prime), A074925 (a(n)^(1/3)).

Programs

  • Maple
    KD: = proc() local a,b,c;  a: = ithprime(n) + ithprime(n+1); b:= evalf(a^(1/3)); if b=floor(b) then RETURN(a):  fi; end: seq(KD(), n=1..1000000);
  • Mathematica
    Select[Total/@Partition[Prime[Range[155*10^5]],2,1],IntegerQ[Surd[#,3]]&] (* or *) stcpQ[n_]:=Module[{p1=NextPrime[Floor[n/2],-1],p2=NextPrime[Ceiling[n/2]]},n==p1+p2]; Select[Range[850]^3,stcpQ] (* The second program is much more efficient than the first. *) (* Harvey P. Dale, May 15 2022 *)
  • PARI
    n=0; forstep(j=2, 55778, 2, c=j^3; c2=c/2; if(precprime(c2)+nextprime(c2)==c, n++; write("b226524.txt", n " " c))) /* Donovan Johnson, Sep 02 2013 */
    
  • PARI
    A226524(n)=A074925(n)^3 \\ M. F. Hasler, Jan 03 2020
    
  • Python
    from itertools import count, islice
    from sympy import nextprime, prevprime
    def agen(): yield from (c for c in (k**3 for k in count(2, step=2)) if prevprime(c//2+1) + nextprime(c//2-1) == c)
    print(list(islice(agen(), 27))) # Michael S. Branicky, May 24 2022

Formula

a(n) = A074925(n)^3 = A000040(i) + A000040(i+1) with i = A071220(n) = A000720(A061308(n)). - M. F. Hasler, Jan 03 2020

Extensions

Edited by M. F. Hasler, Jan 03 2020
Showing 1-5 of 5 results.