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.

A051935 a(n) = smallest number > a(n-1) such that a(1) + a(2) + ... + a(n) is a prime.

Original entry on oeis.org

2, 3, 6, 8, 10, 12, 18, 20, 22, 26, 30, 34, 36, 42, 44, 46, 50, 52, 60, 66, 72, 74, 76, 78, 80, 82, 102, 108, 114, 116, 118, 126, 128, 132, 136, 138, 144, 146, 150, 154, 158, 162, 166, 170, 174, 186, 196, 198, 210, 222, 228, 236, 240, 244, 246, 254, 270, 280, 282
Offset: 1

Views

Author

Felice Russo, Dec 21 1999

Keywords

Examples

			The third term is 6 because 2 + 3 + 6 = 11 is a prime.
		

Crossrefs

Programs

  • Mathematica
    p=2;lst={p};Do[If[PrimeQ[p+n], AppendTo[lst, n];p=p+n], {n, 3, 10^3}];lst (* Vladimir Joseph Stephan Orlovsky, Aug 14 2008 *)
    nxt[{t_,a_}]:=Module[{k=a+1},While[!PrimeQ[t+k],k++];{t+k,k}]; Transpose[ NestList[ nxt,{2,2},60]][[2]] (* Harvey P. Dale, Apr 10 2016 *)
    nxt[{t_,a_}]:=Module[{k=a+1},k=NextPrime[t+k-1]-t;{t+k,k}]; NestList[ nxt,{2,2},60][[All,2]] (* More efficient than the program immediately above *) (* Harvey P. Dale, Aug 26 2019 *)
  • PARI
    first(n) = {my(res = vector(n), os = 2, ns); res[1] = 2; for(i = 2, n, ns = nextprime(os + res[i-1] + 1); res[i] = ns - os; os = ns); res} \\ David A. Corneth, Aug 26 2019
    
  • Perl
    use ntheory ":all"; my($s,@L)=(2,2); for (1..99) { push @L, next_prime($s+$L[-1])-$s; $s+=$L[-1]; } print "[@L]\n"; # Dana Jacobsen, Sep 25 2018
    
  • Python
    from sympy import isprime
    from itertools import islice
    def agen(): # generator of terms
        yield from [2, 3]
        s, an = 5, 4
        while True:
            while not isprime(s+an): an += 2
            yield an
            an, s = an+2, s+an
    print(list(islice(agen(), 60))) # Michael S. Branicky, Oct 30 2022

A051896 a(n) = smallest palindrome > a(n-1) such that a(1)*a(2)*...*a(n) + 1 is prime with a(1) = 2.

Original entry on oeis.org

2, 3, 5, 6, 9, 55, 66, 77, 88, 161, 191, 313, 484, 494, 525, 747, 3223, 3993, 11711, 13431, 13731, 18881, 19691, 21012, 21112, 22422, 24242, 34443, 35353, 41114, 44244, 44844, 46664, 52225, 52925, 53935, 58385, 59895, 60806, 64146, 71917
Offset: 1

Views

Author

Felice Russo, Dec 21 1999

Keywords

Crossrefs

Subsequence of A002113.

Programs

  • Mathematica
    nxt[{t_,a_}]:=Module[{k=a+1},While[(!PalindromeQ[k])||CompositeQ[k*t+1],k++];{t*k,k}]; NestList[nxt,{2,2},40][[All,2]] (* Harvey P. Dale, Apr 18 2022 *)

Extensions

Initial conditions added to description by Chai Wah Wu, Apr 16 2021

A087581 Primes such that successive differences are increasing palindromes.

Original entry on oeis.org

2, 3, 5, 11, 19, 41, 107, 349, 601, 863, 1277, 1721, 2347, 3023, 3709, 4517, 6959, 9511, 12503, 17167, 22051, 28057, 34283, 40949, 49177, 69379, 89681, 110083, 150287, 190591, 251197, 312313, 374029, 454637, 656839, 864541, 1076753, 1478957
Offset: 1

Views

Author

Amarnath Murthy, Sep 17 2003

Keywords

Comments

The sequence of successive difference is 1,2,6,8,22,66,...

Crossrefs

Extensions

More terms from Zachary Tunison (ztuni2005(AT)gmail.com), Mar 07 2005
More terms from David Wasserman, Jun 13 2005
Offset corrected by Chai Wah Wu, Aug 30 2021

A051954 a(n) = smallest palindrome > a(n-1) such that a(1)*a(2)*...*a(n) - 1 is a prime.

Original entry on oeis.org

3, 4, 5, 6, 8, 9, 11, 22, 88, 232, 272, 303, 333, 383, 434, 454, 555, 787, 797, 848, 999, 1331, 3663, 6666, 10201, 14041, 15951, 17271, 21912, 22122, 24442, 26662, 33433, 35053, 40504, 40804, 44344, 44644, 44844, 45754, 55955, 67976, 72227, 72627
Offset: 1

Views

Author

Felice Russo, Dec 21 1999

Keywords

Crossrefs

Subsequence of A002113.

Programs

  • Mathematica
    nxt[{p_,a_}]:=Module[{k=a+1},While[!PalindromeQ[k]||!PrimeQ[p*k-1],k++];{p*k,k}]; NestList[nxt,{3,3},50][[All,2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 22 2021 *)

A131260 a(n) is the least palindrome > a(n-1) such that a(1) + a(2) + ... + a(n) is a semiprime.

Original entry on oeis.org

4, 5, 6, 7, 11, 22, 66, 88, 202, 212, 242, 272, 404, 444, 464, 474, 595, 656, 707, 757, 777, 808, 828, 838, 868, 888, 969, 989, 1111, 1881, 2222, 2772, 3553, 4444, 5005, 5335, 5555, 5665, 5995, 6006, 6556, 6886, 8448, 8668, 8888, 9229, 9339, 10601
Offset: 1

Views

Author

Jonathan Vos Post, Oct 20 2007

Keywords

Comments

Semiprime analog of A051934. The semiprime partial sums begin 4, 9, 15, 22, 33, 55, 121, 209, 411, 623, 865, 1137, 1541, 1985, 2449, 2923, - R. J. Mathar, Nov 09 2007

Examples

			a(3) = 6 because that is the smallest palindrome p such that 4+5+p is a semiprime, namely 4+5+6 = 15 = 3*5.
		

Crossrefs

Programs

  • Maple
    isA001358 := proc(n) if numtheory[bigomega](n) = 2 then true ; else false; fi ; end: isA002113 := proc(n) local i,digs ; if n < 10 then true; else digs := convert(n,base,10) ; for i from 1 to nops(digs) do if op(i,digs) <> op(-i,digs) then RETURN(false) ; fi ; od: RETURN(true) ; fi ; end: A131260 := proc(n) option remember ; local a,i ; if n = 1 then 4; else for a from A131260(n-1)+1 do if isA002113(a) and isA001358( a+add(A131260(i),i=1..n-1) ) then RETURN(a) ; fi ; od: fi ; end: seq(A131260(n),n=1..70) ; # R. J. Mathar, Nov 09 2007
  • Mathematica
    a = {4, 5}; Do[i = a[[ -1]] + 1; While[Not[FromDigits[Reverse[IntegerDigits[i]]] == i] || Not[Sum[FactorInteger[Plus @@ a + i][[j, 2]], {j, 1, Length[FactorInteger[ Plus @@ a + i]]}] == 2], i++ ]; AppendTo[a, i], {50}]; a (* Stefan Steinerberger, Nov 17 2007 *)

Extensions

Corrected and extended by R. J. Mathar and Stefan Steinerberger, Nov 09 2007
Showing 1-5 of 5 results.