login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A061448 a(1) = 2; a(n+1) = smallest prime > a(n) with leading digit equal to final digit of a(n). 3
2, 23, 31, 101, 103, 307, 701, 1009, 9001, 10007, 70001, 100003, 300007, 700001, 1000003, 3000017, 7000003, 30000001, 100000007, 700000001, 1000000007, 7000000001, 10000000019, 90000000019, 90000000023, 300000000077 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
From R. J. Mathar, Feb 15 2012: (Start)
Starting with other primes we find:
3, 31, 101, 103, 307, 701, 1009, 9001, 10007,.. or
5, 53, 307, 701, 1009, 9001, 10007, 70001, 10000.... or
7, 71, 101, 103, 307, 701, 1009, 9001, 10007, 70001 .. or
11, 13, 31, 101, 103, 307, 701, 1009, 9001,.. or
13, 31, 101, 103, 307, 701, 1009, 9001,.. or
17, 71, 101, 103, 307, 701, 1009, 9001, 10007,.. or
19, 97, 701, 1009, 9001, 10007, 70001, 100003,.. (End)
LINKS
FORMULA
a(n) = A054262(n-1), n>2. - R. J. Mathar, Jan 30 2009
EXAMPLE
a(5) = 103, hence a(6) = 307.
MAPLE
A061448 := proc(n)
option remember;
local a, sdig, adgs, ad ;
if n = 1 then
2;
else
sdig := procname(n-1) mod 10 ;
a := nextprime(procname(n-1)) ;
while true do
adgs := convert(a, base, 10) ;
ad := op(-1, adgs) ;
if op(-1, adgs) = sdig then
if isprime(a) then
return a;
end if;
elif ad > sdig then
a := sdig*10^nops(adgs) ;
elif ad < sdig then
a := sdig*10^(nops(adgs)-1) ;
end if;
a := nextprime(a) ;
end do:
end if;
end proc: # R. J. Mathar, Feb 15 2013
MATHEMATICA
a[1]=2; a[n_] := (v=IntegerDigits[a[n-1]]; v1=If[v[[ -1]]>v[[1]], v[[ -1]]*10^(Length[v]-1), If[v[[ -1]]<v[[1]]||Length[v]==1, v[[ -1]]*10^Length[v], a[n-1]]]; For[m=v1+1, !PrimeQ[m], m++ ]; m); Table[a[n], {n, 35}] (* Farideh Firoozbakht, Aug 30 2003 *)
CROSSREFS
Sequence in context: A049568 A049556 A049580 * A007510 A117242 A144550
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, May 03 2001
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), May 17 2001
Terms from a(18) added by Patrick De Geest, Jun 04 2001
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 18 22:34 EDT 2024. Contains 370951 sequences. (Running on oeis4.)