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.

A262463 If n is prime a(n) = n else a(n) = nextprime(reverse(n)), where "next prime" is the smallest prime >= n, see A007918.

This page as a plain text file.
%I A262463 #20 May 12 2018 10:44:31
%S A262463 2,2,3,5,5,7,7,11,11,2,11,23,13,41,53,61,17,83,19,2,13,23,23,43,53,67,
%T A262463 73,83,29,3,31,23,37,43,53,67,37,83,97,5,41,29,43,47,59,67,47,89,97,5,
%U A262463 17,29,53,47,59,67,79,89,59,7,61,29,37,47,59,67,67,89,97,7,71,29,73,47,59,67,79,89,79,11,19,29
%N A262463 If n is prime a(n) = n else a(n) = nextprime(reverse(n)), where "next prime" is the smallest prime >= n, see A007918.
%H A262463 Maghraoui Abdelkader, <a href="/A262463/b262463.txt">Table of n, a(n) for n = 1..200</a>
%F A262463 a(n)=n if n is prime;
%F A262463        else b=reverse(n);
%F A262463        if b is prime a(n)=b else a(n)=nextprime(b);
%F A262463 (using "next prime" function as "smallest prime >= n"; see A007918. )
%e A262463 For n=7 a(7)=7.
%e A262463 For n=12, reverse(12)=21; a(12)=nextprime(21)=23.
%t A262463 Table[Which[PrimeQ[n],n,PrimeQ[IntegerReverse[n]],IntegerReverse[n], True, NextPrime[ IntegerReverse[ n]]],{n,100}] (* _Harvey P. Dale_, May 12 2018 *)
%o A262463 (PARI) rev(n)={d=digits(n); p=""; for(i=1, #d, p=concat(Str(d[i]), p)); return(eval(p))}
%o A262463 i=0; t=vector(200);
%o A262463 findn(n)={if(isprime(n),t[i++]=n, a=rev(n); b=nextprime(a); t[i++]=b); }
%o A262463 for(n=1,200,findn(n)); t
%Y A262463 Cf. A000040, A077018.
%K A262463 nonn,base
%O A262463 1,1
%A A262463 _Maghraoui Abdelkader_, Sep 23 2015