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!)
A201543 a(n) is the smallest positive integer not in {a(1), ..., a(n - 1)} such that the sum of the least significant digit of a(n) and the most significant digit of a(n - 1) is a prime, with a(1) = 1. 1
1, 2, 3, 4, 7, 6, 5, 8, 9, 12, 11, 14, 16, 21, 10, 22, 13, 24, 15, 26, 19, 31, 18, 32, 20, 23, 25, 29, 30, 28, 33, 34, 38, 40, 17, 36, 42, 27, 35, 44, 37, 48, 39, 50, 46, 41, 43, 47, 49, 51, 52, 56, 58, 60, 45, 53, 62, 55, 66, 57, 68, 61, 65, 67, 71, 54, 70, 64, 75, 74, 76, 80, 59, 72, 84, 63, 77, 86, 69, 81, 73, 90, 78, 94, 82, 79, 96, 88, 83, 85, 89, 93, 92, 98, 102, 91, 104, 101, 106, 111, 112, 114, 116, 121, 122 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Eric Angelini is the originator of this sequence. It is believed that the sequence is a derangement of the positive integers.
LINKS
EXAMPLE
a(1) = 1 so a(2) >= 2. As the most significant digit of a(1)+ the least significant digit of a(2) equals 3, a prime, then a(2) = 2.
MAPLE
A201543 := proc(n)
option remember;
if n =1 then
1;
else
for a from 2 do
if not a in [seq(procname(i), i=1..n-1)] then
adgs := convert(a, base, 10) ;
a1dgs := convert(procname(n-1), base, 10) ;
if isprime(op(1, adgs)+op(-1, a1dgs)) then
return a;
end if;
end if;
end do:
end if;
end proc:
for n from 1 to 120 do
printf("%d, ", A201543(n)) ;
end do: # R. J. Mathar, Dec 14 2011
MATHEMATICA
ericPrimer[1] := 1; SetAttributes[ericPrimer, Listable]; ericPrimer[n_] := ericPrimer[n] = Module[{iter, prevEPs = ericPrimer[Range[n - 1]], notFound = True}, iter = Complement[Range[Max[prevEPs] + 1], prevEPs][[1]]; While[notFound, While[MemberQ[prevEPs, iter], iter++]; notFound = Not[PrimeQ[IntegerDigits[iter][[1]] + IntegerDigits[prevEPs[[-1]]][[-1]]]]; If[notFound, iter++]]; Return[iter]]; ericPrimer[Range[100]] (* Alonso del Arte, Dec 02 2011 *)
CROSSREFS
Sequence in context: A337305 A264966 A308728 * A073666 A092842 A343600
KEYWORD
nonn,base
AUTHOR
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 April 19 02:28 EDT 2024. Contains 371782 sequences. (Running on oeis4.)