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.

A186698 Next prime after n-th positive palindrome.

Original entry on oeis.org

2, 3, 5, 5, 7, 7, 11, 11, 11, 13, 23, 37, 47, 59, 67, 79, 89, 101, 103, 113, 127, 137, 149, 157, 163, 173, 191, 193, 211, 223, 223, 233, 251, 257, 263, 277, 283, 293, 307, 317, 331, 337, 347, 359, 367, 379, 389, 397, 409, 419, 431, 439, 449, 457, 467, 479, 487, 499, 509, 521, 541, 541, 547, 557, 569, 577, 587, 599, 607, 617, 631, 641, 647
Offset: 1

Views

Author

Harvey P. Dale, Feb 25 2011

Keywords

Comments

There are infinitely many n for which a(n+1) = a(n). For example, when 10^k + 1 is composite, 10^k - 1 and 10^k + 1 are successive palindromes which have the same next prime. - Robert Israel, Nov 04 2015

Crossrefs

Programs

  • Maple
    digrev:= proc(x) option remember; local t;
       t:= x mod 10;
       t*10^ilog10(x)+procname((x-t)/10)
    end proc:
    for x from 0 to 9 do digrev(x):= x od:
    N:=6;
    Pals:= $1..9:
    for d from 2 to N do
      if d::even then
        m:= d/2;
        Pals:= Pals, seq(n*10^m + digrev(n), n=10^(m-1)..10^m-1);
      else
        m:= (d-1)/2;
        Pals:= Pals, seq(seq(n*10^(m+1)+y*10^m+digrev(n), y=0..9), n=10^(m-1)..10^m-1);
      fi
    od:
    Pals:=[Pals]:
    map(nextprime,Pals); # Robert Israel, Nov 04 2015
  • Mathematica
    NextPrime[Select[Range[700],PalindromeQ]] (* Harvey P. Dale, Jan 31 2024 *)
  • Python
    from sympy import nextprime
    def A186698(n): return int(nextprime((c:=n+1-x)*x+int(str(c)[-2::-1] or 0) if n+1<(x:=10**(len(str(n+1>>1))-1))+(y:=10*x) else (c:=n+1-y)*y+int(str(c)[::-1] or 0))) # Chai Wah Wu, Jul 10 2024

Formula

a(n) = A151800(A002113(n+1)). - Michael S. Branicky, Jul 10 2024

A182487 Nextprime(F(n)) - prevprime(F(n)), where F(n) is the n-th Fibonacci number.

Original entry on oeis.org

3, 4, 4, 6, 4, 6, 6, 14, 10, 10, 6, 6, 8, 18, 12, 24, 16, 10, 6, 12, 30, 12, 24, 42, 30, 24, 60, 24, 30, 34, 30, 36, 46, 12, 36, 18, 34, 24, 24, 30, 36, 52, 72, 16, 22, 48, 44, 50, 34, 20, 20, 28, 44, 50, 40, 92, 60, 86, 16, 52, 48, 66, 46, 168, 50, 174, 36
Offset: 4

Views

Author

Alex Ratushnyak, May 02 2012

Keywords

Comments

Smallest prime following Fibonacci(n) minus largest prime immediately preceding Fibonacci(n). Starting from Fibonacci(4), because for n<4 there is no prime preceding Fibonacci(n).

Examples

			a(0) = A014208(4) - A180422(0) = 5 - 2 = 3,
a(7) = A014208(11) - A180422(7) = 97-83 = 14.
		

Crossrefs

Cf. A079677 (distance from F(n) to the nearest prime).

Programs

  • Maple
    a:= n-> (f-> nextprime(f)-prevprime(f))(combinat[fibonacci](n)):
    seq(a(n), n=4..100);  # Alois P. Heinz, Jul 29 2015
  • Mathematica
    Table[f = Fibonacci[n]; NextPrime[f] - NextPrime[f, -1], {n, 4, 100}] (* T. D. Noe, May 02 2012 *)

Formula

a(n) = A014208(n+4) - A180422(n).

A186697 Next Fibonacci number after n-th prime number.

Original entry on oeis.org

3, 5, 8, 8, 13, 21, 21, 21, 34, 34, 34, 55, 55, 55, 55, 55, 89, 89, 89, 89, 89, 89, 89, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 610
Offset: 1

Views

Author

Harvey P. Dale, Feb 25 2011

Keywords

Crossrefs

Cf. A014208 (next prime after the n-th Fibonacci number).

Programs

  • Mathematica
    With[{fibs=Fibonacci[Range[20]]},Table[First[Select[fibs,#>Prime[n]&]],{n,75}]]

A186700 Next palindrome after n-th prime.

Original entry on oeis.org

3, 4, 6, 8, 22, 22, 22, 22, 33, 33, 33, 44, 44, 44, 55, 55, 66, 66, 77, 77, 77, 88, 88, 99, 99, 111, 111, 111, 111, 121, 131, 141, 141, 141, 151, 161, 161, 171, 171, 181, 181, 191, 202, 202, 202, 202, 212, 232, 232, 232, 242, 242, 242, 252, 262, 272, 272, 272, 282, 282, 292, 303, 313, 313, 323, 323, 333, 343, 353, 353, 363, 363, 373, 383, 383, 393, 393, 404, 404
Offset: 1

Views

Author

Harvey P. Dale, Feb 25 2011

Keywords

Crossrefs

Programs

  • Mathematica
    palQ[n_] := # == Reverse@ # &@ IntegerDigits@ n; Table[k = Prime@ n + 1; While[! palQ@ k, k++]; k, {n, 79}] (* Michael De Vlieger, Nov 05 2015 *)
  • PARI
    a(n) = {p = prime(n)+1; while ((d = digits(p)) && (Vecrev(d)!=d), p++); p;} \\ Michel Marcus, Nov 05 2015
Showing 1-4 of 4 results.