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.

A051934 a(n) is the smallest palindrome > a(n-1) such that a(1)+a(2)+...+a(n) is a prime.

Original entry on oeis.org

2, 3, 6, 8, 22, 66, 242, 252, 262, 414, 444, 626, 676, 686, 808, 2442, 2552, 2992, 4664, 4884, 6006, 6226, 6666, 8228, 20202, 20302, 20402, 40204, 40304, 60606, 61116, 61716, 80608, 202202, 207702, 212212, 402204, 405504, 609906, 619916, 623326, 801108
Offset: 1

Views

Author

Felice Russo, Dec 21 1999

Keywords

Comments

a(n) is even except for n = 2. - Chai Wah Wu, Aug 30 2021

Crossrefs

Programs

  • Haskell
    a051934 n = a051934_list !! (n-1)
    a051934_list = f 0 a002113_list where
       f x (m:ms) | a010051 (x + m) == 1 = m : f (x + m) ms
                  | otherwise            = f x ms
    -- Reinhard Zumkeller, Dec 28 2011
  • Mathematica
    palQ[n_] := Reverse[x = IntegerDigits[n]] == x; t = {s = 2}; Do[If[palQ[n] && PrimeQ[x = s + n], AppendTo[t, n]; s = x], {n, 3, 815000}]; t (* Jayanta Basu, Jun 24 2013 *)
    sp[{t_,a_}]:=Module[{k=a+1},While[!PalindromeQ[k]||!PrimeQ[t+k],k++];{t+k,k}]; NestList[ sp,{2,2},50][[;;,2]] (* Harvey P. Dale, Jul 08 2024 *)

Extensions

Missing a(29)=40304 inserted by Reinhard Zumkeller, Dec 28 2011

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 *)

A051955 a(n) = smallest palindrome > a(n-1) such that a(1)*a(2)*...*a(n) + 1 and a(1)*a(2)*...*a(n) - 1 are primes.

Original entry on oeis.org

4, 363, 434, 484, 494, 636, 4004, 46864, 47474, 135531, 695596, 1793971, 1826281, 1933391, 4700074, 4785874, 4806084, 6462646, 6574756, 9558559, 15399351, 46288264, 53500535, 57499475, 150787051, 185808581, 197636791, 226686622
Offset: 1

Views

Author

Felice Russo, Dec 21 1999

Keywords

Crossrefs

Subsequence of A002113.

Programs

  • Mathematica
    a[1] = 4; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, id = IntegerDigits[k]; If[id == Reverse[id], p = Product[a[j], {j, 1, n - 1}]*k + 1; If[PrimeQ[p] && PrimeQ[p-2], Return[k]]]]; Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 1, 28}] (* Jean-François Alcover, Jul 30 2017 *)

Extensions

a(12)-a(28) from Donovan Johnson, Feb 17 2010
Showing 1-3 of 3 results.