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!)
A111453 a(1)=1; for n>1, a(n) is smallest positive integer not occurring earlier in the sequence such that |a(n)-a(n-1)| is composite. 1
1, 5, 9, 3, 7, 11, 2, 6, 10, 4, 8, 12, 16, 20, 14, 18, 22, 13, 17, 21, 15, 19, 23, 27, 31, 25, 29, 33, 24, 28, 32, 26, 30, 34, 38, 42, 36, 40, 44, 35, 39, 43, 37, 41, 45, 49, 53, 47, 51, 55, 46, 50, 54, 48, 52, 56, 60, 64, 58, 62, 66, 57, 61, 65, 59, 63, 67, 71, 75, 69, 73, 77 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Sequence is a permutation of the positive integers.
LINKS
FORMULA
a(n)=n for n==1 (mod 11), a(n)=n+3 for n==2 (mod 11), a(n)=n+6 for n==3 (mod 11)
a(n)=n-1 for n==4 (mod 11), a(n)=n+2 for n==5 (mod 11), a(n)=n+5 for n==6 (mod 11)
a(n)=n-5 for n==7 (mod 11), a(n)=n-2 for n==8 (mod 11), a(n)=n+1 for n==9 (mod 11)
a(n)=n-6 for n==10 (mod 11) a(n)=n-3 for n==0 (mod 11). - Robert G. Wilson v
EXAMPLE
Among those positive integers not among the first 8 terms of the sequence (4,8,10,12,...), a(9) = 10 is the lowest such that |a(9)-a(8)| = |10-6| = 4 is a composite. (|8-6|=2 and |4-6|=2 are both primes. So a(9) is not 4 or 8.)
MATHEMATICA
f[n_] := Switch[Mod[n, 11], 0, n - 3, 1, n, 2, n + 3, 3, n + 6, 4, n - 1, 5, n + 2, 6, n + 5, 7, n - 5, 8, n - 2, 9, n + 1, 10, n - 6]; Array[a, 72] (* or *)
a[1] = 1; a[n_] := a[n] = Block[{k = 1, t = Table[a[i], {i, n - 1}]}, While[Position[t, k] != {} || PrimeQ[k - a[n - 1]] || Abs[k - a[n - 1]] == 1, k++ ]; k]; Array[a, 72] (* Robert G. Wilson v *)
CROSSREFS
Cf. A002808.
Sequence in context: A228402 A154265 A198133 * A222074 A245735 A303497
KEYWORD
nonn
AUTHOR
Leroy Quet, Nov 14 2005
EXTENSIONS
More terms from Robert G. Wilson v, Nov 17 2005
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 28 18:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)